MCP Gateway

MCP Gateway

A TypeScript gateway that aggregates multiple MCP servers into a single endpoint, enabling AI agents to access tools from many backends through one connection.

Category
Visit Server

README

MCP Gateway

A TypeScript gateway that aggregates multiple MCP (Model Context Protocol) servers into a single endpoint, enabling AI agents to access tools from many backends through one connection.

AI Agent
   │
   ▼
MCP Gateway  ←─── servers.json (config)
   │
   ├── Ceph Storage Assistant  (fastmcp)
   ├── Other MCP Server        (sse / streamable-http)
   └── Local Tool              (stdio)

⚠️ Agent Support

Currently, MCP Gateway officially supports Hermes Agent only.

Hermes connects using the MCP Streamable HTTP protocol (2025-11-25) via mcp.client.streamable_http. Support for other agents (LangChain, AutoGen, OpenAI Agents SDK, etc.) is planned for future development.


Features

  • Multi-server aggregation — connect as many MCP servers as needed, tools are merged into one list
  • Namespace isolation — tools are prefixed with server ID (ceph_alpha__get_health_summary) so agents know exactly which backend to target, even when multiple servers expose the same tool names
  • 4 transport types — supports all current MCP transport protocols plus a custom Ceph-compatible transport
  • Persistent configservers.json is the single source of truth; adding/removing servers via the dashboard persists across restarts
  • Web dashboard — visual overview of connected servers and aggregated tools
  • Docker-ready — runs in a container with host networking for internal backend access

Transport Types

Value Protocol Use when
streamable-http MCP 2025-11-25 Server uses modern Streamable HTTP
sse MCP 2024-11-05 Server uses legacy SSE protocol
fastmcp Custom (Ceph) Ceph Storage Assistant — persistent POST stream
stdio stdio Local process (npx, python, etc.)

Quick Start

1. Start the gateway

docker compose up -d --build

Dashboard: http://localhost:3010

2. Add MCP servers

Open the dashboard and click "Add New MCP-Client". Select the transport type, enter the URL and an ID — the server connects immediately and is saved automatically.

servers.json is automatically updated by the gateway whenever you add or remove a server via the dashboard or API. There is no need to edit this file manually.

Only edit it directly if you want to pre-configure servers before the very first docker compose up.

3. Connect Hermes

In your Hermes config.yaml:

mcp_servers:
  Ceph-Alpha:
    url: http://localhost:3010/sse?apiKey=mcp_gateway_secret_123

Hermes will discover all aggregated tools automatically. Tools are namespaced by server ID:

  • ceph_alpha__get_health_summary
  • ceph_alpha__get_cluster_capacity
  • my_other_mcp__some_tool

Configuration

Environment variables (docker-compose.yaml)

Variable Default Description
PORT 3010 Gateway listen port
API_KEY mcp_gateway_secret_123 Auth key required in ?apiKey=
SERVERS_CONFIG /app/servers.json Path to servers config file

servers.json schema

[
  { "id": "string", "transport": "streamable-http", "url": "http://..." },
  { "id": "string", "transport": "sse",             "url": "http://..." },
  { "id": "string", "transport": "fastmcp",         "url": "http://..." },
  { "id": "string", "transport": "stdio", "command": "npx", "args": ["pkg"] }
]

servers.json is automatically updated whenever you add or remove a server via the dashboard or API. Only edit it manually to pre-configure servers before the first docker compose up — after that, use the dashboard.


Management API

# List connected servers + status
curl http://localhost:3010/api/status

# List all aggregated tools
curl http://localhost:3010/api/tools

# Add a server at runtime (persisted to servers.json)
curl -X POST http://localhost:3010/api/servers \
  -H "Content-Type: application/json" \
  -d '{"id":"new-server","transport":"streamable-http","url":"http://..."}'

# Remove a server at runtime (removed from servers.json)
curl -X DELETE http://localhost:3010/api/servers/new-server

# Test tools/list as an agent would
curl -X POST "http://localhost:3010/sse?apiKey=mcp_gateway_secret_123" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1,"params":{}}'

Development

# Install dependencies
npm install

# Run in dev mode (hot reload)
npm run dev

# Build
npm run build

# Start production
npm start

# Docker
docker compose up -d --build   # build & start
docker compose restart          # restart (picks up servers.json changes)
docker compose logs -f          # stream logs

Project Structure

mcp-gateway/
├── src/
│   ├── index.ts        # Express app, /sse endpoint, management API
│   ├── aggregator.ts   # Tool/resource/prompt fan-out + namespace prefixing
│   ├── upstream.ts     # Transport classes, UpstreamManager
│   └── config.ts       # Zod schema for servers.json
├── public/             # Web dashboard (HTML/CSS/JS)
├── docs/
│   └── plan.md         # Architecture & issue history
├── servers.json        # Upstream server registry (persistent)
└── docker-compose.yaml

Roadmap

  • [ ] Support for additional AI agents (LangChain, AutoGen, OpenAI Agents SDK, ...)
  • [ ] Auto-reconnect on upstream stream drop
  • [ ] Health check endpoint per upstream server
  • [ ] Authentication per upstream (API key injection)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured