Labsco
MCP SERVER

MCP Proxy Hub

by naotaka3

Put several MCP servers behind one connection — filter and rename their tools, define compound tools that span servers, and keep API keys out of responses.

MCP Plumbing: Proxies, Registries & Inspectors
Summary
Unexpansion is the feature to notice.

Expanding `${API_KEY}` into a tool argument is ordinary; replacing the secret with its variable reference on the way back out is not, and it is what keeps a credential from reappearing in a response the model will read. Note that only the `${VARIABLE_NAME}` form is expanded — bare `$VARIABLE_NAME` is not. Timeout handling is documented down to the edge cases: values over the maximum safe delay are capped and malformed values fall through with a warning.

What it is

An MCP proxy that connects to multiple backend servers and presents their combined tools, resources and prompts through a single interface. It routes calls to the right backend, and gives you control over which tools are exposed and what they are called.

What you get
  • Tools from every connected server exposed with server-name prefixes, and requests routed to the right backend
  • Per-server tool filtering — `exposedTools` allows only what you list, `hiddenTools` blocks what you name, and `exposedTools` entries can be `{original, exposed}` objects to rename a tool
  • Compound tools you define yourself, whose `subtools` are keyed by server name, invoked with a `{server, tool, args}` payload
  • Environment variables expanded in tool arguments with `${VARIABLE_NAME}` syntax and unexpanded back into references in responses — configured per variable, globally or per server, so an API key does not travel back in output
  • Backends over stdio, SSE or Streamable HTTP, each with `enable` and its own `timeout` in seconds — `0` disables the timeout, unset falls back to the SDK default of 60 seconds
  • The hub itself served over stdio, SSE or Streamable HTTP, with optional bearer auth
  • A CLI for direct and interactive use — `mcp-proxy-hub-cli list` and `mcp-proxy-hub-cli call <toolName> key=value`, with `--output-dir` to save results
Requirements

A JSON configuration file listing the servers to connect to — copy `config.example.json` to `config.json` and edit it; `MCP_PROXY_CONFIG_PATH` points at it. Other variables: `MCP_PROXY_LOG_DIRECTORY_PATH`, `MCP_PROXY_LOG_LEVEL` (`debug` or `info`), `MCP_PROXY_AUTH_TOKEN` for bearer auth, `MCP_PROXY_PATH` (default `/mcp`), `PORT` (default 3006), `HOST` (default `0.0.0.0`), and `KEEP_SERVER_OPEN=1` to hold the connection after a client disconnects in SSE mode. The package is `@naotaka/mcp-proxy-hub` with four binaries — stdio, SSE, HTTP and the CLI. `npm install` then `npm run build`.

Setup effort

One command — npx -y @naotaka/mcp-proxy-hub