Provides Docker support for containerized deployment of the MCP proxy server with Docker and Docker Compose configurations
Supports environment variable configuration through .env files for managing API tokens and server settings
Enables integration with GitHub services through the @modelcontextprotocol/server-github package for repository operations
Includes Mermaid diagrams in documentation to visualize the proxy architecture and data flow between components
Built as a Python-based MCP proxy server that enables transport switching between stdio and SSE protocols
Uses Shields.io badges to display project metadata like license and Python version compatibility in documentation
secure-mcp-proxy
A secure MCP (Model Context Protocol) proxy that enables switching between server transports with built-in API token authentication.
Note: This project is forked from sparfenyuk/mcp-proxy and enhanced with additional security features.
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.
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.
Features
- Transport switching: stdio ↔ SSE/StreamableHTTP
- API token authentication: Secure your MCP servers with Bearer token auth
- CORS support: Configure allowed origins for web clients
- Multiple servers: Host multiple named MCP servers simultaneously
- Docker support: Container-ready with Docker and Docker Compose
- Flexible configuration: CLI arguments, environment variables, and JSON config files
- Developer friendly: Built-in token generator and status endpoint
Quick Start
Installation
From Source
Running the Proxy
CLI Mode
Named Server Mode
Client Mode (Connect to Remote Server)
Configuration
Environment Variables
MCP_PROXY_API_TOKEN
: API token for authentication (optional)API_ACCESS_TOKEN
: Token for connecting to remote servers (client mode)
Named Server Configuration File
Create a servers.json
file:
Configuration fields:
enabled
: Whether to start this server (default:true
)command
: Command to executeargs
: Command arguments as arrayauth
: Whether authentication is required (default:false
)env
: Environment variables for this server
Authentication
Authentication is controlled by the MCP_PROXY_API_TOKEN
environment variable. When set, you can configure which servers require authentication on a per-server basis.
Authentication Modes
- No authentication: When
MCP_PROXY_API_TOKEN
is not set, all endpoints are public - Selective authentication: When
MCP_PROXY_API_TOKEN
is set, authentication is controlled per-server:
- CLI Mode: Always public (no authentication required)
- Named Server Mode: Follow the
auth
field setting (true
= auth required,false
or omitted = public)
Setting Up Authentication
Per-Server Authentication
You can configure which servers require authentication using the auth
field in your configuration file:
Generate Secure Tokens
Docker Support
Basic Docker Usage
Docker Compose
Command Line Reference
Common Options
Option | Description | Example |
---|---|---|
--port | Server port | --port 3000 |
--host | Server host | --host 0.0.0.0 |
--named-server-config | Config file path | --named-server-config servers.json |
--named-server | Define named server | --named-server fetch 'uvx mcp-server-fetch' |
--allow-origin | CORS origins | --allow-origin "*" |
--debug | Enable debug logging | --debug |
Troubleshooting
Common Issues
- ENOENT error: Use full path to binary in Claude Desktop config
- Port already in use: Change port with
--port
option - 401/403 errors: Check your
MCP_PROXY_API_TOKEN
environment variable - Module not found: Ensure you're in the correct directory and dependencies are installed
Debug Mode
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A MCP Proxy (Local <-> SSE) with token based authentication.
Related MCP Servers
- AsecurityAlicenseAqualityEnables interaction with remote MCP servers using SSE transport instead of STDIO for enhanced communication capabilities.Last updated -11,495PythonMIT License
- -securityAlicense-qualityA proxy service that connects MCP clients to remote MCP servers, allowing users to use server keys from MCP.so to access remote resources without running their own server.Last updated -373TypeScriptMIT License
- -securityFlicense-qualityA server for Model Context Protocol (MCP) that uses Server-Sent Events (SSE) for streaming communication, enabling tools like the HackerNews API to be accessed through a secure HTTP+SSE transport.Last updated -23TypeScript
- -securityAlicense-qualityA reference implementation for creating an MCP server supporting Streamable HTTP & SSE Transports with OAuth authorization, allowing developers to build OAuth-authorized MCP servers with minimal configuration.Last updated -76TypeScriptMIT License