# mcp-gateway

Connects multiple downstream MCP servers into a single hub. It searches tools via BM25 or regex and loads schemas on demand to keep the model context window clean.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: rupinder2
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/rupinder2/mcp-orchestrator
- Updated: 2026-02-26
- HTML: https://affpapa.org/en/nevibecode/mcp/rupinder2-mcp-gateway

## What it does

The gateway unites downstream MCP servers running over stdio or HTTP into one interface. Instead of dumping every tool definition directly into the model context, it provides search utilities: `tool_search`, `discover_tools`, and `call_remote_tool`. Finding relevant actions works through BM25 natural language ranking or Python regular expressions.

Downstream tools receive an automatic namespace formatted as `server_name__tool_name`. External endpoints and their authentication tokens are configured in a JSON file. Schema caching runs in memory or connects to Redis when `STORAGE_BACKEND` is configured. Without a valid config file path in `SERVER_CONFIG_PATH`, the hub starts with an empty registry.

The process runs locally via stdio or serves requests over HTTP with configurable host and port settings. Execution is handled through `uvx mcp-orchestration-gateway` or standard Python modules.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `STORAGE_BACKEND`, `REDIS_URL`, `SERVER_CONFIG_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env STORAGE_BACKEND=<STORAGE_BACKEND> --env REDIS_URL=<REDIS_URL> --env SERVER_CONFIG_PATH=<SERVER_CONFIG_PATH> --transport stdio rupinder2-mcp-gateway -- uvx mcp-orchestration-gateway
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-orchestration-gateway <command>

### Codex

**Platform CLI**
```bash
codex mcp add rupinder2-mcp-gateway --env STORAGE_BACKEND=<STORAGE_BACKEND> --env REDIS_URL=<REDIS_URL> --env SERVER_CONFIG_PATH=<SERVER_CONFIG_PATH> -- uvx mcp-orchestration-gateway
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-orchestration-gateway <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "rupinder2-mcp-gateway": {
            "command": "uvx",
            "args": [
                "mcp-orchestration-gateway"
            ],
            "env": {
                "STORAGE_BACKEND": "<STORAGE_BACKEND>",
                "REDIS_URL": "<REDIS_URL>",
                "SERVER_CONFIG_PATH": "<SERVER_CONFIG_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-orchestration-gateway <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "rupinder2-mcp-gateway": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "mcp-orchestration-gateway"
            ],
            "env": {
                "STORAGE_BACKEND": "<STORAGE_BACKEND>",
                "REDIS_URL": "<REDIS_URL>",
                "SERVER_CONFIG_PATH": "<SERVER_CONFIG_PATH>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-orchestration-gateway <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e STORAGE_BACKEND=<STORAGE_BACKEND> -e REDIS_URL=<REDIS_URL> -e SERVER_CONFIG_PATH=<SERVER_CONFIG_PATH> rupinder2-mcp-gateway uvx mcp-orchestration-gateway
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from mcp-orchestration-gateway <command>

## When to use it
- Aggregate multiple MCP servers behind a single endpoint
- Search tool schemas on demand without bloating prompt context
- Route execution requests using namespaced tool identifiers
- Connect downstream services across stdio and HTTP transports

## Example prompts
- Search for weather lookup tools using `tool_search`.
- Inspect available functions on `local-server` using `discover_tools`.
- Execute `api-server__fetch_data` through `call_remote_tool` with query arguments.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
