Skip to main content
Glama
qneville

MCP-Gateway

by qneville

MCP Gateway

This is a simple gateway that connects to multiple child MCP servers and forwards tool calls to them.

TL;WR; I just wanna try it

You can run this out of the box with a couple of terminals open.

0. Installing dependencies

npm install

1. Running the Gateway

To run the gateway and automatically include the config.json file

npm run gateway

-OR-

To run the inspector and connect to the gateway. Use the 🔑 Session token from the output in Configuration > Proxy Session Token in the inspector to connect to the gateway.

npm run inspect

2. Running the demo client

The client is a simple CLI that can be used to interact with the gateway with a simple loop. You will need to provide an OpenAI API key in the .env file first.

npm run client

Related MCP server: @zhangzwd/mcp-gateway

Customizing the Gateway

To run the gateway, you need to provide a configuration file. An example configuration file is provided in the config.json file that should do the job out of the box.

{
    "server": {
        "name": "mcp-gateway-server",
        "version": "0.0.1"
    },
    "client": {
        "name": "mcp-gateway-client",
        "version": "0.0.1"
    },
    "servers": [
        {
            "name":"Friendly name for Canadian Weather server",
            "transport": "stdio",
            "stdio": {
                "command": "node",
                "args": ["./example_tools/canada_weather.js"]

            },
            "clientWhitelist": ["*"],
            "prefix": "canada_weather_"
        },
        {
            "name":"Friendly name for USA Weather server",
            "transport": "stdio",
            "stdio": {
                "command": "node",
                "args": ["./example_tools/usa_weather.js"]
            },
            "clientWhitelist": ["*"],
            "prefix": "usa_weather_"
        }
    ]
}

Example Tools

The example tools are provided in the example_tools directory, which are simple MCP servers built with Fast MCP.

They are simple connectors for weather APIs for Canada and the United States, providing weather forecasts and alerts for the given location.

You can replace these and add connection details in the config.json file.

Future stuff:

  • Add a way to filter available tools based on the client's whitelist

  • Add WebSocket and HTTP Transport support

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables centralized management and unified interface for multiple child MCP servers (filesystem, sqlite, etc.), allowing users to discover, launch, and execute tools across different MCP servers through a single gateway.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A lightweight MCP gateway that aggregates multiple MCP services into a unified stdio interface, automatically prefixing tool names with the service name to avoid conflicts.
    6
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A gateway that aggregates multiple MCP servers into a single endpoint, namespacing their tools and forwarding calls, so an agent connects to one MCP to access the entire stack.
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    A gateway that connects MCP servers and REST APIs, allowing you to curate tools into groups and expose them as virtual MCP servers for agents.
    5
    1
    MIT