tiny-mcp-gateway
Routes MCP tool calls prefixed with 'github/' to a GitHub MCP backend, enabling repository and GitHub API operations.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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)
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Stateless MCP gateway and OTel span-streaming bridge for hosted MCP servers.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Zero-dependency Cloudflare Worker gateway turning websites and REST APIs into MCP tools.
MCP federation gateway: route, govern and observe agent tools across clouds and MCP servers.
Related MCP Servers
- AlicenseBqualityBmaintenanceA 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 gradedqualityCmaintenanceAggregates multiple MCP servers into a single HTTP endpoint with tool namespacing, dashboard, and REST API for management.53 npmMIT
- 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.48 npmMIT
- AlicenseNot gradedqualityCmaintenanceA universal MCP gateway that aggregates multiple MCP servers into a single endpoint, providing features like hot-reload, auto-healing, and a hook system for request/response mutation.1MIT