Configure mcp-proxy for SSE or stdio transport to enhance server communication
The mcp-proxy
is a versatile tool designed to facilitate seamless communication between AI applications and data sources using the Model Context Protocol (MCP). It serves as an essential bridge allowing various MCPC clients, such as Claude Desktop, Continue, Cursor, and more, to connect to remote servers or local services through standardized protocols. By leveraging MCP, developers can build integrations that are both robust and interoperable across different AI tools.
mcp-proxy
enables AI applications to communicate with remote servers over Server-Sent Events (SSE), even if the app itself does not support native SSE connections. This mode is crucial for clients like Claude Desktop, which can then interact with remote services without requiring modifications.
This mode allows local applications to be proxied through a network port, exposing them as an SSE server. It effectively bridges the gap between local services and remote clients, making it possible to manage multiple connections in a secure and scalable manner.
mcp-proxy
implements both nio-stdioclient
, for converting stdio streams into SSE connections, and nio-sseclient
, for handling incoming SSE connections and proxying them as stdio. This bi-directional communication ensures that data can flow seamlessly between local and remote systems.
You can extend the default container image to include additional tools, such as uv
, by creating a custom Dockerfile:
# file: mcp-proxy.Dockerfile
FROM ghcr.io/sparfenyuk/mcp-proxy:latest
# Install uv package
RUN python3 -m ensurepip && pip install --no-cache-dir uv
ENV PATH="/usr/local/bin:$PATH" \
UV_PYTHON_PREFERENCE=only-system
ENTRYPOINT [ "mcp-proxy" ]
With the custom Dockerfile
, you can define a service in your Docker Compose file to run mcp-proxy
:
services:
mcp-proxy-custom:
build:
context: .
dockerfile: mcp-proxy.Dockerfile
network_mode: host
restart: unless-stopped
ports:
- 8096:8096
command: "--pass-environment --sse-port=8096 --sse-host 0.0.0.0 uvx mcp-server-fetch"
Imagine an AI application that needs to fetch real-time data from a remote server. mcp-proxy
can act as the intermediary, converting stdio-based requests into SSE-encrypted streams for secure communication. This setup enhances both security and performance by handling encrypted data over a network.
Consider an AI developer working on several local tools that need to connect to multiple external services. By running mcp-proxy
as a local service, the developer can manage multiple connections efficiently without modifying each tool individually.
The following table outlines compatibility and status of popular MCP clients:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
mcp-proxy
is designed to handle connections efficiently, providing low-latency data flow between local and remote systems. It supports multiple clients simultaneously, ensuring scalability for various use cases.
{
"mcpServers": {
"claude-fetcher": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-claude"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
mcp-proxy
supports advanced configurations such as environment variable passing, custom headers, and detailed logging through the --debug
flag. Developers can configure these options to optimize performance and maintain compatibility with various AI clients.
mcp-proxy
environment.Q: Can mcp-proxy handle multiple MCP client connections simultaneously?
mcp-proxy
supports handling multiple simultaneous clients, ensuring efficient resource management and scalability.Q: What are the main differences between stdio to SSE mode and SSE to stdio mode in mcp-proxy?
Q: How can I secure my MCP client integration using mcp-proxy
?
Q: Can mcp-proxy be used with non-MCP clients as well?
mcp-proxy
is primarily designed for MCP clients, it can be adapted using custom configurations to support other types of clients through intermediary conversions.Q: How do I extend the container image to include additional tools like uv
in a production environment?
Contributions are welcome! To contribute, follow these steps:
git checkout -b feature-branch
).npm test
.git push origin feature-branch
).By leveraging mcp-proxy
, developers can build robust, scalable AI applications that seamlessly integrate with a wide range of data sources and tools. The combination of advanced features and compatibility makes it an essential tool in modern AI development workflows.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration