mcp-gate sits between your AI agents and your MCP servers. Each server gets its own URL, each agent gets its own token, and passwords or API keys in a server's answer are hidden before the agent sees them. It is one Go binary, built on the official MCP Go SDK.
I run about a dozen MCP servers for my own agents. I wanted secrets hidden from the model, a way to read a hidden value myself, a name on every token so the log shows who called what, OAuth that works with real providers, and new protocol versions soon after they come out. The open-source gateways I tried each had some of this, none had all of it. I patched one of them for a while, but my pull requests there waited a long time for review. So I wrote my own.
-
A URL per server
Local (stdio) and remote (Streamable HTTP or legacy SSE) servers are served at/<server>/mcp. The gate starts local servers, checks that they respond and restarts them when they crash. While a server restarts, agents can still list its tools. -
Or one URL for all of them
Optional. Withaggregate: {}in the config,/mcpserves the tools of many servers at once, named<server>__<tool>, so a client needs one entry. Each token sees only the servers that accept it, plus the public ones. -
A token per agent
Each token has a name, and the log line for every call says which token made it. A token can work for all servers or for one, and a server can be open without a token. -
Allow and deny lists
Choose which tools, prompts and resources each server shows to agents, and narrow them further for one token, so that each agent sees only its own tools. -
Hidden secrets
API keys, private keys,Authorizationheaders,.envlines and passwords in URLs become[REDACTED:<kind>]in answers, error messages and server logs. If the gate cannot check an answer, the agent gets an error instead. Files a tool downloads are checked too. -
Secret vault
Optional. Hidden values stay in memory for a day, and only your own key reads them back. Agent tokens cannot. -
OAuth for remote servers
mcp-gate auth loginsigns in once in any browser. The gate stores the grant and refreshes it. -
Easy to run and to move to
Health endpoints, a/_statuspage, JSON logs that never contain arguments or answers, and systemd units. With the socket unit, a restart or an upgrade refuses no connection and fails no call, and agents keep their sessions.importconverts a TBXark/mcp-proxy config, andcompareshows what differs between two gateways.
| mcp-gate | mcp-proxy | Docker | ContextForge | agentgateway | |
|---|---|---|---|---|---|
| A URL per server | ✅ | ✅ | ❌ | ➖ | ✅ |
| A named token per agent | ✅ | ❌ | ❌ | ✅ | ✅ |
| Filters for tools, prompts, resources | ✅ | ➖ | ➖ | ✅ | ✅ |
| Hides secrets in answers | ✅ | ❌ | ➖ | ➖ | ➖ |
| Secret vault for the owner | ✅ | ❌ | ❌ | ❌ | ❌ |
| OAuth to remote servers | ✅ | ✅ | ✅ | ✅ | ➖ |
| One binary, no database | ✅ | ✅ | ❌ | ❌ | ✅ |
| All tools behind one URL | ✅ | ❌ | ✅ | ✅ | ✅ |
| Different tools for different agents | ✅ | ❌ | ❌ | ✅ | ✅ |
| Web UI | ❌ | ❌ | ➖ | ✅ | ✅ |
| SSO and roles | ❌ | ❌ | ❌ | ✅ | ✅ |
| Legacy SSE transport | ➖ 🔜 | ✅ | ❔ | ✅ | ✅ |
🔜 planned, links to the issue. ➖ partly: tools only; mcp-gate reaches servers over legacy SSE but serves clients only streamable HTTP; Docker blocks the whole call instead of hiding the secret; ContextForge and agentgateway hide secrets through plugins; agentgateway's OAuth is token exchange. ❔ not documented. Checked against each project's docs in October 2026, corrections welcome.
mcp-gate suits a handful of MCP servers on one machine. If you need what the lower rows list, look at ContextForge, agentgateway, MetaMCP or MCPJungle.
10 small stdio servers and 1 HTTP server behind each gateway; 4 agents, each with a session to all 11 servers, make 1000 tools/call in total. Median of 3 runs, Linux x86-64, October 2026.
| mcp-gate | mcp-proxy | Docker | ContextForge | agentgateway | |
|---|---|---|---|---|---|
| Gateway, idle | 22 MB | 18 MB | 43 MB | 371 MB | 37 MB |
| Gateway, peak under load | 25 MB | 21 MB | 48 MB | 387 MB | 47 MB |
| Gateway plus servers, after load | 79 MB | 81 MB | 875 MB | 1862 MB | 112 MB |
| Server processes kept | 10 | 10 | 40 containers | 10 + 10 bridges | 50 |
PSS, except RSS for mcp-gate: it is not dumpable, so its PSS needs root, and RSS is an upper bound (mcp-proxy by RSS: 20 MB idle, 22 MB peak). Totals count the gateway, its server processes, containers with their docker helpers, and bridges, but not the shared HTTP server. The test servers are tiny Go programs of about 4 MB each; real servers often take tens of megabytes, so the totals grow with what you run. Docker and agentgateway start a copy of each server for every agent session; agentgateway also kept the 10 from the session that listed the tools. ContextForge ran on SQLite with one worker and needs a bridge per stdio server. Versions: mcp-gate 0.1.3, mcp-proxy 1.1.0, Docker mcp-gateway 0.44.2, ContextForge 1.1.0, agentgateway 1.6.0.
Download an archive for Linux or macOS (amd64 or arm64) from Releases and check it against checksums.txt. You can also build from source with Go 1.27 or newer:
go install github.com/vsem-azamat/mcp-gate/cmd/mcp-gate@latestCreate gate.yaml:
version: 1
listen:
addr: 127.0.0.1:9090
auth:
tokens:
laptop: "${GATE_TOKEN_LAPTOP}" # the name shows up in the audit log
servers:
files:
stdio:
command: npx
args: [-y, "@modelcontextprotocol/server-filesystem", /srv/shared]
tools: {deny: [write_file, move_file]}
docs:
http:
url: https://docs.example.com/mcp
oauth: {} # run `mcp-gate auth login gate.yaml docs` onceCheck the config, then run the gate:
export GATE_TOKEN_LAPTOP=$(openssl rand -hex 32)
mcp-gate check -connect gate.yaml
mcp-gate serve gate.yamlPoint a client at a server's endpoint:
{
"mcpServers": {
"files": {
"type": "http",
"url": "http://127.0.0.1:9090/files/mcp",
"headers": {"Authorization": "Bearer <GATE_TOKEN_LAPTOP>"}
}
}
}The configuration reference lists every key. To run the gate as a service, see systemd.
| Command | What it does |
|---|---|
serve |
Run the gateway |
check |
Validate a config; with -connect, also start every server once and report what it serves |
auth |
login, status and logout for OAuth servers |
compare |
Diff the tools, prompts and resources of two endpoints or snapshots |
import |
Convert an mcp-proxy config.json |
| Configuration | Every key, its default and its meaning |
| Commands | How to use each subcommand |
| Operations | systemd units, running behind a reverse proxy, switching from mcp-proxy |
| Architecture | How serving, downstreams, redaction, escrow and OAuth are built |
| Specifications | The exact behaviour, as requirements and scenarios |
| Development | Setup, checks, tests and releases |
Version 0.1. I use it every day with about a dozen servers. The config has a version number (version: 1), and an unknown key is an error. systemctl reload applies a changed config without a restart. Missing something? Open an issue.
Issues, fixes and features are welcome. I answer issues and review pull requests as soon as I can, usually within a day or two. Start with CONTRIBUTING; AGENTS.md has the working rules, and security issues go through private reporting.