mcp-gateway
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-gatewaylist my open pull requests via the GitHub backend"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Universal MCP Gateway (mcp-gateway)
A high-performance, multi-port Model Context Protocol (MCP) reverse proxy, dynamic provisioning engine, and infrastructure orchestrator built on @thargy/mcp-server-core.
1. System Overview
mcp-gateway centralizes, secures, and dynamically orchestrates local and containerized MCP servers behind a unified multi-port architecture (4000-4099).
flowchart TD
subgraph Clients ["AI Clients & Agents"]
Agent["Antigravity IDE / Cursor / Claude Desktop"]
end
subgraph Tunnel ["Cloudflare Zero Trust Ingress (mcp.thargy.com)"]
T_Admin["https://mcp.thargy.com/gateway/mcp → Port :4000"]
T_GH["https://mcp.thargy.com/gh/mcp → Port :4001"]
T_CF["https://mcp.thargy.com/cf/mcp → Port :4002"]
T_Dyn["https://mcp.thargy.com/<key>/mcp → Port :4007+"]
end
subgraph Host ["Docker Host @ 192.168.64.250"]
subgraph Gateway ["mcp-gateway (Port Block 4000-4099)"]
Admin["Port :4000: Management Plane (Bearer GATEWAY_ADMIN_TOKEN)<br/>• provision_mcp, update_mcp, deprovision_mcp<br/>• list_mcps, get_mcp_diagnostics<br/>• Plugin Tools (env, docker, cloudflare)"]
S_GH["Port :4001: github-mcp-server (Wrapped Proxy)"]
S_CF["Port :4002: cloudflare-mcp (Wrapped Proxy)"]
S_Docker["Port :4003: docker-mcp (Tier-1 Passthrough)"]
S_HA["Port :4004: homeassistant-mcp (Tier-1 Passthrough)"]
S_Prox["Port :4005: proxmox-mcp (Tier-1 Passthrough)"]
S_UniFi["Port :4006: unifi-mcp (Tier-1 Passthrough)"]
S_Dyn["Port :4007+: Dynamic Provisioned Tool Listeners"]
end
end
Agent --> Tunnel
T_Admin --> Admin
T_GH --> S_GH
T_CF --> S_CF
T_Dyn --> S_DynRelated MCP server: Shared MCP Gateway
2. Key Capabilities
A. Dedicated Multi-Port Architecture (:4000 - :4099)
Each MCP tool is assigned a dedicated TCP port in the
4000-4099range.Isolates tool lifecycles: restarting or updating one tool listener never disrupts any other active MCP server.
Pre-mapped in Docker Compose to eliminate container recomposition when new tools are provisioned.
B. 3 Proxy Architecture Tiers
Tier 1 (Pure Raw Passthrough): Active when
wrappersis omitted. Routes raw SSE/HTTP streams directly to the upstream backend with zero MCP protocol parsing overhead.Tier 2 (Protocol-Wrapped Open Access): Active when
wrappers: { "": { ... } }. Injects Cloudflare SSE Stream Priming (: heartbeat\n\n) to bypass reverse proxy buffering.Tier 3 (Strict Authenticated Wrapped): Active when
wrappersmaps client tokens. Enforces $O(1)$ constant-time token lookup and returns401 Unauthorizedon missing or invalid tokens.
C. Port 4000 MCP Management Plane
Mounts a management MCP server on Port 4000 secured with
GATEWAY_ADMIN_TOKEN.Allows AI assistants and operators to dynamically provision, update, deprovision, and diagnose MCP servers over standard MCP tool calls.
Full API details in
docs/MANAGEMENT_API.md.
D. Pure Config-Driven Plugin Engine
Plugins reside under
./src/management/plugins/and are loaded dynamically based solely on configuration inconfig.yaml.Employs an Onion Lifecycle Pipeline:
Forward execution for
onPreProcessandonProcess([env, docker, cloudflare]).Reverse execution for
onPostProcessandonTeardown([cloudflare, docker, env]).
Full plugin developer guide in
docs/PLUGINS.md.
3. Configuration (config.yaml)
gateway:
adminPort: 4000
adminToken: "${GATEWAY_ADMIN_TOKEN}"
portRange:
start: 4000
end: 4099
plugins:
# 1. Environment & Parameterized Secret Generator Plugin
env:
enabled: true
defaultGenerator: "crypto-256"
envFile: ".env"
# 2. Docker Container Orchestrator Plugin
docker:
enabled: true
socketPath: "/var/run/docker.sock"
defaultNetwork: "mcp-network"
# 3. Cloudflare Zero Trust Ingress & Portal Plugin
cloudflare:
enabled: true
accountId: "${CLOUDFLARE_ACCOUNT_ID}"
apiToken: "${CLOUDFLARE_API_TOKEN}"
tunnel:
id: "${CLOUDFLARE_TUNNEL_ID}"
hostname: "${CLOUDFLARE_TUNNEL_HOSTNAME}"
originBaseUrl: "${GATEWAY_ORIGIN_BASE_URL}"
portal:
portalId: "${CLOUDFLARE_PORTAL_ID}"
servers:
# Infrastructure Fleet (Centralized Ports 4001 - 4006)
gh:
type: http
name: "github-mcp-server"
port: 4001
targetUrl: "http://github-mcp-backend:8082"
wrappers:
"${GH_MCP_TOKEN}":
headers:
Authorization: "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
cf:
type: http
name: "cloudflare-mcp"
port: 4002
targetUrl: "https://mcp.cloudflare.com/mcp"
wrappers:
"${CF_MCP_TOKEN}":
headers:
Authorization: "Bearer ${CLOUDFLARE_API_TOKEN}"
X-Auth-Account-Id: "${CLOUDFLARE_ACCOUNT_ID}"
docker:
type: http
name: "docker-mcp"
port: 4003
targetUrl: "http://docker-mcp-backend:3008"
ha:
type: http
name: "homeassistant-mcp"
port: 4004
targetUrl: "http://homeassistant-mcp-backend:3000"
proxmox:
type: http
name: "proxmox-mcp"
port: 4005
targetUrl: "http://proxmox-mcp-backend:3006"
unifi:
type: http
name: "unifi-mcp"
port: 4006
targetUrl: "http://unifi-mcp-backend:3005"4. Documentation Index
📘 Management API Reference (
docs/MANAGEMENT_API.md): Comprehensive schema and documentation for Port 4000 management tools (provision_mcp,update_mcp,deprovision_mcp,list_mcps,get_mcp_diagnostics).🧩 Plugin Developer Guide (
docs/PLUGINS.md): Architectural guide to the 3-stage onion lifecycle, directory conventions, and parameterized secret generators (crypto,password,uuid).🏛️ Domain Model & Terminology (
CONTEXT.md): Ubiquitous language, bounded contexts, and system invariants.🌐 Infrastructure Overview (
universal-skills/docs/infrastructure/OVERVIEW.md): Live-verified hardware topology, port allocation tables, and network maps.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceGateway MCP Server - Route MCP requests intelligently to multiple backend servers.3MIT
- FlicenseNot gradedqualityCmaintenanceAggregates multiple shared MCP servers into a single HTTP gateway, providing a unified, observable, and reusable MCP access layer for multiple AI clients like Codex, OpenCode, and OpenClaw. It centralizes configuration management, logging, health checks, and circuit breaking to simplify multi-client MCP deployments.5
- AlicenseNot gradedqualityCmaintenanceA universal MCP server that acts as a unified gateway for dynamically connecting and managing multiple MCP servers via a single HTTP endpoint.106MIT
- AlicenseNot gradedqualityAmaintenanceA universal MCP gateway that aggregates multiple MCP servers into a single endpoint, providing features like hot-reload, auto-healing, and a hook system for request/response mutation.1MIT
Related MCP Connectors
Self-hosted federated MCP gateway: one OAuth 2.1 MCP server in front of N apps, user-level scopes.
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thargy/mcp-gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server