mcp-proxy
sparfenyuk · sparfenyuk/mcp-proxy
A proxy tool that converts between different Model Context Protocol (MCP) server communication transports, like stdio and SSE/StreamableHTTP.
A bridge between Streamable HTTP and stdio MCP transports
Preview
What you can do with it
- Connect a Claude Desktop client (stdio) to an external MCP server that only supports SSE.
- Enable an MCP server using StreamableHTTP to communicate with clients expecting stdio.
- Develop and test MCP servers by adapting their communication protocols.
Safety check
No risky patterns found in the files we scanned.
Automated scan of the repo files. Always review code you run.
From the README
mcp-proxy
- mcp-proxy
About
The mcp-proxy is a tool that lets you switch between server transports. There are two supported modes:
- stdio to SSE/StreamableHTTP
- SSE to stdio
1. stdio to SSE/StreamableHTTP
Run a proxy server from stdio that connects to a remote SSE server.
This mode allows clients like Claude Desktop to communicate to a remote server over SSE even though it is not supported natively.
graph LR
A["Claude Desktop"] <--> |stdio| B["mcp-proxy"]
B <--> |SSE| C["External MCP Server"]
style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px
style B fill:#e6e6ff,stroke:#333,color:black,stroke-width:2px
style C fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px
1.1 Configuration
This mode requires providing the URL of the MCP Server's SSE endpoint as the program’s first argument. If the server uses Streamable HTTP transport, make sure to enforce it on the mcp-proxy side by passing --transport=streamablehttp.
Arguments
| Name | Required | Description | Example |
|---|---|---|---|
command_or_url | Yes | The MCP server SSE endpoint to connect to | http://example.io/sse |
--headers | No | Headers to use for the MCP server SSE connection | Authorization 'Bearer my-secret-access-token' |
--transport | No | Decides which transport protocol to use when connecting to an MCP server. Can be either 'sse' or 'streamablehttp' | streamablehttp |
--client-id | No | OAuth2 client ID for authentication | your_client_id |
--client-secret | No | OAuth2 client secret for authentication | your_client_secret |
--token-url | No | OAuth2 token endpoint URL for authentication | https://auth.example.com/oauth/token |
--username | No | Username for authentication | user |
--password | No | Password for authentication | password |
--digest | No | Use digest authentication |
Environment Variables
| Name | Required | Description | Example |
|---|---|---|---|
API_ACCESS_TOKEN | No | Can be used instead of --headers Authorization 'Bearer ' | YOUR_TOKEN |
1.2 Example usage
mcp-proxy is supposed to be started by the MCP Client, so the configuration must be done accordingly.
For Claude Desktop, the configuration entry can look like this:
{
"mcpServers": {
"mcp-proxy": {
"command": "mcp-proxy",
"args": [
"http://example.io/sse"
],
"env": {
"API_ACCESS_TOKEN": "access-token"
}
}
}
}
2. SSE to stdio
Run a proxy server exposing a SSE server that connects to a local stdio server.
This allows remote connections to the local stdio server. The mcp-proxy opens a port to listen for SSE requests,
spawns a local stdio server that handles MCP requests.
graph LR
A["LLM Client"] <-->|SSE| B["mcp-proxy"]
B <-->|stdio| C["Local MCP Server"]
style A fill:#ffe6f9,stroke:#333,color:black,stroke-width:2px
style B fill:#e6e6ff,stroke:#333,color:black,stroke-width:2px
style C fill:#e6ffe6,stroke:#333,color:black,stroke-width:2px
2.1 Configuration
This mode requires the --sse-port argument to be set. The --sse-host argument can be set to specify the host IP
address that the SSE server will listen on. Additional environment variables can be passed to the local stdio server
using the --env argument. The command line arguments for the local stdio server must be passed after the --
separator.
Arguments
| Name | Required | Description | Example