MCP Gateway
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.
MCP Gateway
A managed gateway for Model Context Protocol servers. Register MCP servers once, then let many agents share them through one endpoint with API-key auth, per-tenant scopes, rate limiting, guardrails, and full audit logging.
How it works
agents gateway upstream MCP servers
┌──────┐ POST /mcp ┌──────────────┐ stdio / SSE ┌──────────────┐
│agent │ ──────────────────► │ auth, scope │ ──────────────► │ calc (stdio) │
│agent │ tools/list,call │ rate limit │ multiplexed ├──────────────┤
│agent │ ◄────────────────── │ guardrails │ shared conns │ notes (stdio)│
└──────┘ qualified tools │ audit log │ └──────────────┘
calc__add, … └──────────────┘The gateway presents itself as a single MCP server. Tools are namespaced by
upstream (calc__add), so clients discover and call everything through one
tools/list / tools/call surface.
Related MCP server: mcp-gateway
Quickstart
npm install
export MCP_GW_ADMIN_TOKEN="pick-a-secret"
npm run build
node dist/index.jsRegister the bundled demo servers and mint a key:
ADMIN=(-H "Authorization: Bearer pick-a-secret" -H "Content-Type: application/json")
curl "${ADMIN[@]}" -d '{"name":"calc","transport":{"type":"stdio","command":"node","args":["demo-servers/calc.ts"]}}' \
localhost:8080/admin/servers
KEY=$(curl -s "${ADMIN[@]}" -d '{"name":"agent-1","servers":["*"]}' \
localhost:8080/admin/keys | python3 -c "import json,sys; print(json.load(sys.stdin)['secret'])")
curl -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"calc__add","arguments":{"a":40,"b":2}}}' \
localhost:8080/mcp
# {"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"42"}]}}Or run the full scripted tour (build, register, call, denied call, rate limit, audit):
./scripts/demo.shFeatures
Upstream registry: register stdio and SSE MCP servers; the gateway runs the
initializehandshake and caches the tool catalog. One shared connection per server, multiplexed across clients.Auth and scopes: API keys with per-tenant server scopes (
["calc"]or["*"]) and optional tool-level allowlists. Secrets are sha256-hashed at rest, shown once at creation.Rate limiting: per-key token buckets with optional per-key overrides;
x-ratelimit-remainingon every response.Guardrails: gateway-wide tool deny patterns, max argument size, per-call timeouts, max output size.
Audit and stats: every call (including denials and 429s) lands in a JSON-lines audit log and an in-memory ring for the live dashboard; per-tool/per-tenant counters for usage charts.
Admin API: manage servers, keys, stats, and logs under
/admin(bearer token).Dashboard: React UI for servers, tool catalog, live request log, usage charts, and key management. Served by the gateway when
dashboard/distexists.
API surface
Endpoint | Auth | Description |
| API key | JSON-RPC: |
| none | Liveness probe |
| admin token | Upstream registry |
| admin token | API key management |
| admin token | Aggregated tool catalog |
| admin token | Usage counters |
| admin token | Recent audit entries |
Tool calls return gateway error codes in the -3200x range: -32001 upstream
timeout, -32002 upstream unavailable, -32003 rate limited, -32004
unauthorized, -32005 forbidden, -32006 guardrail violation.
Configuration
Variable | Default | Description |
| (required) | Bearer token for |
|
| Listen address |
|
| Per tool-call timeout |
|
| Max tool arguments size |
|
| Max upstream output size |
|
| Default token bucket |
|
| Audit log directory |
Development
npm test # vitest, 37 tests
npm run typecheck # tsc --noEmit
npm run build # emit to dist/Docker (compose file included; images not built here):
MCP_GW_ADMIN_TOKEN=secret docker compose up --buildLayout
src/ gateway: proxy, admin api, registry, auth, limits, audit
transports/ stdio and SSE JSON-RPC transports
demo-servers/ calculator and notes MCP servers used by the demo
dashboard/ react admin UI (served from / when built)
tests/ 37 vitest tests
scripts/demo.sh end-to-end demo against real local processesLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP gateway: one connection for your AI apps, with tool policies, PII redaction and audit logs.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Paid MCP tools behind one endpoint. Agents pay per call in USDC on Base via x402.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA production-ready unified entry point for AI agents that implements the Model Context Protocol (MCP). It provides a secure gateway with rate limiting, authentication, and observability for managing and proxying requests to multiple downstream APIs.MIT
- AlicenseNot gradedqualityCmaintenanceProvides a security and context-control layer that multiplexes multiple MCP servers behind a single endpoint, scanning tool definitions and results, enforcing authorization, rate limiting, and audit logging, and dynamically retrieving tools to manage context window usage.MIT
- AlicenseNot gradedqualityBmaintenanceExposes any number of upstream MCP servers (stdio subprocesses or Streamable HTTP endpoints) as one MCP server for LLM agents, with namespaced tool names so servers cannot shadow each other. Every tool call passes centralized OAuth 2.1 bearer validation, per-client tool RBAC, rate limits, JSON Schema argument checks, a hash-chained audit log, and tool-definition pinning that quarantines changed tools until an operator approves them.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI clients to connect through a single multiplexed SSE/HTTP endpoint to multiple local and remote MCP servers, with token authentication, per-tool approval policies, tool namespacing, and live telemetry.39 npm1MIT