Skip to main content
Glama

MCP Gateway

A single MCP server for internal LLM services. Those services call only the gateway; the gateway routes to per-app MCPs (ADO, Oracle, and the rest of the estate).

Internal LLM  →  MCP Gateway (one MCP)  →  ADO MCP, Oracle MCP, … (~50 app MCPs)

v1 also applies identity, redaction, authorization, and audit on that hop. Downstream MCP URLs and which caller may use which MCP live in static config (config/mcp-servers.yaml). IDE clients are out of scope.

This branch is initial scaffolding only. Registry load, routing, and governance are stubbed.

See docs/mcp-gateway.md for locked decisions and BDD.

Tech stack

Layer

Choice

Why

Language

Python 3.12+

Matches the team preference; strong libraries for HTTP proxies, policy, and data masking

HTTP API

FastAPI + Uvicorn

Native async, typed request models, good fit for a JSON-RPC/MCP front door on port 8000

Settings

Pydantic Settings

Env-driven config (MCP_GATEWAY_*) without a custom loader

Registry

Static YAML

config/mcp-servers.yaml — no dynamic registration in v1

Audit store

SQLAlchemy 2 (asyncio) + aiosqlite

Local SQLite audit table; same engine can move to Postgres

Downstream MCP

httpx

Async client for MCP JSON-RPC against registered app MCPs

Tests

pytest + pytest-asyncio

FastAPI TestClient for the health/JSON-RPC stubs; BDD scenarios live under tests/features/

Lint

Ruff

Single tool for lint and import sorting

Related MCP server: Multi-Provider LLM MCP Server

Layout

config/mcp-servers.yaml    # Static registry (ADO, Oracle examples)
src/mcp_gateway/
  main.py                  # FastAPI app factory and uvicorn entrypoint
  config.py                # Settings
  api/                     # HTTP: /health and JSON-RPC POST /
  auth/                    # Token → internal LLM caller (stub)
  governance/              # Redaction + authorization (stubs)
  audit/                   # Append-only audit store (stub)
  registry/                # Load static YAML catalog (stub)
  proxy/                   # MCP client to app MCPs (stub)
tests/
  features/                # Gherkin aligned with the architecture doc

Local run

Requires Python 3.12+ and uv.

uv sync --group dev
cp .env.example .env
uv run mcp-gateway

Service listens on http://localhost:8000.

curl -s http://localhost:8000/health
curl -s -X POST http://localhost:8000/ \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
uv run pytest

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Acts as an intermediary between LLMs and other MCP servers, centralizing management, sanitizing sensitive information, and providing a unified interface for discovering and interacting with proxied MCPs.
    385
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    Unified MCP server for querying multiple LLM providers (Gemini, OpenAI, Anthropic, etc.) with advanced routing, cost optimization, and fallback resilience.
    2
    6 npm
    -
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI harnesses to connect to a single MCP endpoint that routes to multiple downstream MCP servers, discovering and executing capabilities on demand while keeping tool schemas out of context.
    4
    29 npm
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents and MCP clients to safely access upstream MCP servers through centralized policy enforcement, including allow/deny/approval decisions, schema pinning, circuit breakers, and audit logging.
    MIT