Model Context Protocol

Model Context Protocol over HTTP

MCP's Streamable HTTP wire protocol by hand: discover, initialize, list and call tools, sessions, and OAuth discovery on live servers.

Developer toolsGuided#mcp#json-rpc#streamable-http#oauth#ai-agents

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

The Model Context Protocol (MCP) is the open standard AI apps use to talk to tools and data: a client (Claude, Cursor, VS Code, your own agent) connects to an MCP server and can list and call its tools, read its resources and fetch its prompts. Messages are JSON-RPC 2.0. Remote servers use the Streamable HTTP transport: one endpoint (usually /mcp) that takes a POST per message and answers with JSON or a short Server-Sent Events stream. This collection teaches that wire protocol with plain HTTP requests you can read and edit, against real public servers, and then repeats the calls with the Swastik Codes native MCP client.

Two eras you will meet

Legacy (2025-11-25 and earlier)Current (2026-07-28)
Startinitialize, then notifications/initializednothing: every request stands alone
Versionagreed once in initializesent on every request in MCP-Protocol-Version and params._meta
Sessionoptional Mcp-Session-Id, ended with DELETEnone
Routing headersnoneMcp-Method, plus Mcp-Name for tools/call, resources/read, prompts/get
Discoverythe initialize resultserver/discover

Dual-era servers (DeepWiki, Hugging Face, Cloudflare docs, Context7) accept both. A client tries a modern request first; a 400 whose body is a recognised MCP error (such as -32022 unsupported version) means stay modern, anything else means fall back to initialize.

Credentials

None. DeepWiki (https://mcp.deepwiki.com/mcp) and Hugging Face (https://huggingface.co/mcp) work anonymously for these calls; the OAuth folder only reads public metadata. For servers that need sign-in, the native MCP editor in Swastik Codes has an OAuth sign-in button that performs the discovery shown in folder 4, then the authorization code flow with PKCE, and stores the token.

Run order

  1. Start here (stateless): server/discover, tools/list, two tools/call, resources, prompts, and a deliberate version error.
  2. Legacy handshake: initialize (a test script saves any Mcp-Session-Id into sessionId), notifications/initialized (202), tools/list, tools/call, ping.
  3. Sessions: the same on Hugging Face, which does issue a session id, ending with DELETE.
  4. OAuth discovery: the 401 challenge, Protected Resource Metadata and Authorization Server Metadata for Linear and Notion.
  5. Native MCP requests: the DeepWiki tools as MCP items, with version auto and pinned to each era.

Change mcpUrl to point folders 1, 2 and 5 at another keyless server.

Limits

Public servers rate-limit anonymous callers; DeepWiki answers can take several seconds and read_wiki_contents can return megabytes of text, so this collection uses read_wiki_structure and ask_wiki_question. Hugging Face asks heavy users to sign in with a token (see its settings page).

Common errors

Status / codeMeaningWhat to do
400, -32022Protocol version not supportedRetry with a version from error.data.supported
400, no MCP error bodyLegacy server got a modern requestFall back to initialize
404, -32601Method not implemented (e.g. ping on a modern server)Check the era and capabilities
404 with a session idLegacy session expiredRun initialize again
405 on GET or DELETEServer has no standalone stream or no sessionsUse POST only
401 + WWW-AuthenticateServer needs OAuthFollow folder 4, then send Authorization: Bearer
result with isError: trueThe tool ran and failedRead the text content; fix arguments

Links

  • Specification: https://modelcontextprotocol.io/specification/2026-07-28
  • Streamable HTTP transport: https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http
  • Versioning and backward compatibility: https://modelcontextprotocol.io/specification/2026-07-28/basic/versioning
  • Authorization: https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization
  • Legacy revision 2025-11-25: https://modelcontextprotocol.io/specification/2025-11-25
  • DeepWiki MCP: https://docs.devin.ai/work-with-devin/deepwiki-mcp

Endpoints 26

1. Start here: stateless MCP (2026-07-28)

  • POSTserver/discover: what does this server speak?{{mcpUrl}}Asks the server for its supported protocol versions, capabilities, identity and usage instructions in one call. Optional for clients, but every modern server…
  • POSTtools/list{{mcpUrl}}Lists the tools the server offers, each with a name, a human title, a description written for the model, and an inputSchema (JSON Schema) for its arguments.…
  • POSTtools/call: read_wiki_structure{{mcpUrl}}Calls a tool by name with arguments that match its inputSchema. Here DeepWiki's read_wiki_structure returns the table of contents of the wiki it generated for…
  • POSTtools/call: ask_wiki_question{{mcpUrl}}Asks DeepWiki a free-text question about a repository and gets an answer grounded in its generated wiki, with links to wiki pages and a deepwiki.com search…
  • POSTresources/list{{mcpUrl}}Lists the resources (read-only data addressed by URI, such as files or records) the server exposes. Call it only when capabilities.resources is present.…
  • POSTresources/templates/list{{mcpUrl}}Lists URI templates (RFC 6570 patterns like repo://{owner}/{name}) a client can fill in to build resource URIs it then reads with resources/read. Empty on…
  • POSTprompts/list{{mcpUrl}}Lists reusable prompt templates the server offers (each with a name and optional arguments), which a client shows to the user as commands. Fetch one with…
  • POSTError: unsupported protocol version{{mcpUrl}}Deliberately asks for a protocol version the server does not know (1900-01-01) to show version negotiation. A modern server answers HTTP 400 with JSON-RPC…

2. Legacy handshake (2025-11-25 and earlier)

  • POSTinitialize{{mcpUrl}}Opens a legacy connection: the client states the protocol version it wants, its capabilities and its name; the server answers with the version it agreed to,…
  • POSTnotifications/initialized{{mcpUrl}}Tells the server the client finished initialising. It is a notification (no id), so a correct server replies HTTP 202 Accepted with an empty body. From here…
  • POSTtools/list (legacy){{mcpUrl}}The same tool listing as in folder 1, in legacy form: no _meta block and no Mcp-Method header, but the agreed version in MCP-Protocol-Version and the session…
  • POSTtools/call (legacy): read_wiki_structure{{mcpUrl}}Calls DeepWiki's read_wiki_structure the legacy way to show that only the envelope differs between revisions: params holds name and arguments exactly as…
  • POSTping{{mcpUrl}}A legacy liveness check: either side may send ping and the other must answer with an empty result {}. Clients use it to keep idle sessions alive or to detect…

3. Legacy sessions: Mcp-Session-Id and DELETE

  • POSTinitialize (Hugging Face, saves hfSessionId){{hfMcpUrl}}Opens a legacy session on the Hugging Face MCP server. The response carries an Mcp-Session-Id header (a UUID); the test script stores it in hfSessionId for…
  • POSTnotifications/initialized (with session){{hfMcpUrl}}Completes the Hugging Face handshake inside the saved session. Expect HTTP 202. Without the Mcp-Session-Id header Hugging Face rejects it with HTTP 400 and…
  • POSTtools/list (with session){{hfMcpUrl}}Lists the Hugging Face tools inside the session (hf_whoami, hub_repo_search, hub_repo_details, hf_fs). The Mcp-Session-Id header ties this request to the…
  • DELETEEnd the session (DELETE){{hfMcpUrl}}Ends a legacy session explicitly by sending HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header. Hugging Face answers 200 with deleted: true; a…

4. OAuth discovery (servers that need sign-in)

  • POSTUnauthenticated call: read WWW-Authenticate{{oauthMcpUrl}}Sends a normal tools/list to Linear's MCP endpoint without a token to trigger the challenge. Expect HTTP 401; the useful part is the WWW-Authenticate: Bearer…
  • GETProtected Resource Metadata (Linear){{oauthBase}}/.well-known/oauth-protected-resource/mcpFetches the RFC 9728 metadata for the MCP endpoint, at the well-known path with the endpoint path appended (/.well-known/oauth-protected-resource/mcp).…
  • GETAuthorization Server Metadata (Linear){{oauthBase}}/.well-known/oauth-authorization-serverFetches the RFC 8414 metadata of the authorization server named in the previous response. Read authorization_endpoint and token_endpoint for the code flow,…
  • GETProtected Resource Metadata (Notion)https://mcp.notion.com/.well-known/oauth-protected-resource/mcpThe same discovery step on Notion's MCP server, to compare a second implementation. Notion also adds a resource_name for display and lists a single default…
  • GETAuthorization Server Metadata (Notion)https://mcp.notion.com/.well-known/oauth-authorization-serverNotion's authorization server metadata. Besides the standard endpoints it lists a revocation and an introspection endpoint and several token endpoint auth…

5. The same calls as native MCP requests

  • MCPread_wiki_structure (native, auto){{mcpUrl}}Runs DeepWiki's read_wiki_structure through the app's MCP client with automatic version negotiation. Edit repoName in the arguments box; the tool list on the…
  • MCPask_wiki_question (native, auto){{mcpUrl}}Asks DeepWiki a question through the native client. repoName may also be a JSON array of up to 10 repositories to answer across several codebases at once; the…
  • MCPread_wiki_structure (pinned 2026-07-28){{mcpUrl}}The same tool call with the protocol version pinned to the stateless 2026-07-28 revision. The connection log shows no initialize and no session id, only one…
  • MCPread_wiki_structure (pinned 2025-11-25){{mcpUrl}}The same tool call pinned to the legacy 2025-11-25 revision: the log shows initialize, notifications/initialized and then tools/call. Use a pinned version…

API details

Base URL
https://mcp.deepwiki.com/mcp
https://huggingface.co/mcp
Authentication
None declared in the description
Operations
26 operations on 26 pathsPOST 21GET 4DELETE 1
Main resources
1. Start here: stateless MCP (2026-07-28) 82. Legacy handshake (2025-11-25 and earlier) 53. Legacy sessions: Mcp-Session-Id and DELETE 44. OAuth discovery (servers that need sign-in) 55. The same calls as native MCP requests 4
Description format
Swastik Codes guided collection, API version checked against the docs on 2026-11-18

How to test the Model Context Protocol over HTTP in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Model Context Protocol over HTTP collection, without the publisher's secrets.
  3. Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
  4. Send a requestPick an endpoint, for example “server/discover: what does this server speak?” (POST {{mcpUrl}}), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Model Context Protocol over HTTP?

MCP's Streamable HTTP wire protocol by hand: discover, initialize, list and call tools, sessions, and OAuth discovery on live servers. It is listed under Developer tools and has 26 endpoints.

Who publishes the Model Context Protocol over HTTP?

It is listed from Model Context Protocol's public API description (an OpenAPI document), not published by Model Context Protocol on Swastik Codes. Anyone who controls modelcontextprotocol.io can claim the profile by adding a DNS TXT record.

What is the base URL of the Model Context Protocol over HTTP?

Its description lists 2 base URLs: https://mcp.deepwiki.com/mcp, https://huggingface.co/mcp. The first is the usual one; the others are typically sandbox or regional servers.

How do I authenticate with the Model Context Protocol over HTTP?

Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.

How many endpoints does the Model Context Protocol over HTTP have?

26 operations on 26 paths (21 POST, 4 GET, 1 DELETE). The largest groups are 1. Start here: stateless MCP (2026-07-28), 2. Legacy handshake (2025-11-25 and earlier), 3. Legacy sessions: Mcp-Session-Id and DELETE, 4. OAuth discovery (servers that need sign-in).

Is forking the Model Context Protocol over HTTP free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.