MCP2SSE Proxy ClaudeAI client for streaming events and managing remote tools.
- Features
- Prerequisites
- Installation
- Quick Start
- Usage
- Configuration
- Advanced Usage
- Logging
- Contributing
- License
- Authors
- Server-Sent Events (SSE) streaming
- Remote tool and prompt discovery
- Environment variable resource management
- Configurable connection and retry mechanisms
- Flexible logging and debugging support
- Python 3.8+
- Dependencies:
- mcp
- httpx
- python-dotenv
- anyio
- httpx-sse
git clone https://github.com/your-org/mcp-sse-proxy.git
cd mcp-sse-proxy
pip install -r requirements.txt
- Windows Config location:
C:\Users\<USERNAME>\AppData\Roaming\Claude\claude_desktop_config
[or open via clinent menu:File->Settings
thenDeveloper
->Edit Config
]
Config example for Windows:
{
"globalShortcut": "",
"mcpServers": {
"mcp-sse-proxy": {
"command": "C:\\Users\\<USERNAME>\\AppData\\Local\\Programs\\Python\\Python312\\python.exe",
"args": [
"C:\\mcp-sse-proxy-claude\\src\\mcp_sse_proxy.py",
"--base-url", "http://<IP_ADDRESS>:8000",
"--debug-enabled"
],
"env": {
"RESOURCE_OPENAI_API_KEY": "sk-xxx",
"RESOURCE_BRAVE_API_KEY": "BSAxxxx"
}
}
}
}
- MacOS Config Location:
~/Library/Application Support/Claude/claude_desktop_config.json
{}
python src/mcp_sse_proxy.py
python src/mcp_sse_proxy.py --base-url https://custom-mcp-server.com
The MCP SSE Proxy connects to a remote server and proxies events to a local MCP server. By default, it uses predefined settings.
- List available remote tools
- Retrieve prompts
- Call remote tools
- Stream server-sent events
- Description: Specify the base URL for the MCP server
- Default: Predefined
BASE_URL
in the source code - Example:
python src/mcp_sse_proxy.py --base-url https://custom-mcp-server.com
- Description: Enable debug file logging
- Default: Disabled
- Example:
python src/mcp_sse_proxy.py --debug-enabled
MCP_SSE_PROXY_DEBUG
- Description: Enable or disable debug logging
- Values:
True
orFalse
- Default:
False
- Behavior: Creates
mcp_sse_proxy_debug.log
when enabled - Example:
export MCP_SSE_PROXY_BASE_URL=http://127.0.0.1:8000 export MCP_SSE_PROXY_DEBUG=True python src/mcp_sse_proxy.py
RESOURCE_*
Prefix- Description: Environment variables sent to the server as resources
- Behavior: Prefix [RESOURCE_] will be removed before sending to server
- Example:
export RESOURCE_OPENAI_API_KEY=your_api_key export RESOURCE_CUSTOM_CONFIG=some_value
Create a .env
file in the project root:
MCP_SSE_PROXY_DEBUG=True
MCP_SSE_PROXY_BASE_URL=http://127.0.0.1:8000
RESOURCE_OPENAI_API_KEY=your_api_key
RESOURCE_CUSTOM_CONFIG=some_value
- Command-line arguments
- Environment variables
.env
file- Default values in the source code
You can also configure the proxy programmatically by modifying the SseClient
parameters.
- Configurable connection retry delay
- Exponential backoff for connection attempts
- Note that by design MCP SSE Proxy will not print any messages after running in CLI mode. As by design, MCP will not log anything to STDIO, as this will interfere with protocol operation.
- Thats why, for more details - enabled via
MCP_SSE_PROXY_DEBUG
or--debug-enabled
debug file. - Logs stored in
mcp_sse_proxy_debug.log
by default in same folder where mcp_sse_proxy.exe is located. - Provides detailed information about SSE connections, tool calls, and system events (in debug file, you will see both side of connection messages - MCP and SSE)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT
- Nchekwa. Artur Zdolinski