Skip to main content

MCP Proxy

The MCP protocol defines two types of transports: stdio and HTTP. For HTTP, there are two sub-types of transports:

  • HTTP SSE (defined in version 2025-03-26)
  • Streamable HTTP (defined in version 2025-06-18).

Different MCP servers and clients can choose to support different transports. The choice of transport depends on the supported MCP protocol version, the server and client usage scenarios, and implementation considerations.

An MCP client needs to support the transport provided by the server to interact with the server. In practice, transport conversion may be necessary.

For example, a file system MCP server uses the stdio transport because it accesses local files. If this MCP server is run on a shared server and converted to the HTTP transport, multiple MCP clients can access and share files on the server.

If an MCP client does not support the HTTP transport, a MCP server with HTTP transport can be converted to the stdio transport for use by the client.

Several tools exist to perform MCP transport conversion, including mcp-proxy and supergateway.

Here, we use mcp-proxy as an example. Refer to the official guide to install it.

The first example converts stdio to HTTP. This converts the file system MCP server to HTTP. In the following command, HTTP SSE is used as the new transport, port 8080 is used, and the command after the two dashes starts the file system MCP server.

mcp-proxy --port=8080 -- npx -y @modelcontextprotocol/server-filesystem /tmp

The second example converts HTTP SSE to stdio. The following command starts the MCP server.

mcp-proxy http://localhost:9000/sse

Using the MCP proxy, we can convert MCP transports to provide greater flexibility.