Skip to content

FuzzySecurity/stdio-proxy-mcp

Repository files navigation

stdio-proxy

stdio-proxy exposes a stable stdio MCP server for legacy HTTP+SSE MCP servers. It opens the downstream SSE session, discovers the session POST endpoint, forwards JSON-RPC traffic, reconnects when the stream dies, and keeps client-side configuration simple.

Why Proxy SSE

Legacy MCP SSE transports split one logical session across a long-lived SSE stream and separate HTTP POST requests. That shape is fragile for CLI clients: streams go idle, session endpoints expire, localhost names can be inconsistent, and reconnect behavior is usually left to each client implementation.

Build

npm install
npm run build
./dist/stdio-proxy doctor --profile jeb
./dist/stdio-proxy --profile jeb

GitHub Actions publishes release zips for Linux x64, Linux arm64, macOS arm64, and Windows x64. On macOS, run this once from inside the extracted release folder before starting the proxy:

xattr -dr com.apple.quarantine .

macOS marks downloaded binaries with a quarantine attribute, and the unsigned macOS release can be blocked by Gatekeeper even though it was built by GitHub Actions. This removes that download marker from the extracted folder so the ad-hoc signed Bun executable can run normally.

Config

The release zip includes config.toml next to the binary. The default file includes a jeb profile:

[profiles.jeb]
target_url = "http://127.0.0.1:8425/mcp"

[profiles.jeb.headers]
accept = "text/event-stream"

To add another target, add another [profiles.<name>] section and run the proxy with that profile:

[profiles.other]
target_url = "http://127.0.0.1:9000/mcp"
request_timeout_ms = 120000
replay_safe_methods = ["ping", "tools/list", "resources/list", "prompts/list"]

[profiles.other.headers]
accept = "text/event-stream"
./stdio-proxy --profile other

Use --config /path/to/config.toml when the config is not beside the binary.

Add To Clients

Codex:

codex mcp list
codex mcp add jeb -- /your/path/to/bun/build/stdio-proxy --profile jeb
codex mcp get jeb
codex mcp remove jeb

Claude Code:

claude mcp list
claude mcp add jeb -- /your/path/to/bun/build/stdio-proxy --profile jeb
claude mcp get jeb
claude mcp remove jeb

Use a different MCP name and --profile <name> for additional profiles in the same TOML file.

Useful Commands

./stdio-proxy --help
./stdio-proxy doctor --profile jeb
./stdio-proxy --profile jeb

License

Apache-2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors