tiny-mcp-gateway
Routes MCP tool calls prefixed with 'github/' to a GitHub MCP backend, enabling repository and GitHub API operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tiny-mcp-gatewaycall github/repo for openai GPT-5"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tiny-mcp-gateway
Zero-dependency MCP proxy/gateway server. Aggregate multiple MCP servers, route by tool prefix, load-balance, and enforce auth + rate limits. Like a reverse proxy for AI agent tool infrastructure.
pip install tiny-mcp-gateway # coming soonWhy?
Multiple MCP servers — Claude Desktop, Cursor, and custom servers all need separate clients
No aggregation layer — no standard way to expose multiple MCP servers behind one endpoint
No routing — can't route
github/*tools to a GitHub backend andfile/*to a filesystem backend
tiny-mcp-gateway is one file that solves all three: proxy, router, load balancer, auth gateway — zero deps.
Related MCP server: mcp-gw
Quick Start
from tiny_mcp_gateway import MCPGateway, Backend
gw = MCPGateway(port=8080)
# Register backends
gw.add_backend(Backend(name="github", url="https://api.github.com/mcp"))
gw.add_backend(Backend(name="files", url="stdio:python -m mcp_fileserver"))
gw.add_backend(Backend(name="database", url="https://db.internal/mcp"))
# Route by tool prefix
gw.route_tool("github/", "github", priority=10)
gw.route_tool("file/", "files", priority=10)
gw.route_tool("db/", "database", priority=10)
gw.set_default_backend("github")
# Generate an API key
key = gw.add_api_key(label="my-agent", rate_limit=100, scopes=["read"])
print(f"Gateway running. Key: {key}")
# Run the server
gw.run() # starts on port 8080Making Requests
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "github/repo",
"arguments": {"owner": "openai", "repo": "GPT-5"}
}
}'Auth & Rate Limiting
# Create keys with different scopes and rate limits
gw.add_api_key(label="read-only-agent", scopes=["read"], rate_limit=50)
gw.add_api_key(label="full-agent", scopes=["read", "write"], rate_limit=200)
# Pass key in params (works with all backends)
curl -X POST http://localhost:8080/mcp \
-d '{"method": "tools/call", "params": {"name": "github/repo", "_api_key": "mcp_xxx"}}'HMAC Signing (for webhook backends)
import os
# Set HMAC secret (shared with your backend)
os.environ["MCP_GATEWAY_HMAC_SECRET"] = "super-secret-key"
gw = MCPGateway(hmac_secret=os.environ["MCP_GATEWAY_HMAC_SECRET"])
gw.add_backend(Backend(
name="secure-service",
url="https://secure.internal/mcp",
secret="super-secret-key", # backend verifies HMAC signature
))
gw.run()Architecture
Clients tiny-mcp-gateway
| |
|-- POST /mcp (auth) -----------> [Auth] --> [Router] --> [Backend Pool]
| tools/call github/repo | |
| v v
|-- GET /health ---------> [Health] [GitHub MCP] [Files MCP]
|-- GET /routes --------> [Route Map] [DB MCP]Backend Types
HTTP Backend
gw.add_backend(Backend(name="api", url="https://api.example.com/mcp"))Stdio Backend (local subprocess)
gw.add_backend(Backend(
name="files",
url="stdio:npx @anthropic/mcp-server-filesystem ./data"
))
gw.add_backend(Backend(
name="github",
url="stdio:python -m mcp_github --token $GITHUB_TOKEN"
))Health & Monitoring
# Health check
curl http://localhost:8080/health
# {"status": "ok", "backends": [{"name": "github", "healthy": true, "failures": 0}]}
# Route map
curl http://localhost:8080/routes
# {"backends": [...], "routes": [{"prefix": "github/", "backend": "github", "priority": 10}]}ASGI / WSGI Compatible
Works with any ASGI server (uvicorn, hypercorn) or as a plain Python module:
# uvicorn
import uvicorn
from tiny_mcp_gateway import MCPGateway
app = MCPGateway(port=8080)
uvicorn.run(app, host="0.0.0.0", port=8080)
# Or run directly
app.run()AI Agent Fit
tiny-mcp-gateway is the backbone of a multi-tool agent architecture:
Single endpoint — agents connect to one gateway, access all tools
Tool routing — automatic routing by prefix, no manual tool dispatch
Load balancing — weighted round-robin across backend replicas
Circuit breaking — unhealthy backends are skipped automatically
Auth enforcement — per-key rate limits and scopes
This is the architecture that makes tiny-agent-service work with external MCP servers:
tiny-agent (reasoning) --> tiny-mcp-client --> tiny-mcp-gateway --> [MCP Servers]
|
+-> GitHub tools
+-> Filesystem tools
+-> Database toolsAPI Reference
Method | Description |
| Create gateway |
| Register a backend |
| Add routing rule |
| Set fallback backend |
| Create API key |
| Start server |
| ASGI entry point |
Ecosystem
Part of the tiny-* zero-dependency toolkit for Python agent infrastructure:
tiny-agent — zero-dep agent framework
tiny-mcp-client — MCP client (stdio + SSE)
tiny-task — durable task queue
tiny-retry — retry + circuit breaker
tiny-webhook — production webhook handler
fast-cache — LRU + TTL + SWR cache
snapdb — lightning-fast embedded DB
All single-file, MIT, zero dependencies. Built by OpenClaw.
License
MIT © 2026 OpenClaw (hussain-alsaibai)
This server cannot be deployed
Maintenance
Related MCP Connectors
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
MCP Gateway: wrap any MCP server with cold-start retries, uptime SLA, and per-execution MPP billing.
The official MCP Server for the Mux API
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseBqualityCmaintenanceA flexible proxy server that aggregates multiple backend MCP servers into a single interface using STDIO or SSE transports. It supports dynamic server management via an HTTP API and utilizes namespacing to prevent tool conflicts across connected services.31MIT
- AlicenseNot gradedqualityAmaintenanceAggregates multiple MCP servers into a single HTTP endpoint with tool namespacing, dashboard, and REST API for management.13 npmMIT
- AlicenseNot gradedqualityDmaintenanceA unified MCP gateway that aggregates multiple MCP servers and API plugins behind a single endpoint with authentication, rate limiting, audit logging, REST API bridge, and web dashboard.8MIT
- AlicenseNot gradedqualityBmaintenanceA standalone MCP gateway/proxy server that lets any MCP-compatible client search and call tools across multiple downstream MCP servers through a single mcp proxy tool.8 npmMIT