Skip to content
Back to search

multi-mcp

A flexible and dynamic Multi-MCP Proxy Server that acts as a single MCP server while connecting to and routing between multiple backend MCP servers over STDIO or SSE.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/kfirtoledo--multi-mcp/badge.svg)](/listings/kfirtoledo--multi-mcp)

HTML

<a href="/listings/kfirtoledo--multi-mcp"><img src="/api/listings/kfirtoledo--multi-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

To get started with this project locally:

# Clone the repository
git clone https://github.com/kfirtoledo/multi-mcp.git
cd multi-mcp

# Install using uv (recommended)
uv venv
uv pip install -r requirements.txt

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 185 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # **Multi MCP**
  2. A flexible and dynamic **Multi-MCP** Proxy Server that acts as a single MCP server while connecting to and routing between
  3. multiple backend MCP servers over `STDIO` or `SSE`.
  4. <p align="center">
  5. <img src="assets/multi-mcp-diagram.png" alt="Multi-MCP Server Architecture" width="300"/>
  6. </p>
  7. ## 🚀 Features
  8. - ✅ Supports both `STDIO` and `SSE` transports
  9. - ✅ Can connect to MCP servers running in either `STDIO` or `SSE` mode
  10. - ✅ Proxies requests to multiple MCP servers
  11. - ✅ Automatically initializes capabilities (tools, prompts, resources) from connected servers
  12. - ✅ Dynamically **add/remove MCP servers** at runtime (via HTTP API)
  13. - ✅ Supports tools with the same name on different servers (using namespacing)
  14. - ✅ Deployable on Kubernetes, exposing a single port to access all connected MCP servers through the proxy
  15. ## 📦 Installation
  16. To get started with this project locally:
  17. ```bash
  18. # Clone the repository
  19. git clone https://github.com/kfirtoledo/multi-mcp.git
  20. cd multi-mcp
  21. # Install using uv (recommended)
  22. uv venv
  23. uv pip install -r requirements.txt
  24. ```
  25. ## 🖥️ Running Locally
  26. You can run the proxy locally in either `STDIO` or `SSE` mode depending on your needs:
  27. ### 1. STDIO Mode
  28. For CLI-style operation (pipe-based communication).
  29. Used for chaining locally executed tools or agents.
  30. ```bash
  31. uv run main.py --transport stdio
  32. ```
  33. ### 2. SSE Mode
  34. Runs an HTTP SSE server that exposes a `/sse` endpoint.
  35. Useful for remote access, browser agents, and network-based tools.
  36. ```bash
  37. uv run main.py --transport sse
  38. ```
  39. **Note:** You can also configure the host and port using `--host` / `--port` arguments.
  40. ## ⚙️ Configuration
  41. The proxy is initialized using a JSON config (default: `./mcp.json`):
  42. ```json
  43. {
  44. "mcpServers": {
  45. "weather": {
  46. "command": "python",
  47. "args": ["./tools/get_weather.py"]
  48. },
  49. "calculator": {
  50. "command": "python",
  51. "args": ["./tools/calculator.py"]
  52. }
  53. }
  54. }
  55. ```
  56. This config defines the initial list of MCP-compatible servers to spawn and connect at startup.
  57. **Note:** Tool names are namespaced internally as `server_name::tool_name` to avoid conflicts and allow multiple servers to expose tools with the same base name. For example, if an MCP server named `calculator` provides an `add` tool, it will be referenced as `calculator::add`.
  58. You can also connect to a remote MCP server using SSE:
  59. ```json
  60. {
  61. "mcpServers": {
  62. "weather": {
  63. "url": "http://127.0.0.1:9080/sse"
  64. }
  65. }
  66. }
  67. ```
  68. More examples can be found in the [examples/config/](./examples/config/) directory.
  69. ## 🔄 Dynamic Server Management (SSE only)
  70. When running in SSE mode, you can **add/remove/list MCP servers at runtime** via HTTP endpoints:
  71. | Method | Endpoint | Description |
  72. |--------|------------------------|-----------------------------|
  73. | `GET` | `/mcp_servers` | List active MCP servers |
  74. | `POST` | `/mcp_servers` | Add a new MCP server |
  75. | `DELETE`| `/mcp_servers/{name}` | Remove an MCP server by name |
  76. | `GET` | `/mcp_tools` | Lists all available tools and their serves sources|
  77. ### Example to add a new server:
  78. ```bash
  79. curl -X POST http://localhost:8080/mcp_servers \
  80. -H "Content-Type: application/json" \
  81. --data @add_server.json
  82. ```
  83. **add_server.json**:
  84. ```json
  85. {
  86. "mcpServers": {
  87. "unit_converter": {
  88. "command": "python",
  89. "args": ["./tools/unit_converter.py"]
  90. }
  91. }
  92. }
  93. ```
  94. ## 🐳 Docker
  95. You can containerize and run the SSE server in K8s:
  96. ```bash
  97. # Build the image
  98. make docker-build
  99. # Run locally with port exposure
  100. make docker-run
  101. ```
  102. ## Kubernetes
  103. You can deploy the proxy in a Kubernetes cluster using the provided manifests.
  104. ### Run with [Kind](https://kind.sigs.k8s.io/)
  105. To run the proxy locally using Kind:
  106. ```bash
  107. kind create cluster --name multi-mcp-test
  108. kind load docker-image multi-mcp --name multi-mcp-test
  109. kubectl apply -f k8s/multi-mcp.yaml
  110. ```
  111. ### Exposing the Proxy
  112. The K8s manifest exposes the SSE server via a NodePort (30080 by default):
  113. You can then connect to the SSE endpoint from outside the cluster:
  114. ```sh
  115. http://<kind-node-ip>:30080/sse
  116. ```
  117. ## Connecting to MCP Clients
  118. Once the proxy is running, you can connect to it using any MCP-compatible client — such as a LangGraph agent or custom MCP client.
  119. For example, using the langchain_mcp_adapters client, you can integrate directly with LangGraph to access tools from one or more backend MCP servers.
  120. See [`examples/connect_langgraph_client.py`](examples/connect_langgraph_client.py) for a working integration example.
  121. Make sure your environment is set up with:
  122. - An MCP-compatible client (e.g. LangGraph)
  123. - .env file containing:
  124. ```env
  125. MODEL_NAME=<your-model-name>
  126. BASE_URL=<https://your-openai-base-url>
  127. OPENAI_API_KEY=<your-api-key>
  128. ```
  129. ## Inspiration
  130. This project is inspired by and builds on ideas from two excellent open-source MCP projects:
  131. - [`mcp-proxy`](https://github.com/sparfenyuk/mcp-proxy) by @sparfenyuk
  132. - [`fastmcp`](https://github.com/jlowin/fastmcp) by @jlowin

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.