Skip to content

MCP Gateway

A plugin-based gateway that orchestrates other MCPs and allows developers to build upon it enterprise-grade agents.

Install: pip install mcp-gateway

Install

$pip install mcp-gateway

Install command taken from the project's README or registry entry. Always review code before running it.

MCP Gateway

Overview

MCP Gateway is an advanced intermediary solution for Model Context Protocol (MCP) servers that centralizes and enhances your AI infrastructure.

MCP Gateway acts as an intermediary between LLMs and other MCP servers. It:

  1. 📄 Reads server configurations from a mcp.json file located in your root directory.
  2. ⚙️ Manages the lifecycle of configured MCP servers.
  3. 🛡️ Intercepts requests and responses to sanitize sensitive information.
  4. 🔗 Provides a unified interface for discovering and interacting with all proxied MCPs.
  5. 🔒 Security Scanner - Analyzes server reputation and security risks before loading MCP servers.

Installation

Python (recommended)

Install the mcp-gateway package:

pip install mcp-gateway

--mcp-json-path - must lead to your mcp.json or claude_desktop_config.json
--plugin or -p - Specify the plugins to enable (can be used multiple times)

Usage

This example enables the basic guardrail for token masking and xetrack tracing plugin for filesystem MCP:

mcp-gateway --mcp-json-path ~/.cursor/mcp.json -p basic -p xetrack

You can add more MCPs that will be under the Gateway by putting the MCP server configuration under the "servers" key.

Cursor example:

{
  "mcpServers": {
      "mcp-gateway": {
          "command": "mcp-gateway",
          "args": [
              "--mcp-json-path",
              "~/.cursor/mcp.json",
              "--plugin",
              "basic",
              "--plugin",
              "xetrack"
          ],
          "servers": {
              "filesystem": {
                  "command": "npx",
                  "args": [
                      "-y",
                      "@modelcontextprotocol/server-filesystem",
                      "."
                  ]
              }
          }
      }
  }
}

Claude example:

Get ``

which python
{
  "mcpServers": {
      "mcp-gateway": {
          "command": "",
          "args": [
            "-m",
            "mcp_gateway.server",
            "--mcp-json-path",
            "",
            "--plugin",
            "basic"
          ],
          "servers": {
              "filesystem": {
                  "command": "npx",
                  "args": [
                      "-y",
                      "@modelcontextprotocol/server-filesystem",
                      "."
                  ]
              }
          }
      }
  }
}

Docker

Build the image after clone this repo

docker build -t mcp/gateway .

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

Explore related