Skip to main content
Glama
moaaz01

MCP Multi-Server Gateway

by moaaz01

๐ŸŒ MCP Multi-Server Gateway

Aggregate, route, and orchestrate multiple MCP backend servers behind a single MCP endpoint. Connect one gateway to Claude Desktop/Cursor and access all your MCP servers โ€” weather, database, file system, and more.

License: MIT Python 3.10+


โœจ Why a Gateway?

Instead of configuring each MCP server individually in your client:

// โŒ Without Gateway: 3 entries in claude_desktop_config.json
{
  "weather": { "command": "...", "args": ["weather_server.py"] },
  "sqlite": { "command": "...", "args": ["sqlite_server.py", "--db-path", "..."] },
  "filesystem": { "command": "...", "args": ["filesystem_server.py", "--sandbox", "..."] }
}

// โœ… With Gateway: 1 entry โ€” register/unregister servers at runtime
{
  "gateway": { "command": "python", "args": ["gateway.py"] }
}

Related MCP server: mcpware

โœจ Features

  • ๐Ÿ”ง 5 Tools: register_server, remove_server, list_servers, call_backend, route_pipeline

  • โฑ๏ธ Async Routing: Concurrent tool execution across backends via asyncio

  • ๐Ÿ“‹ Pipeline Support: Pre-configured multi-step workflows (weather-analysis, database-report)

  • ๐Ÿ“ Auto-Registration: Load backend config from JSON file on startup

  • ๐Ÿ”Œ Runtime Dynamic: Register/unregister servers without restarting

  • โฒ๏ธ Timeout Handling: 10-second per-backend timeout prevents hangs

  • ๐Ÿ–ฅ๏ธ Dual Transport: stdio and Streamable HTTP


๐Ÿš€ Quick Start

# 1. Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# 2. Start the gateway
python gateway.py

# 3. Register backend servers (from MCP client)
register_server(name="weather", command="python", args="weather_server.py", description="Weather alerts")
register_server(name="sqlite", command="python", args="sqlite_server.py --db-path /tmp/sample.db", description="Database queries")

With auto-registration:

python gateway.py --auto-register gateway-config.json

๐Ÿ› ๏ธ Tools Reference

register_server(name, command, args, description) -> str

Register a new backend MCP server at runtime.

remove_server(name) -> str

Remove a registered server.

list_servers() -> str

List all registered backends with status and tool counts.

call_backend(server, tool, params) -> str

Execute a tool on a specific backend. params is a JSON string.

route_pipeline(scenario) -> str

Execute a pre-configured multi-step pipeline:

  • "weather-analysis" โ€” alerts + forecast

  • "database-report" โ€” schema inspection + query

  • "custom" โ€” compose your own workflow


๐Ÿ”Œ Connecting to Clients

Claude Desktop

{
  "mcpServers": {
    "gateway": {
      "command": "python",
      "args": ["/ABSOLUTE/PATH/mcp-multi-server-gateway/gateway.py"]
    }
  }
}

Streamable HTTP Mode

python gateway.py --transport streamable-http --port 8003

๐Ÿ“ Project Structure

mcp-multi-server-gateway/
โ”œโ”€โ”€ gateway.py              # Main gateway server (FastMCP + asyncio)
โ”œโ”€โ”€ gateway-config.json     # Example auto-registration config
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ setup.sh
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

๐Ÿ—๏ธ Architecture

         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚       MCP Client (Claude, etc)       โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚  single MCP connection
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚     MCP Multi-Server Gateway         โ”‚
         โ”‚     (gateway.py on :8003)            โ”‚
         โ”‚                                      โ”‚
         โ”‚  register / call_backend / pipeline  โ”‚
         โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚          โ”‚          โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚ Weather  โ”‚ โ”‚  SQLite  โ”‚ โ”‚ FileSystemโ”‚
     โ”‚ Server   โ”‚ โ”‚  Server  โ”‚ โ”‚  Server   โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ’ก Use Cases

Scenario

Tools Involved

Example

DevOps Debugging

sqlite.query + filesystem.read_file

"Check DB schema, then read config file"

Data Analysis

sqlite.list_tables + sqlite.query

"What tables exist? Give me top 10 customers"

Multi-weather check

weather.get_alerts ร— 2

"Alerts for CA and TX simultaneously"

Automated report

All servers in sequence

"Get weather data โ†’ query DB โ†’ write report"


๐Ÿ“œ License

MIT

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    Proxy that aggregates multiple MCP servers and presents them as a unified interface, allowing clients to access resources from multiple servers transparently.
    Last updated
    5
  • F
    license
    -
    quality
    -
    maintenance
    Aggregates multiple MCP servers behind a single, secure endpoint with unified tool/resource discovery, OAuth authentication, and resilient request routing. Enables users to manage and interact with multiple MCP backends through one centralized interface with load balancing and circuit breakers.
    Last updated
    2

View all related MCP servers

Related MCP Connectors

  • MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.

  • Self-hosted federated MCP gateway: one OAuth 2.1 MCP server in front of N apps, user-level scopes.

  • The official MCP Server from Mia-Platform to interact with Mia-Platform Console

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/moaaz01/mcp-multi-server-gateway'

If you have feedback or need assistance with the MCP directory API, please join our Discord server