The MCP Proxy Server facilitates communication between different transport protocols, with two main operating modes:
- Mode 1: stdio to SSE/HTTP: Enables clients like Claude Desktop to communicate with remote SSE servers via stdio, even without native SSE support.
- Mode 2: SSE to stdio: Allows remote clients to connect to a local stdio server over SSE.
The server includes a fetch
capability that can:
- Retrieve content from any URL
- Extract content as markdown (default) or raw HTML
- Limit returned content length (up to 1,000,000 characters)
- Specify a starting character index for output
- Provide internet access to fetch web pages
Provides code coverage reporting for the mcp-proxy project as indicated by the codecov badge at the top of the README.
Supports running and extending the proxy as a Docker container, with instructions for creating custom Docker images and Docker Compose setup.
Allows installation of the proxy via GitHub repository and displays GitHub license information through a badge.
Uses Mermaid for rendering flow diagrams that illustrate the proxy's operation modes in the README.
Enables installation of the proxy via PyPI package repository and displays PyPI-related information through badges.
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.
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 |
Environment Variables
Name | Required | Description | Example |
---|---|---|---|
API_ACCESS_TOKEN | No | Can be used instead of --headers Authorization 'Bearer <API_ACCESS_TOKEN>' | 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:
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.
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 |
---|---|---|---|
command_or_url | Yes | The command to spawn the MCP stdio server | uvx mcp-server-fetch |
--port | No, random available | The MCP server port to listen on | 8080 |
--host | No, 127.0.0.1 by default | The host IP address that the MCP server will listen on | 0.0.0.0 |
--env | No | Additional environment variables to pass to the MCP stdio server. Can be used multiple times. | FOO BAR |
--cwd | No | The working directory to pass to the MCP stdio server process. | /tmp |
--pass-environment | No | Pass through all environment variables when spawning the server | --no-pass-environment |
--allow-origin | No | Allowed origins for the SSE server. Can be used multiple times. Default is no CORS allowed. | --allow-origin "*" |
--stateless | No | Enable stateless mode for streamable http transports. Default is False | --no-stateless |
--named-server NAME COMMAND_STRING | No | Defines a named stdio server. | --named-server fetch 'uvx mcp-server-fetch' |
--named-server-config FILE_PATH | No | Path to a JSON file defining named stdio servers. | --named-server-config /path/to/servers.json |
--sse-port (deprecated) | No, random available | The SSE server port to listen on | 8080 |
--sse-host (deprecated) | No, 127.0.0.1 by default | The host IP address that the SSE server will listen on | 0.0.0.0 |
2.2 Example usage
To start the mcp-proxy
server that listens on port 8080 and connects to the local MCP server:
Named Servers
NAME
is used in the URL path/servers/NAME/
.COMMAND_STRING
is the command to start the server (e.g., 'uvx mcp-server-fetch').- Can be used multiple times.
- This argument is ignored if
--named-server-config
is used.
FILE_PATH
- If provided, this is the exclusive source for named servers, and--named-server
CLI arguments are ignored.
If a default server is specified (the command_or_url
argument without --named-server
or --named-server-config
), it will be accessible at the root paths (e.g., http://127.0.0.1:8080/sse
).
Named servers (whether defined by --named-server
or --named-server-config
) will be accessible under /servers/<server-name>/
(e.g., http://127.0.0.1:8080/servers/fetch1/sse
).
The /status
endpoint provides global status.
JSON Configuration File Format for --named-server-config
:
The JSON file should follow this structure:
mcpServers
: A dictionary where each key is the server name (used in the URL path, e.g.,/servers/fetch/
) and the value is an object defining the server.command
: (Required) The command to execute for the stdio server.args
: (Optional) A list of arguments for the command. Defaults to an empty list.enabled
: (Optional) Iffalse
, this server definition will be skipped. Defaults totrue
.timeout
andtransportType
: These fields are present in standard MCP client configurations but are currently ignored bymcp-proxy
when loading named servers. The transport type is implicitly "stdio".
Installation
Installing via Smithery
To install MCP Proxy for Claude Desktop automatically via Smithery:
Installing via PyPI
The stable version of the package is available on the PyPI repository. You can install it using the following command:
Once installed, you can run the server using the mcp-proxy
command. See configuration options for each mode above.
Installing via Github repository (latest)
The latest version of the package can be installed from the git repository using the following command:
Note
If you have already installed the server, you can update it using uv tool upgrade --reinstall
command.
Note
If you want to delete the server, use the uv tool uninstall mcp-proxy
command.
Installing as container
Starting from version 0.3.2, it's possible to pull and run the corresponding container image:
Troubleshooting
- Problem: Claude Desktop can't start the server: ENOENT code in the logsSolution: Try to use the full path to the binary. To do so, open a terminal and run the command
where mcp-proxy
( macOS, Linux) orwhere.exe mcp-proxy
(Windows). Then, use the output path as a value for 'command' attribute:
Extending the container image
You can extend the mcp-proxy
container image to include additional executables. For instance, uv
is not included by
default, but you can create a custom image with it:
Docker Compose Setup
With the custom Dockerfile, you can define a service in your Docker Compose file:
Note
Don't forget to set --pass-environment
argument, otherwise you'll end up with the error "No interpreter found in
managed installations or search path"
Command line arguments
Example config file
Testing
Check the mcp-proxy
server by running it with the mcp-server-fetch
server. You can use
the inspector tool to test the target server.
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables interaction with remote MCP servers using SSE transport instead of STDIO for enhanced communication capabilities.
- About
- stdio to SSE/StreamableHTTP
- SSE to stdio
- Named Servers
- Installation
- Extending the container image
- Docker Compose Setup
- Command line arguments
- Testing
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA simple MCP server that facilitates website fetching through a configurable server platform using stdio or SSE transport, allowing integration with tools like Cursor for streamlined access.Last updated -223PythonMIT License
- -securityFlicense-qualityMCP server enabling LLMs to perform browser tasks via SSE transport, allowing clients like Cursor.ai and Claude to open websites and interact with web content through natural language commands.Last updated -
- -securityFlicense-qualityA remote MCP server implementation for Cloudflare that uses server-sent events (SSE) to enable Model Control Protocol communication.Last updated -TypeScript
- AsecurityAlicenseAqualityThe most powerful MCP server for Slack Workspaces. This integration supports both Stdio and SSE transports, proxy settings and does not require any permissions or bots being created or approved by Workspace admins 😏.Last updated -275GoMIT License