Multi-user MCP management and lazy proxy gateway that makes MCP work like Skills: progressive capability discovery, on-demand server startup, and one stable gateway for every agent.
pip install mcp-manager-gateway==1.6.3 Copy PIP instructions
Make MCP work like Skills: discover capabilities progressively, start servers only when needed, and give every agent one stable gateway.
MCP servers are useful, but a large MCP configuration creates a new set of problems:
MCP Manager Gateway, or MMG, puts those servers behind one gateway. An agent sees a small discovery surface, searches for the capability it needs, reads the exact schema, and calls the selected tool. Catalog operations do not start downstream services; a lazy server starts on its first real call.
Agent / IDE │ configure MMG once ▼ MCP Manager Gateway ├── discover MCPs and tools without starting them ├── call an exact tool and start it only when required ├── manage users, tokens, permissions, OAuth, and lifecycle └── agent proposal → human review → real test → approval │ ├── Filesystem MCP ├── Database MCP ├── Browser MCP └── other stdio / HTTP / SSE / REST services Why MMG Faster, smaller agent startup On-demand discovery exposes three core gateway tools instead of injecting every downstream tool schema into the initial context. The agent first finds an MCP, then retrieves the full schema for a relevant tool, and finally invokes its exact gateway name.
This is progressive disclosure for MCP: reveal what exists first, then load detail only when it is useful. See Progressive discovery.
Listing MCPs, searching tools, and paging through the catalog never starts a downstream service. A lazy service starts on its first business call and can be reclaimed after an idle period. Frequently used services can be eager; unavailable services can be disabled.
Each agent connects to MMG instead of carrying dozens of independent MCP definitions. The gateway centrally manages services, credentials, permissions, health, and runtime state. The same catalog can be safely assigned to different users and tokens.
For Web integrations with large catalogs, use capability summary pages and exact definitions. Capability cards wrap long descriptions, URLs, and identifiers within their borders on desktop and mobile. Scheduled refresh retries enabled lazy/eager services even after a manual stop or startup failure and publishes the paged catalog. Stopping a service forcibly closes its current instances without disabling it or blocking later calls; a later call restarts a lazy/eager service, and an eager service then stays running. Calls and manual/scheduled catalog refreshes share one consecutive-failure counter per catalog owner. Below the configured threshold (default 3), MMG keeps the last successful four-kind catalog and its timestamp while exposing the failure reason. Only reaching the threshold empties the catalog and marks the owner failed. Any successful call or complete refresh resets the counter; connection establishment and token renewal alone do not. Internal retries count as one final outcome, and business calls are never replayed. Invalid authorization still blocks execution while retained catalog metadata remains visible to its authorized owner. The service policy is unchanged. Catalog queries remain read-only. Explicit exact calls may rediscover current contracts before validation and execution. Approved proposals discard diagnostic catalog entries and, like rejected proposals, no longer show the diagnostic catalog button. Approval tests support a bounded summary response; legacy full-list responses have explicit size limits. Agent service summaries include a bounded tool-name preview; enumerate gateway_search_tools for the full catalog. Exact calls use indexed routes and reuse schema validators.
Service, approval-test and profile capability cards show upstream tool annotation titles and green read-only, red destructive, blue idempotent and orange open-world badges. A badge appears only for the Boolean value true; missing or invalid hints are ignored. These are upstream declarations, not gateway guarantees. Refresh existing service catalogs or rerun approval tests to populate annotation summaries. MMG's six discovery tools explicitly declare all four Boolean hints; gateway_call conservatively declares potentially destructive, non-idempotent, open-world behavior. See tool annotation display.
Capability metadata summaries stay within 8 KiB. Oversized server icons, text, extensions and error lists are summarized with explicit omission/truncation markers, so display metadata cannot block catalog publication. Full tool definitions and input schemas remain intact.
The Connections page lists your business leases and their MCP instances; administrators can manage other users' leases. It supports filters, safe JSON details, confirmed single/batch disconnects, and five-second refresh that pauses in hidden tabs. Each lease shows current/queued calls, cumulative downstream business calls and the last dispatch time; short calls remain visible in these lease-lifetime counters. One or two instance entries use their natural height; three or more share a compact capped viewport, with scrolling for additional entries. Disconnect releases a permit and its sessions: unreferenced lazy instances drain and stop; eager instances remain, including session-isolated instances. Clients can reconnect; this does not revoke credentials. Settings provide independent instance idle reclamation and business lease validity (default 43,200 seconds; 0 disables lease expiry). The Bridge connects clients to MMG through stdio. Its heartbeats default to 90 seconds, with disconnection after three missed intervals. The heartbeat interval must be a positive integer (1–86,400 seconds). Setting the missed-heartbeat limit to 0 disables liveness detection; heartbeats continue at the configured interval for renewal and configuration sync, and lease validity remains independent. See Connection management.
The recommended migration path is not to rebuild every MCP by hand. Give a trusted administrator token permission to submit MCP proposals, then ask an agent to:
The agent prepares the migration; the human keeps the final decision. A proposal cannot choose privileged lifecycle or isolation fields and cannot bypass review. Read the full MCP migration guide and the agent contract in AGENTS.md.
MMG requires Python 3.12 or newer and is published on PyPI.
uv tool install mcp-manager-gateway mmg Upgrade a uv tool installation with:
uv tool upgrade mcp-manager-gateway pip Install into a dedicated virtual environment:
pip install --upgrade mcp-manager-gateway mmg mmg, mcp-manager, and mcp-manager-gateway are equivalent commands. The default address is http://127.0.0.1:8765. The first registered account becomes the administrator; passwords must contain at least 10 characters.
Press Ctrl+C to stop the server. HTTP connections and request tasks have a 10-second grace period before cancellation, followed by application resource cleanup.
We recommend a Python build linked to SQLite with the WAL-reset fix: 3.51.3+, or the fixed 3.50.7/3.44.6 branches. Older engines remain usable and produce an upgrade warning. Check with uv run python -c "import sqlite3; print(sqlite3.sqlite_version)"; upgrading uv alone does not replace an existing Python environment. See runtime requirements。
On first start, MMG creates its configuration, SQLite database, and runtime data under:
mmg serve --port 8766 Docker (pull from registry) Both registries publish the same multi-arch image (linux/amd64, linux/arm64):
docker pull eraycc/mcp-manager-gateway:latest docker run -d --name mmg \ -p 127.0.0.1:8765:8765 \ -v mmg-data:/data \ eraycc/mcp-manager-gateway Pull and run from GHCR:
docker pull ghcr.io/eraycc/mcp-manager-gateway:latest docker run -d --name mmg \ -p 127.0.0.1:8765:8765 \ -v mmg-data:/data \ ghcr.io/eraycc/mcp-manager-gateway Pinning a specific release is recommended in production:
docker run -d --name mmg \ -p 127.0.0.1:8765:8765 \ -v mmg-data:/data \ eraycc/mcp-manager-gateway:1.3.9 Data is persisted in /data inside the container; map it to a named volume or host directory. See Deployment for Compose files and production notes.
For source and container options, see Installation and Quick start.
Create an access token in the Web console. The profile page generates copy-ready HTTP, stdio, Codex, and generic client configuration for the current gateway address.
{ "mcpServers": { "mcp-manager": { "command": "mmg", "args": ["stdio", "--url", "http://127.0.0.1:8765"], "env": { "MCP_MANAGER_TOKEN": "mcpm_YOUR_TOKEN" } } } } The bridge only connects the client to MMG. Downstream MCP processes still belong to the gateway and follow its lifecycle rules. See Connect clients.
Read the MCP configuration in my current client, normalize it, and batch-submit it as MMG proposals. Do not edit the original configuration. Wait for my review, testing, and approval. Remove migrated entries only after I explicitly approve cleanup.
Keep a backup, preserve unrelated settings, and never remove the MMG connection itself.
Resource search and reading remain an optional pair controlled by the token editor’s resource-tools checkbox; existing enabled tokens require no migration. Restart or reconnect clients after upgrading to refresh the advertised tool names. Gateway tools use concise parameter hints and one minimal inputSchema.examples example each; OAuth proposals describe all four config.auth.auth_mode values.
Reliable agents do not guess tool names or arguments: search for the MCP, retrieve the tool schema, and call the exact returned name. Discovery and pagination do not wake lazy services. See the Gateway tool reference. Failed services report their state without advertising executable tools; keyword search supports bounded one-character typo recovery.
Tool-embedded resources (including GitHub MCP file contents) are preserved and exposed as bounded session snapshots through native resource methods and the optional resource tools. Resource discovery supports kind, match and source uri_prefix filters, with background vectors for static resources, prompts and templates. The default-off embedded_resource.inject switch under Settings → Tool search → Resource compatibility enables a fallback for clients that cannot consume embedded resources or services without an equivalent readable resource template. Disabling it stops capture and clears all temporary snapshots; re-enabling requires another tool call. Temporary resources appear before static entries, newest first, and support source URI substring/token searches. Authenticated stateless requests reuse their existing implicit retention lease; use separate tokens or explicit leases when agents need independent snapshots. HTTP calls mirror x-mcp-header parameters from the authorized cached schema. Call logs retain the original downstream result and record only added gateway content, such as temporary resource URI hints, under gateway_processing.added_content.
The separate default-on exposeNativeResources switch in the same settings group hides only native resources/list, prompts/list and resources/templates/list when disabled, including temporary snapshot listings. Native resources/read and prompts/get remain available for known identifiers under existing authorization. The token-level resource tools option independently controls gateway_search_resources and gateway_read_resource; neither switch changes the other. See Embedded resource compatibility for limits, isolation and keyword fallback behavior.
MMG supports optional browser-side interface translation:
The language selected from the top-right control is saved in the current browser profile and takes priority over the system default. On later visits and sign-ins, MMG automatically applies that saved selection while translation remains enabled. The default target language only initializes browsers that have no local choice, so different browsers can choose independently.
Browser translation can send visible page text to the configured translation provider. Use a reviewed private provider for sensitive deployments, or keep translation disabled. Configuration, cache controls, and provider details are covered in Interface translation and update checks.
See Manage services, Runtime and lifecycle, and Security model.
Remote HTTP/SSE OAuth uses one four-option registration selector: pre-registration (Client ID required, Secret optional), prefer CIMD with DCR fallback (the default for new forms), CIMD only, or DCR only. The preferred mode falls back when CIMD prerequisites are unavailable or a validated authorization response explicitly rejects the client or its metadata; DCR requires a registration endpoint. Legacy settings retain their selected policy. Open the OAuth dialog and click Start authorization; opening it alone does not register a client, but renews an expired token when refresh credentials are available.
Service management and profile OAuth dialogs both offer Reset authorization, with a second confirmation that existing tokens will be kept. Reset clears pending authorization states and cached DCR registration only for the selected MCP and authorization scope (only your own under user isolation, including shared configuration); it preserves CIMD verification, existing tokens, and their refresh client credentials. Close old authorization tabs, reset, then start authorization again. Each new attempt replaces pending states in the same scope; states expire after 10 minutes and can be used once. Profile dialogs load the latest shared configuration as a read-only summary or your latest private configuration.
CIMD supports two metadata hosting options. For a local/private MMG, choose External static hosting, enter a public HTTPS JSON URL, generate and publish the file, then verify it. Only this credential-free file needs public inbound access; MMG can stay private. The callback remains PUBLIC_URL plus the selected path, must exactly match an entry in the document, and must be reachable by the same signed-in browser. HTTP loopback works only when browser and MMG are on the same machine; mobile/LAN access needs a browser-trusted HTTPS address. For a public HTTPS gateway, keep MMG hosting at /oauth/client-metadata.json. Both options require a compatible authorization server; verification is not successful authorization. Expired tokens are renewed before connection and catalog scopes are materialized. Authorization callbacks, normal calls, manual/scheduled catalog refreshes and profile capability refreshes share catalog preparation. A credential conflict during preparation, read-only discovery or publication retries once with the latest credentials; successful renewal completes the same operation. Exact tool routing is resolved again before business execution. Concurrent sessions sharing a credential coalesce renewal; user-isolated credentials remain separate. A replacement refresh token is encrypted and saved with the new access token before use; if omitted, the existing refresh token is retained. The OAuth dialog renews expired tokens when checking status and offers Refresh authorization when a refresh token is available. Refresh failure or a downstream HTTP 401 requires explicit reauthorization, without replaying business calls. See the OAuth and private MMG setup guide.
All registration policies expose Token endpoint authentication: automatic, none, client_secret_basic, or client_secret_post. Automatic DCR negotiates server-supported methods and securely stores a generated Secret for token exchange and refresh. CIMD currently uses none; an explicit Secret method triggers DCR fallback in preferred mode or a configuration error in CIMD-only mode. A fallback starts a fresh state/PKCE authorization flow once; user denial, invalid state/issuer, and uncertain token requests never trigger it. If the provider shows an error page without returning to MMG, select DCR only and retry. See the OAuth guide above for the bounded Figma compatibility behavior. OAuth forms expose a Callback path selector: /api/v1/oauth/callback by default, or /callback for services such as Figma. Both manual and automatic registration use the selected path on PUBLIC_URL; changing it invalidates the related registration and tokens and requires reauthorization. No provider URL matching selects the callback path. DCR failures include recognized server error codes without echoing response bodies or secrets.
Administrators can configure Settings → Network & proxy for server-side MCP, OAuth, embedding, and update requests. Proxying is off by default and ignores environment proxies unless explicitly enabled. Saving checks format only; optional connectivity tests are advisory. Changes apply to new requests without interrupting active streams. See the proxy guide for manual HTTP/SOCKS, routing lists, TLS, and environment mode on Windows, Linux, and macOS. Custom CA bundles are uploaded and validated in the console; target lists support exact host/IP, IP-only CIDR, and subdomain wildcards. OAuth discovery and token requests retain the original TLS hostname through HTTP/HTTPS proxies while connecting to validated IP addresses.
Environment variables override the user-home .env. MMG does not automatically load .env from the source tree or current working directory. Start from .env.example.
HOST=127.0.0.1 PORT=8765 PUBLIC_URL=http://127.0.0.1:8765 COOKIE_SECURE=false DATABASE_URL= Use MCP_MANAGER_HOME or mmg --home /path serve to select another configuration and data directory. Back up the complete data directory before upgrades or migration.
Start the included container deployment with:
docker compose up --build -d The default bind address is local-only. For remote or production use, place MMG behind an HTTPS reverse proxy and set PUBLIC_URL and COOKIE_SECURE=true correctly. MMG is currently designed as a single gateway runtime; do not share one downstream process scheduler across multiple workers or replicas.
Read Database deployment, migration, and backup, Configuration, Deployment and upgrades, and Backup and migration.
Upgrade with the mechanism that installed MMG:
# uv tool uv tool upgrade mcp-manager-gateway # pip virtual environment pip install --upgrade mcp-manager-gateway Source and container installations should be updated through Git plus uv or by rebuilding/pulling the relevant image. mmg upgrade performs database schema migration; it does not update the installed Python package.
A bounded background collector reclaims expired query caches, retired index rows, and unreferenced objects. Query caches have configurable capacity and TTL; current catalog vectors remain tied to their authorized generation and model. Unchanged tools reuse existing same-scope vectors without requesting the model again; disabled services and failed discovery scopes are preserved. Legacy jobs/jobs.jsonl is no longer read or imported and is not automatically deleted. See Backup and migration.
Update detection in System Settings → About only reports availability. It never modifies the installation. Automatic checks can be disabled while the manual Check for Updates action remains available.
uv sync --frozen --group dev uv run pytest tests -q node --test tests/frontend/core.test.mjs uv build Daily uv run pytest -q runs functional regressions, including browser and safety-boundary tests, with up to four workers. Long performance tests and live external-service tests require explicit selection. Use --suite quick, --suite backend, --suite browser, --domain oauth, or --changed-from for focused work; -n 0 forces serial execution. --suite performance explicitly runs stress tests serially by default; --suite all includes performance but still requires --run-live for external services. Each run reports setup/call/teardown timings. See test suites and coverage-preserving optimization.
Contributor guidance is in Contributing; transport extension details are in Transport plugins.
MCP configuration can start local processes, access networks, and read data. Treat service administration as privileged. Review proposed commands and permissions, use least-privilege accounts and tokens, isolate different trust domains, and verify arguments before invoking tools with side effects.
An outcome_unknown result means a request may already have reached its destination. Agents must not automatically replay it.
Large catalogs support progressive gateway_search_tools with names_only: true (no Schema reads). Query exact names again without that flag before calling. Follow next_cursor without changing query arguments. Native tool/resource/prompt/template listings and gateway_search_resources paginate; complete MCP JSON-RPC envelopes are budgeted at 1 MiB including text and structured duplication. An individually oversized complete contract returns catalog_entry_too_large, never a truncated Schema.
agent-tools gateway lazy-loading lazy-start lifecycle-management mcp mcp-gateway mcp-lifecycle mcp-manager mcp-proxy model-context-protocol progressive-disclosure proxy
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




