MCPGateway — Share local MCP servers across agents
Languages (16)
English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Español · Français · Deutsch · Português (Brasil) · Italiano · Русский · العربية · हिन्दी · Bahasa Indonesia · Türkçe · Tiếng Việt
Running several coding sessions? Share one set of MCP backends to avoid duplicate memory and startup work. Keep your existing agent-to-gateway connection across a settled configuration-only restart on the tested SDK/stdio route.
Start with Copilot CLI · Client compatibility · Evidence and limits · Copilot updates
Concept illustration, not a screenshot or benchmark. English labels show warm backend reuse; product benefits and scope:
- Avoid duplicate backend memory: assumed 5 × 1.5 GB sets share one; 6 GB duplication avoided before gateway/connector overhead, not measured net savings.
- Reuse backend startup work: if all five sessions use twelve stdio services, 60 → 12 backend starts—not 80% faster elapsed startup.
- Keep the existing agent-to-gateway MCP connection: the connection survived a settled owned-gateway restart after configuration-only additions in the SDK/stdio experiment. Not hot reload, active-call continuity or universal native conversation UI proof; initial registration/runtime upgrades may require client restart. Scope
Fit / skip: useful when sessions share the same connector/catalog and expensive backends. Direct MCP may be simpler for one session or lightweight backends. Our lightweight fixture had higher summed process working set (357.0 → 564.0 MiB) and slower fully cold first shared request (gateway launch through first useful result) (1886.7 versus 503.5 ms direct). Net gains depend on overhead; measure your workload.
First useful workflow: an authorized read through the shared gateway
Requires Node.js 24+, npm, Git, Copilot CLI with plugin support, and existing MCP integrations with their required authentication. Bootstrap starts through Copilot CLI; Windows is the primary tested platform. Other-client compatibility and verification levels differ. Copilot /help · /plugin.
Before installing: configuration and backups may contain credentials; keep them private. Backend calls may contact remote services. This installs a persistent runtime: client rollback/plugin removal does not stop the daemon. Review exit and retained private state. Local private state and saved gateway tokens are owner-only, not additionally encrypted.
copilot plugin marketplace add yeelam-gordon/MCPGateway
copilot plugin install shared-mcp-gateway@mcp-gateway
- Start Copilot CLI and invoke
/mcp-gateway-setup. Review the preview and approve only intended changes. Keep the returned private backup and rollback commands; plugin installation alone does not merge configurations. - Close and reopen Copilot, then run the exact returned
readinessCommandusing the command-object invocation. A check-only command does not start an absent gateway. Save only the returned JSON object;.commandis the approved executable and.argsits exact ordered arguments. - Choose a harmless read on an integration you already use. Replace only the bracketed task in this request; aliases, tools and arguments must come from discovery/schema, not guessed defaults:
Use the shared gateway for [my authorized read-only task]. Use
list_servers, then focusedsearch_toolsandget_tool_schema; prepare schema-valid arguments with authorized non-sensitive test values. Obtain normal approvals. IfrequiresExclusiveAccess: true,claim_serveronce beforecall_toolandrelease_serverafter all calls settle; non-exclusive backends need no claim. Show the actual record or documented empty result and check errors—not just a gateway response. Never retry an unknown outcome: keep it blocked and use the private operator handoff.
- In a second session using the same connector/catalog, list/search the same alias: expect
readyand the same catalog capabilities. This checks shared discovery, not PID identity or RAM savings. Exact tool inputs and result checks, with an illustrative public echo/result pair, not real-integration proof.
If it fails: check the selected catalog/preview when empty; use backend-description terms when search has no match. For authentication or readiness/rollback, follow the canonical guide—no parallel bypass process. An unknown exclusive result requires reconciliation and an owned restart; release/disconnect is not cancellation or safe unblocking. Reclaim ownership after restart.
Choose the next detail
- Backend sharing, six-tool discovery and evidence: illustrations, adverse measurements and verification limits.
- Other clients, optional migration and upgrades: registration is not catalog merging; native verification varies. Gemini CLI has no documented route here; Antigravity is separate.
- Stop using the gateway: finish workflows; restore/remove affected connectors before owned shutdown. Preserve private state/history and unrelated processes. Configuration rollback is not runtime shutdown.
- Operational reference, alternatives, contributing and development, changelog, security reporting.
MIT — LICENSE.