CLI / Server

Aggregate multiple MCP servers into a single endpoint.

Problem It Solves

Before MCP Gateway:

{
  "mcpServers": {
    "github": { "command": "npx", "args": ["@modelcontextprotocol/server-github"] },
    "slack": { "command": "npx", "args": ["@slack/mcp-server"] },
    "postgres": { "command": "npx", "args": ["@modelcontextprotocol/server-postgres"] },
    "filesystem": { "command": "npx", "args": ["@modelcontextprotocol/server-filesystem"] }
    // ... and more, each requiring separate configuration
  }
}

With MCP Gateway:

{
  "mcpServers": {
    "gateway": { "command": "mcp-gateway", "args": ["start"] }
  }
}

Just ONE config entry for ALL your MCP servers! 🎉

Features

  • 🚀 Single Configuration - One entry in your MCP client config
  • 🔌 Hot Reload - Add/remove servers without restarting clients
  • 🎨 CLI Interface - Easy server management from terminal
  • 🔒 Secure - Credentials stored in config file
  • 📦 Zero Dependencies (for clients) - Just install and use
  • 🛠️ Tool Prefixing - Avoids naming conflicts between servers
  • Fast - Parallel execution of tool calls

Installation

Global Installation (Recommended)

npm install -g @mcp-gateway/cli

Local Installation

npm install @mcp-gateway/cli

Quick Start

1. Initialize

mcp-gateway init

2. Add Servers

# Add GitHub server
mcp-gateway add \
  --id github \
  --name "GitHub" \
  --command npx \
  --args @modelcontextprotocol/server-github \
  --env GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token

# Add Slack server
mcp-gateway add \
  --id slack \
  --name "Slack" \
  --command npx \
  --args @slack/mcp-server \
  --env SLACK_BOT_TOKEN=xoxb-your-token

3. List Servers

mcp-gateway list

4. Generate Client Config

mcp-gateway config

CLI Commands

  • mcp-gateway init: Initialize MCP Gateway with interactive setup
  • mcp-gateway start: Start the gateway server (used by clients)
  • mcp-gateway list: List all configured servers
  • mcp-gateway add: Add a new server
  • mcp-gateway remove <id>: Remove a server
  • mcp-gateway enable <id>: Enable a disabled server
  • mcp-gateway disable <id>: Disable a server
  • mcp-gateway config: Generate client configuration

Configuration

Configuration is stored at ~/.mcp-gateway/config.json.

How It Works

Tool Prefixing

To avoid naming conflicts, MCP Gateway prefixes all tool names with the server ID:

Original tool: "create_issue"
Gateway tool: "github_create_issue"

Original tool: "send_message"  
Gateway tool: "slack_send_message"

Programmatic Usage

import { MCPGateway } from '@mcp-gateway/cli';

const gateway = new MCPGateway();
await gateway.start();