MCP Gateway

基于Python的MCP网关
  • python

52

GitHub Stars

python

Language

4 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

MCP Gateway is a Python-based central gateway that connects to multiple backend MCP servers and presents a unified SSE endpoint for upstream MCP clients. It simplifies client configuration by exposing a single gateway address while aggregating diverse capabilities from all connected backends.

How to use

You use MCP Gateway by running it as a local service and then connecting your MCP client to the gateway’s SSE endpoint. The gateway aggregates tools and capabilities from all configured backend MCP servers so your client can access them through one unified connection.

To take advantage of this setup, ensure your backend MCP servers are defined in the gateway’s configuration, start the gateway, then point your MCP client to the gateway’s SSE URL. You will see the combined list of available tools from all configured backends in your client once the connection is established.

How to install

Prerequisites you need before installation: you should have Python installed and a Python-friendly runtime to run the gateway. You will also use a Python-based environment management tool to isolate dependencies.

Step by step commands to set up MCP Gateway locally:

# Clone the MCP Gateway project
git clone https://github.com/trtyr/MCP-Gateway.git
cd MCP-Gateway

# Create and activate a virtual environment using your preferred tool
uv venv
# Activate the virtual environment
# Linux/macOS
source .venv/bin/activate
# Windows (Command Prompt/PowerShell)
.venv\Scripts\activate

# Install dependencies
uv sync

Additional sections

Configuration notes: MCP Gateway uses a core configuration file to define backend MCP servers. You may configure backends as either stdio (local processes started by the gateway) or SSE (remote or local SSE servers). Each backend contributes a unique prefix for its capabilities and a set of tools that become available to clients through the gateway.

Security considerations: expose the gateway only to trusted networks. When using remote backends over SSE, ensure secure URLs (HTTPS) where appropriate and control access to the gateway’s SSE endpoint. Regularly monitor logs to detect misconfigurations or unauthorized access attempts.

Examples of common usage patterns include combining local stdio MCP servers with remote SSE services. You can grow the gateway configuration to add more backends over time, enabling a broader set of tools and capabilities for your clients.

Troubleshooting tips: check the gateway logs under the logs directory for startup messages, backend connection status, and tool availability. If a backend fails to start, verify the command, arguments, and environment variables in the configuration. Ensure that the backend SSE URLs are reachable and that any required ports are open.

Available tools

sse_endpoint

Unified SSE endpoint exposed by the gateway for upstream MCP clients to connect and access aggregated capabilities.

capability_registry

Dynamically discovers, registers, and manages capabilities provided by all backend MCP servers.

client_manager

Maintains and orchestrates connection sessions with backend MCP servers to ensure stable operation.

config_loader

Loads and validates the gateway configuration from the config.json file to ensure correct backend setup.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational