Universal MCP Gateway
Used to provision registry MCP servers on demand in isolated Docker containers, though this is an implementation detail of the gateway itself.
Provides access to the official GitHub MCP server, enabling repository and development workflow management (requires gh auth).
Provisioned MCP servers have blocked Tailscale egress, and multi-device support can manage remote devices over Tailscale-enabled networks.
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., "@Universal MCP GatewaySet up a Postgres MCP server from the registry to inspect my database schema"
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
A self-hosted Model Context Protocol (MCP) gateway that aggregates all your MCP servers behind a single Streamable HTTP endpoint. Includes automatic registry discovery, on-demand Docker provisioning, and multi-device support.
Features
Single Endpoint — All MCP servers exposed via one URL (
/allfor universal,/mcpfor legacy)Registry Auto-Broker — Mirrors the official MCP Registry (19,000+ servers), provisions on demand in isolated Docker containers
Multi-Device — Control server, laptop, and Windows PC from one gateway via SSH
SSE Keepalive — Prevents Cloudflare/proxy idle timeouts on streaming connections
OAuth2 PKCE — Optional OAuth2 authorization code flow with PKCE support
Workflow Engine — Save and replay multi-step tool sequences
Bearer Auth — Simple token-based authentication
Related MCP server: mcpproxy-go
Architecture
mcp.yourdomain.com (:8798)
│
┌──────▼──────┐
│ MCP Router │ Path-based routing
│ router.mjs │ /all → Universal, /mcp → Legacy
└──────┬──────┘
│
┌────────────┼────────────┐
│ │ │
┌─────────▼──┐ ┌─────▼────┐ ┌──▼──────────┐
│ Universal │ │ Registry │ │ Child MCPs │
│ Gateway │ │ Autobroker│ │ (remote + │
│ gateway.mjs│ │ registry- │ │ stdio) │
└────────────┘ │ manager │ └─────────────┘
└───────────┘Quick Start
# Clone
git clone https://github.com/Samuel-Mencke/mcp-gateway.git
cd mcp-gateway
# Install dependencies
npm install
# Configure
cp .env.example .env
# Edit .env — set MCP_PUBLIC_URL and generate a token
# Generate auth token
echo -n "$(openssl rand -hex 32)" > ~/.mcp-gateway/token
# Start the gateway
node gateway.mjs # Port 8799
# In another terminal:
node router.mjs # Port 8798 (public-facing)Configuration
All configuration is via environment variables. See .env.example for all options.
Key Variables
Variable | Default | Description |
|
| Universal Gateway listen port |
|
| Router listen port |
|
| Your public URL (domain/tunnel) |
|
| State directory (registry, tokens, etc.) |
| (from | Auth token |
Multi-Device (Optional)
Set these to enable SSH-based remote control:
# Windows PC
MCP_PC_HOST=windows-host
MCP_PC_USER=username
# Linux laptop
MCP_LAPTOP_HOST=laptop-host
MCP_LAPTOP_USER=usernameDefault MCP Servers
The gateway ships with these servers enabled by default:
Context7 — Current library documentation
Exa — Web search and fetch
MCP Docs — Official MCP documentation
GitHub — Official GitHub MCP server (requires
gh auth)Playwright — Browser automation
Chrome DevTools — Debugging and performance
Filesystem — Sandboxed file access
Memory — Persistent knowledge graph
Sequential Thinking — Structured planning
Additional servers can be provisioned on demand from the official MCP Registry via ensure_capability.
Registry Auto-Broker
The gateway mirrors the complete official MCP Registry and can provision any supported server on demand:
Agent: "I need PostgreSQL schema inspection"
Gateway: Searches registry → provisions postgres-mcp → probes handshake → readyProvisioned servers run in restricted Docker containers:
Read-only root filesystem
No host mounts
Dropped capabilities
CPU/RAM/PID limits
Blocked private/Tailscale egress
Deployment
systemd
# ~/.config/systemd/user/mcp-router.service
[Unit]
Description=MCP Router
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=%h/mcp-gateway
Environment=MCP_ROUTER_PORT=8798
ExecStart=/usr/bin/node %h/mcp-gateway/router.mjs
Restart=always
RestartSec=5
[Install]
WantedBy=default.target# ~/.config/systemd/user/mcp-universal.service
[Unit]
Description=MCP Universal Gateway
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=%h/mcp-gateway
EnvironmentFile=%h/mcp-gateway/.env
ExecStart=/usr/bin/node %h/mcp-gateway/gateway.mjs
Restart=always
RestartSec=5
TimeoutStopSec=20
[Install]
WantedBy=default.targetCloudflare Tunnel
No port-forwarding needed — use a Cloudflare Tunnel:
# ~/.cloudflared/config.yml
ingress:
- hostname: mcp.yourdomain.com
service: http://127.0.0.1:8798
originRequest:
noTLSVerify: true
connectTimeout: 30s
keepAliveConnections: 100
keepAliveTimeout: 600sClient Configuration
The gateway works with any MCP-compatible client:
Client | Config |
Claude Code |
|
OpenAI Codex |
|
Cursor |
|
Hermes Agent |
|
OpenCode |
|
All clients need: headers: { Authorization: "Bearer <your-token>" }
Files
File | Description |
| Path-based router, OAuth2, SSE keepalive |
| Universal MCP gateway server |
| Registry sync, auto-provisioning, AGENTS.md generation |
| Durable workflow persistence |
| Legacy ChatGPT connector (admin/SSH tools) |
| Windows desktop automation runner |
Requirements
Node.js >= 18
Docker (for registry auto-provisioning)
SSH access (for multi-device support)
License
MIT
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
- FlicenseCqualityDmaintenanceA powerful gateway for the Model Context Protocol (MCP) that unifies AI toolchains by federating multiple MCP servers, wrapping REST APIs as MCP tools, and supporting multiple transport methods with an admin dashboard.Last updated1
- AlicenseAqualityAmaintenanceLocal-first MCP proxy with BM25 tool discovery, quarantine security, Docker isolation, OAuth support, activity logging, and web UI. Routes multiple upstream MCP servers through a single endpoint.Last updated9305MIT
- Alicense-qualityCmaintenanceA unified gateway and web dashboard that aggregates multiple MCP servers into a single Streamable HTTP endpoint. It supports stdio, SSE, and HTTP protocols, featuring optimized tool exposure modes to reduce token consumption for AI clients.Last updated5MIT
- Alicense-qualityDmaintenanceMCPGate aggregates multiple MCP servers into a single unified endpoint, enabling centralized tool management with granular filtering, automatic namespacing, and observability. Features a real-time web dashboard and optional PostgreSQL-backed audit trails for monitoring and controlling AI tool access across local and remote deployments.Last updated26Apache 2.0
Related MCP Connectors
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Self-hosted federated MCP gateway: one OAuth 2.1 MCP server in front of N apps, user-level scopes.
A MCP server built for developers enabling Git based project management with project and personal…
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/Samuel-Mencke/mcp-gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server