MCP Proxy

0.11.0 · active · verified Thu Apr 16

A Python-based MCP proxy server (Model Context Protocol) that facilitates communication between MCP clients and various backend MCP servers (stdio, SSE, or streamable HTTP). It supports two primary modes: proxying a local stdio server to SSE/StreamableHTTP, or proxying an external SSE/StreamableHTTP server to stdio. The library is actively maintained, with version 0.11.0 released in January 2026, and typically sees frequent updates.

Common errors

Warnings

Install

Quickstart

The `mcp-proxy` library is primarily a command-line tool. These examples demonstrate how to run `mcp-proxy` to expose a local STDIO MCP server over SSE/HTTP, or to proxy a remote SSE/HTTP MCP server to STDIO, including the use of named servers. Ensure `uvx` (part of the `uv` toolchain) is available if you're using it to run local MCP servers.

import os

# Example 1: Proxy a local stdio MCP server to expose it via SSE/HTTP
# This command starts mcp-proxy listening on port 8080 and proxies
# an 'mcp-server-fetch' stdio server, also enabling a named server 'my_server'.
# Note: 'uvx' should be installed and in PATH, or specify full path.
print("Starting mcp-proxy to expose a local stdio server via SSE/HTTP...")
os.system("mcp-proxy --port 8080 --named-server my_server 'uvx mcp-server-fetch'")

# Example 2: Proxy an external SSE/HTTP MCP server to stdio
# This command connects mcp-proxy to a remote SSE server at http://example.io/sse
# and exposes it as a local stdio server (for clients like Claude Desktop).
# Use a dummy token for demonstration; in real use, use os.environ.get('API_ACCESS_TOKEN', '')
# to load from environment or a secure secret management system.
print("\nStarting mcp-proxy to proxy a remote SSE server to stdio...")
api_token = os.environ.get('API_ACCESS_TOKEN', 'YOUR_DUMMY_TOKEN_HERE')
print(f"Using API_ACCESS_TOKEN: {api_token[:5]}...")
os.system(f"mcp-proxy http://example.io/sse --api-access-token {api_token}")

view raw JSON →