mcp-gateway
Allows a configured GitHub MCP server to be exposed through the gateway, providing namespaced GitHub tools with policy, budget, and audit management.
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., "@mcp-gatewaywhat tools are available and which servers are healthy?"
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.
MCP Gateway
One local MCP endpoint for all your MCP servers.
MCP Gateway sits between your MCP clients and your MCP servers. Configure it once, point every client at it, and manage everything in one place: namespaced tools, profiles, policy, context budgets, audit logs, and a local dashboard — over stdio or Streamable HTTP.
Claude / Cursor / opencode / any MCP client
│ stdio or HTTP
▼
┌───────────────────────────┐
│ MCP Gateway │ namespacing · profiles · policy
│ │ budget · audit · dashboard
└─────────────┬─────────────┘
┌───────────┬─────┴─────┬───────────┐
▼ ▼ ▼ ▼
filesystem github tokensaver … more serversWhy
Every MCP client keeps its own copy of every server configuration. Five clients times eight servers is forty places to update a token, a path, or a flag. And as servers accumulate, so do questions: which server exposes which tool, which ones are down, which tools may run, and what is eating the context window. The gateway answers all of it once.
Related MCP server: mcp-gw
Features
Aggregation — any number of stdio MCP servers behind one endpoint.
Namespacing — stable
server__toolnames; no collisions, clear origin.Profiles — different server sets for different contexts (
work,docs,personal).Policy — allow/deny rules with glob patterns, plus a read-only mode that blocks mutating tools.
Budgets — token cost of aggregated tool schemas, ranked per server and per tool.
Audit — JSONL log of every tool call with duration and outcome;
statssummaries.Health — per-server timeouts; broken servers never block startup;
gateway_statusandgateway_policytools.Transports — MCP over stdio, or Streamable HTTP with a local dashboard.
Quick start
npx -y mcp-gateway init
npx -y mcp-gateway add filesystem -- npx -y @modelcontextprotocol/server-filesystem .
npx -y mcp-gateway add tokensaver -- npx -y tokensaver-mcp
npx -y mcp-gateway listPoint clients at the gateway:
{
"mcpServers": {
"gateway": {
"command": "npx",
"args": ["-y", "mcp-gateway", "serve"]
}
}
}HTTP mode with the dashboard:
npx -y mcp-gateway serve --http --port 8787
# MCP endpoint: http://127.0.0.1:8787/mcp
# Dashboard: http://127.0.0.1:8787/Configuration
mcp-gateway.json:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "..." }
}
},
"profiles": {
"default": { "servers": ["filesystem", "github"] },
"docs": {
"servers": ["filesystem"],
"policy": { "readOnly": true }
}
},
"activeProfile": "default",
"policy": {
"defaultAction": "allow",
"readOnly": false,
"rules": [
{ "server": "github", "tool": "delete_*", "action": "deny" },
{ "server": "github", "tool": "get_*", "action": "allow" }
]
},
"audit": { "enabled": true, "path": "mcp-gateway.audit.jsonl" }
}Policy rules use glob patterns (*, ?), first match wins, and read-only mode blocks tools whose names look mutating (write_*, create_*, delete_*, run_*, …). Profiles can override the global policy.
CLI reference
Command | Purpose |
| Write a starter config. |
| Add an upstream stdio server to a profile. |
| Remove a server everywhere. |
| Show servers, profiles, policy, and audit settings. |
| Token cost of aggregated tool schemas (connects to upstreams). |
| Summarize the audit log. |
| Recent audit entries. |
| Run the gateway (stdio by default). |
Global options: --config <path>, --profile <name>, --audit, --audit-path <p>, --json, --force.
Exit codes: 0 success, 1 config or runtime failure, 2 usage error.
MCP tools exposed by the gateway
Tool | Purpose |
| Every allowed upstream tool, namespaced. |
| Upstream health, tool counts, policy summary, schema cost. |
| Active policy: mode, rules, and blocked tools with reasons. |
| Token cost of tool schemas ranked per server and tool. |
Design principles
Local-first: no network service, no telemetry; everything runs on your machine.
Transparent: tool names show origin; blocked calls explain which rule denied them.
Bounded: per-server timeouts, bounded startup, token estimates instead of tokenizers.
Safe by default: audit disabled unless enabled; read-only mode available per profile.
Composable: works with any stdio MCP server, including the TokenSaver family.
Development
npm install
npm run typecheck
npm run build
npm testThe suite covers config parsing, upstream lifecycle, policy decisions, namespacing, budgets, audit logs, CLI flows, end-to-end stdio routing, and MCP over Streamable HTTP with a live dashboard API.
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Stateless MCP gateway and OTel span-streaming bridge for hosted MCP servers.
Guarded MCP server for agent-readable business truth, provenance, readiness, and discovery.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceSelf-hosted MCP proxy and aggregation platform. Register multiple upstream MCP servers and expose them through a single unified endpoint with namespace routing, multi-transport support (HTTP/SSE, stdio, OpenAPI→MCP), per-tool overrides, and a web admin UI.18MIT
- AlicenseNot gradedqualityBmaintenanceAggregates multiple MCP servers into a single HTTP endpoint with tool namespacing, dashboard, and REST API for management.38 npmMIT
- AlicenseNot gradedqualityCmaintenanceCentralized MCP control plane that proxies multiple upstream MCP servers with tool namespacing, filtering, policy enforcement, audit logging, and health checks.12 npmMIT
- AlicenseNot gradedqualityCmaintenanceAggregates multiple upstream MCP servers (stdio, streamable-http, sse, websocket) behind a single streamable-HTTP endpoint with declarative configuration, namespacing, filtering, and auto-reload.MIT