Skip to main content

MCP Gateway

Tests Release PyPI version Python License Code Style: Ruff PyPI Downloads MCP Protocol Code Mode Local-First Security Observability Built-in Sponsor

One endpoint for every MCP server your agent needs — fetch tool schemas on demand instead of loading everything upfront.

MCP Gateway aggregates multiple MCP servers behind a single headless HTTP/SSE endpoint. Its Code Mode exposes five MCP meta-tools (listToolFiles, readToolFile, getToolDocs, executeTool, callManyTool) so agents discover signatures lazily and fan out bounded parallel calls without leaving the MCP surface. The host-side Python call_many helper remains available for direct code use, but the MCP contract exposes callManyTool as the fifth meta-tool.

  • CLI: mcp-gway (canonical) or mgw (alias)
  • Admin UI: mcp-gway serve --transport http → http://127.0.0.1:8080/

Why MCP Gateway

  • Fewer wasted tokens — Agents fetch only the schemas they need, when they need them.
  • One connection to manage — Add, remove, or refresh servers in a single registry; agents connect to one endpoint.
  • Safe local-first defaults — Binds to 127.0.0.1 by default, screens local commands via an allowlist, masks secrets, and CSRF-protects the admin dashboard.

Who It's For

  • Agent developers wiring Pi, Antigravity, Claude Desktop, Cursor, or any MCP-compatible client to multiple MCP servers through one gateway.
  • Operators running local-first infrastructure who want a CLI and dashboard with health probes, Prometheus metrics, and structured JSON logs.

Quick Start

  1. Install: pip install mcp-gway
  2. Add a server: mcp-gway add files --type local --command "npx -y @modelcontextprotocol/server-filesystem /path/to/dir"
  3. List servers: mcp-gway list
  4. Serve HTTP: mcp-gway serve --transport http
  5. Connect: Point your agent to http://127.0.0.1:8080/mcp

For more examples and transports, see the CLI Reference and Integrations.

Features

  • Multi-Server Aggregation — Connect to multiple MCP servers (local or remote) and expose them through a single endpoint. One URL for every agent; one registry to manage.
  • Code Mode — Five MCP meta-tools let LLMs discover schemas on demand, execute them in a hermetic sandbox, and fan out bounded parallel calls without loading all tool definitions upfront.
  • OAuth 2.0 Support — Built-in OAuth flow with Dynamic Client Registration (RFC 7591), secure token storage, and automated /.well-known/oauth-protected-resource discovery metadata (RFC 8707) for OAuth-capable MCP clients.
  • Hexagonal Architecture — Strict separation between pure domain models/ports, application use cases, and infrastructure adapters for isolated unit testability without running servers.
  • Hermetic Sandbox — Starlark-based sandbox for safe, constrained code execution.
  • MCP Protocol Compliant — Implements the Model Context Protocol over HTTP, SSE, and stdio.
  • Local-First Security — Local-first design with SSRF guards, command allow-lists, and CSRF protection.
  • Built-In Observability — Structured JSON logs, Prometheus metrics, and health probes built in.

Documentation

Development

uv sync --all-groups
uv run pytest -v   # 688 tests

See docs/development.md for checks, probes, and pre-commit.

Repobeats analytics

License

MIT

Metadata

Release files for mcp-gway 6.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-gway 6.1.1
File Size Uploaded Provenance Actions
mcp_gway-6.1.1.tar.gz 119.3 kB With provenance Details for mcp_gway-6.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-gway 6.1.1
File Interpreter ABI Platform Actions
mcp_gway-6.1.1-py3-none-any.whl Python 3 none any Details for mcp_gway-6.1.1-py3-none-any.whl

Total release size: 260.9 kB

Release files / mcp_gway-6.1.1.tar.gz

Download URL mcp_gway-6.1.1.tar.gz
Size 119.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ed0b4fbe509f84c28ebe66c2798702c08c9e9061d273de6f0dd316f5c6a7fc8a
BLAKE2b-256 checksum
How to use checksums
5bc42e50694770d6f04cb9062971134780bde9a239a65f96a9402dfd766f160e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / mcp_gway-6.1.1-py3-none-any.whl

Download URL mcp_gway-6.1.1-py3-none-any.whl
Size 141.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c1f2327027d3130c040dbc3fdcab5d8c8a986242aef7528318aa81368faad34
BLAKE2b-256 checksum
How to use checksums
a43224b7174a6b32c673a56eced0c12dd9711caf614826420346e389655aeb94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for mcp-gway 6.1.1

Provenance

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcp_gway-6.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

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.

Release history Release notifications | RSS feed

This release

6.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page