β¨ Features Overview¶
MCP Gateway is a gateway + registry + proxy purpose-built for the Model Context Protocol (MCP). It unifies REST, MCP, and stdio worlds while adding auth, caching, federation, and an HTMX-powered Admin UI.
π Multi-Transport Core¶
Supported Transports
Transport | Description | Typical Use-case |
---|---|---|
HTTP / JSON-RPC | Low-latency request-response, default for most REST clients | Simple tool invocations |
WebSocket | Bi-directional, full-duplex | Streaming chat or incremental tool results |
Server-Sent Events (SSE) | Uni-directional server β client stream | LLM completions or real-time updates |
STDIO | Local process pipes via mcpgateway-wrapper | Editor plugins, headless CLI clients |
Try it: SSE from curl
π Federation & Discovery¶
Features
- Auto-discovery - DNS-SD (
_mcp._tcp.local.
) or static peer list - Health checks - fail-over + removal of unhealthy gateways
- Capability sync - merges remote tool catalogs into the local DB
- Request forwarding - automatic routing to the correct gateway
Architecture
graph TD
subgraph Local_Gateway
A[MCP Gateway Core]
end
subgraph Remote_Gateway_1
B[Peer 1]
end
subgraph Remote_Gateway_2
C[Peer 2]
end
A <-- ping / register --> B
A <-- ping / register --> C
Configuration
Enable or tweak discovery via .env
:
π Security¶
Auth mechanisms
- JWT bearer (default, signed with
JWT_SECRET_KEY
) - HTTP Basic for the Admin UI
- Custom headers (e.g., API keys) per tool or gateway
Rate limiting
Set MAX_TOOL_CALLS_PER_MINUTE
to throttle abusive clients. Exceeding the limit returns HTTP 429 with a Retry-After
header.
Generate a 24 h token
π Tool & Server Registry¶
What you can register
Registry | Entities | Notes |
---|---|---|
Tools | Native MCP tools or wrapped REST / CLI functions | JSON Schema input validation |
Resources | URIs for blobs, text, images | Optional SSE change notifications |
Prompts | Jinja2 templates + multimodal content | Versioning & rollback |
Servers | Virtual collections of tools/prompts/resources | Exposed as full MCP servers |
REST tool example
π₯ Admin UI¶
Built with
- FastAPI + Jinja2 + HTMX + Alpine.js
- Tailwind CSS for styling
π Audit & Metadata Tracking
- Comprehensive metadata for all entities (Tools, Resources, Prompts, Servers, Gateways)
- Creation tracking - who, when, from where, how
- Modification history - change attribution and versioning
- Federation source tracking for MCP server entities
- Bulk import batch identification
- Auth-agnostic - works with/without authentication
- Backwards compatible - legacy entities show graceful fallbacks
π Persistence, Caching & Observability¶
Storage options
- SQLite (default dev)
- PostgreSQL, MySQL/MariaDB, MongoDB - via
DATABASE_URL
Observability
- Structured JSON logs (tap with
jq
) /metrics
- Prometheus-friendly counters (tool_calls_total
,gateway_up
)/health
- readiness + dependency checks
π§© Dev & Extensibility¶
Highlights
- Makefile targets -
make dev
,make test
,make lint
- 400+ unit tests - Pytest + HTTPX TestClient
- VS Code Dev Container - Python 3.11 + Docker/Podman CLI
- Plug-in friendly - drop-in FastAPI routers or Pydantic models
Next Steps¶
- Hands-on Walk-through β Quick Start
- Deployment Guides β Compose, K8s & Cloud
- Admin UI deep dive β UI Guide
Ready to explore
With transports, federation, and security handled for you, focus on building great MCP tools, prompts, and agents-the gateway has your back.