# MCP Stdio

Connects MCP clients to remote HTTP MCP servers, and can also expose a local stdio server as an HTTP endpoint.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: shigechika
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/shigechika/mcp-stdio
- Updated: 2026-10-13
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-stdio

## What it 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.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-stdio -- uvx mcp-stdio
```
uvx runs the command named after the package; if the README names another one, use uvx --from mcp-stdio <command>

### Codex

**Platform CLI**
```bash
codex mcp add mcp-stdio -- uvx mcp-stdio
```
uvx runs the command named after the package; if the README names another one, use uvx --from mcp-stdio <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcp-stdio uvx mcp-stdio
```
uvx runs the command named after the package; if the README names another one, use uvx --from mcp-stdio <command>

## When to use it
- 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
- Add mcp-stdio as an MCP server and connect it to my remote server over Streamable HTTP with a bearer token.
- Run `mcp-stdio serve` and expose my local stdio server as an HTTP endpoint with OAuth 2.1.
- Turn on `--protocol-era auto` so the gateway detects which protocol the remote server speaks.

## Similar
- [Trentina](https://affpapa.org/en/nevibecode/mcp/trentina.md) — MCP server · ★ 11
- [mcp-jira-stdio](https://affpapa.org/en/nevibecode/mcp/mcp-jira-stdio.md) — MCP server · ★ 14
- [node-connect](https://affpapa.org/en/nevibecode/skills/node-connect.md) — skill · 793 installs
- [Agent MCP Gateway](https://affpapa.org/en/nevibecode/mcp/agent-mcp-gateway.md) — MCP server · ★ 41
- [skgate](https://affpapa.org/en/nevibecode/mcp/skgate.md) — MCP server · ★ 13
- [cloudflare-one](https://affpapa.org/en/nevibecode/skills/cloudflare-one.md) — skill · 93100 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
