MCP Stdio — Claude Code MCP server: stdio-to-HTTP gateway
Connects MCP clients to remote HTTP MCP servers, and can also expose a local stdio server as an HTTP endpoint.
claude mcp add mcp-stdio -- uvx mcp-stdioWhat MCP Stdio does
MCP Stdio runs in both directions. In its default mode an MCP client sees a local stdio server, while requests travel to a remote server over Streamable HTTP or SSE. Bearer tokens, custom headers and OAuth 2.1 with PKCE all work here, including dynamic client registration and token refresh. Tokens survive restarts.
mcp-stdio serve flips that around: a local stdio server written in any language becomes a Streamable HTTP endpoint. You can guard it with a bearer token or the embedded OAuth 2.1, and with OAuth on, each user gets a separate backend. Pick the transport with --transport. For newer servers there is --protocol-era auto — the gateway asks which protocol the server speaks and adapts, so your client stays untouched. Leave the flag out and nothing changes.
Everything runs through uvx, so uv has to be on the machine. If you use a hosted client metadata document, its redirect_uris must list the loopback callback without a port — http://127.0.0.1/callback — because the real callback binds a fresh port each run and the authorization server has to accept any port for a loopback redirect.
What it helps with
- point Claude at a remote MCP server over HTTP
- forward a bearer token or custom headers to a remote server
- complete OAuth 2.1 with PKCE and token refresh without manual steps
- publish a local stdio server as a Streamable HTTP endpoint
- keep each OAuth user on a separate backend
Example prompts for the agent
- Add mcp-stdio as an MCP server and connect it to my remote server over Streamable HTTP with a bearer token.
- Run
mcp-stdio serveand expose my local stdio server as an HTTP endpoint with OAuth 2.1. - Turn on
--protocol-era autoso the gateway detects which protocol the remote server speaks.
How to install MCP Stdio
Platform CLI
claude mcp add mcp-stdio -- uvx mcp-stdiouvx runs the command named after the package; if the README names another one, use uvx --from mcp-stdio <command>
Platform CLI
codex mcp add mcp-stdio -- uvx mcp-stdiouvx runs the command named after the package; if the README names another one, use uvx --from mcp-stdio <command>
Config file
{
"mcpServers": {
"mcp-stdio": {
"command": "uvx",
"args": [
"mcp-stdio"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from mcp-stdio <command>
Config file
{
"servers": {
"mcp-stdio": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-stdio"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from mcp-stdio <command>
Platform CLI
gemini mcp add mcp-stdio uvx mcp-stdiouvx runs the command named after the package; if the README names another one, use uvx --from mcp-stdio <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about MCP Stdio
How do I install MCP Stdio in Claude Code?
Run claude mcp add mcp-stdio -- uvx mcp-stdio. That registers the server in your Claude config and launches it through uvx.
What does MCP Stdio do?
It bridges stdio and HTTP. By default it takes requests from an MCP client over stdio and relays them to a remote server over HTTP; in serve mode it does the reverse and serves a local stdio server as an HTTP endpoint.
Which authentication methods does it support?
Bearer tokens, custom headers, and OAuth 2.1 with PKCE, dynamic client registration and token refresh. In serve mode you can protect the endpoint with a bearer token or the embedded OAuth 2.1.