Stdio-to-HTTP gateway β connects MCP clients to remote HTTP MCP servers
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
English | ζ₯ζ¬θͺ
A stdioβHTTP MCP gateway that works in both directions β the same
binary is both an MCP-over-HTTP client gateway and, via serve mode, a
full MCP-over-HTTP server (with an optional embedded OAuth 2.1
Authorization Server), so it can sit on either end of an MCP connection.
π New here? Start with the user guide β task-oriented docs for connecting a client or publishing a server. This README is the full reference.
Client gateway (default mode) β stdio β HTTP. MCP clients like Claude Desktop and Claude Code see mcp-stdio as a locally running self-hosted MCP server, while it relays all requests to a remote MCP server with support for various authentication methods:
Bearer tokens, custom headers, and OAuth 2.1 credentials are forwarded to the remote server.
Reverse gateway (mcp-stdio serve) β HTTP β stdio. The mirror image: takes a
local stdio MCP server (any language, any framework) and exposes it as a
Streamable HTTP endpoint, with optional bearer-token or embedded-OAuth-2.1
authentication, per-user backend isolation when OAuth is enabled, and a
restart-durable token store β
see Reverse gateway: serve mode below. This
is how mcp-stdio can stand in for a framework's own HTTP/OAuth hosting layer
(e.g. instead of depending on a Python web framework's built-in server for
just that part) when the tool definitions themselves already run fine over
stdio.
--transport. SSE parser follows the WHATWG Server-Sent Events spec./.well-known/oauth-protected-resourceresource field validation β warn on mismatch, continueWWW-Authenticate: Bearer resource_metadata= hint β probes the server before discovery so servers that publish PRM at a non-standard URL are found without well-known path guessingissuer validation β reject a cross-origin issuer (AS mix-up guard), warn on a same-origin mismatch (trailing slash / path / case) and continue/.well-known/openid-configuration (path-append and path-insertion) for ASes that expose only the OIDC form (Auth0, Okta, Azure AD, Google)resource parameter in authorization, token exchange, and refresh requestscode_challenge_method with an 86-char code_verifierresource indicator (RFC 8707)authorization_pending / slow_down (interval +=5 s) / expired_token / access_denied handlingurn:ietf:params:oauth:grant-type:device_code in grant_types (RFC 7591 Β§2)token_endpoint_auth_method chosen from token_endpoint_auth_methods_supported in AS metadata (prefers none β client_secret_post β client_secret_basic)client_secret_expires_at handling β auto re-register on expiryapplication_type: "native" in DCR (RFC 8252 Β§8.4 / MCP SEP-837): the loopback auth-code and headless device flows are native clients, so the loopback redirect is not rejected as the RFC 7591 default "web"--client-metadata-url presents an operator-hosted HTTPS document URL as client_id, skipping Dynamic Client Registration; honoured when set even if the AS metadata does not (yet) advertise client_id_metadata_document_supported (warns instead of silently falling back), and outranked by a pre-registered client_id (--client-id or MCP_OAUTH_CLIENT_ID) (#60)redirect_uris must include mcp-stdio's loopback callback without a port (http://127.0.0.1/callback) β the actual callback binds a fresh ephemeral port every run, and the AS must accept any port for a loopback redirect URI (RFC 8252 Β§7.3 / Β§8.4)client_secret_basic: Authorization: Basic header with percent-encoded credentials (applied to code exchange, token refresh, and Device Authorization Grant polling)Authorization: Bearer <token> request header--protocol-era auto and mcp-stdio asks the server which protocol it speaks and adapts; your MCP client needs no changes. Without the flag nothing changes, so upgrading is safe. mcp-stdio serve answers both old and new clients on the same address automatically β or only the newer ones with --modern-only, and --modern-idle-ttl reclaims idle backends. Newer clients can also hold one connection open and hear when your server's tool, prompt or resource lists change, or when a specific resource they named is updated (mcp-stdio subscribes on their behalf when your server declares resources.subscribe). Verified end to end against python-sdk v2.0.0 in both directions. β Working with MCP 2026-07-28 serversRetry-After (delta-seconds or HTTP-date) up to a 60-second cap on both 429 (Too Many Requests) and 503 (Service Unavailable) β the two spec-sanctioned Retry-After carriers (RFC 9110 Β§10.2.3) β then surfaces the status so the client can decide (cf. modelcontextprotocol/typescript-sdk#1892)nextCursor for tools/list / resources/list / resources/templates/list / prompts/list and merges the pages into one response, so clients that drop pages beyond the first still see the full list (cf. anthropics/claude-code#39586)U+2028 / U+2029 (legal in JSON, but JavaScript line terminators) in upstream responses so clients that treat them as line breaks cannot mis-frame the output; lossless (cf. modelcontextprotocol/typescript-sdk#2155)tools/call request whose arguments is null to {} so strict servers that reject the null form accept the call; on by default, opt out with --no-normalize-arguments (cf. modelcontextprotocol/typescript-sdk#2012)notifications/cancelled on stdin and drops any late upstream response carrying one of those ids before it reaches the client, per the MCP cancellation spec; on by default (60 s TTL), opt out with --no-cancel-filter (cf. anthropics/claude-code#51073)-32000 error for each on a drop β so the client can retry instead of hanging β while auto-reconnecting; cancelled ids are skipped (cf. anthropics/claude-code#60061)protocolVersion from the initialize response and injects MCP-Protocol-Version on every subsequent Streamable HTTP request (MCP spec rev 2025-06-18); servers that enforce the header would otherwise reject post-initialize requests with 400 Bad RequestNo reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-stdio)<a href="https://allmcps.com/mcp/mcp-stdio"><img src="https://allmcps.com/api/badge/mcp-stdio?style=directory" alt="MCP Stdio on AllMCPs" /></a>