Fire in da houseTop Tip:Most people pay up to $340 per month for Perplexity, MidJourney, Runway, ChatGPT, and more - but you can get them all your AI tools for $15 with Galaxy. It's free to test!Fire in da houseCheck it out

mcp-proxy-server

MCP.Pizza Chef: adamwattis

The MCP Proxy Server is a centralized server that aggregates multiple MCP resource servers, providing a unified interface to manage and interact with them. It connects to various MCP resource servers, exposing their combined capabilities through a single endpoint. This server efficiently routes requests to the appropriate backend servers, aggregates responses, and maintains consistent URI schemes across all connected resources. It supports resource management, tool aggregation, and prompt handling by routing calls and responses correctly, enabling seamless multi-server interactions. Configured via JSON, it simplifies managing distributed MCP resources and tools in complex AI-enhanced workflows.

Use This MCP server To

Aggregate multiple MCP resource servers into one interface Route requests to appropriate MCP backend servers Combine tool capabilities from various MCP servers Manage and unify resource URIs across servers Handle multi-server prompt routing and aggregation Simplify configuration of distributed MCP resources

README

MCP Proxy Server

An MCP proxy server that aggregates and serves multiple MCP resource servers through a single interface. This server acts as a central hub that can:

  • Connect to and manage multiple MCP resource servers
  • Expose their combined capabilities through a unified interface
  • Handle routing of requests to appropriate backend servers
  • Aggregate responses from multiple sources

Features

Resource Management

  • Discover and connect to multiple MCP resource servers
  • Aggregate resources from all connected servers
  • Maintain consistent URI schemes across servers
  • Handle resource routing and resolution

Tool Aggregation

  • Expose tools from all connected servers
  • Route tool calls to appropriate backend servers
  • Maintain tool state and handle responses

Prompt Handling

  • Aggregate prompts from all connected servers
  • Route prompt requests to appropriate backends
  • Handle multi-server prompt responses

Configuration

The server requires a JSON configuration file that specifies the MCP servers to connect to. Copy the example config and modify it for your needs:

cp config.example.json config.json

Example config structure:

{
  "servers": [
    {
      "name": "Server 1",
      "transport": {
        "command": "/path/to/server1/build/index.js"
      }
    },
    {
      "name": "Server 2",
      "transport": {
        "command": "server2-command",
        "args": ["--option1", "value1"],
        "env": ["SECRET_API_KEY"]
      }
    },
    {
      "name": "Example Server 3",
      "transport": {
        "type": "sse",
        "url": "http://localhost:8080/sse"
      }
    }
  ]
}

The config file must be provided when running the server:

MCP_CONFIG_PATH=./config.json mcp-proxy-server

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

For development with continuous run:

# Stdio
npm run dev
# SSE
npm run dev:sse

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "mcp-proxy": {
      "command": "/path/to/mcp-proxy-server/build/index.js",
      "env": {
        "MCP_CONFIG_PATH": "/absolute/path/to/your/config.json",
        "KEEP_SERVER_OPEN": "1"
      }
    }
  }
}
  • KEEP_SERVER_OPEN will keep the SSE running even if a client disconnects. Useful when multiple clients connects to the MCP proxy.

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

mcp-proxy-server FAQ

How do I configure the MCP Proxy Server?
The MCP Proxy Server is configured using a JSON configuration file that specifies the MCP resource servers to connect and aggregate.
Can the MCP Proxy Server handle tool calls from multiple backend servers?
Yes, it routes tool calls to the appropriate backend MCP servers and manages tool state and responses.
Does the MCP Proxy Server maintain consistent URI schemes?
Yes, it maintains consistent URI schemes across all connected MCP resource servers for seamless resource management.
How does the MCP Proxy Server handle prompt requests?
It aggregates prompts from all connected servers, routes prompt requests to the correct backends, and handles multi-server prompt responses.
Is the MCP Proxy Server suitable for large-scale MCP deployments?
Yes, it is designed to manage and unify multiple MCP resource servers, making it ideal for complex, distributed MCP environments.
What happens if one backend MCP server is down?
The proxy server can route requests to available servers, but specific failover behavior depends on configuration and implementation.
Can I add or remove MCP resource servers dynamically?
Dynamic management depends on the implementation, but typically changes require updating the JSON configuration and restarting the proxy server.
Which LLM providers can I use with MCP Proxy Server?
MCP Proxy Server is model-agnostic and works with providers like OpenAI, Anthropic Claude, and Google Gemini by aggregating their resource servers.