GitHub - TBXark/mcp-proxy: An MCP proxy server that aggregates and serves multiple MCP resource servers through a single HTTP server. (original) (raw)

MCP Proxy Server

An MCP proxy server that aggregates and serves multiple MCP resource servers through a single HTTP server.

Features

Installation

Build from Source

git clone https://github.com/TBXark/mcp-proxy.git cd mcp-proxy make build ./build/mcp-proxy --config path/to/config.json

Install by go

go install github.com/TBXark/mcp-proxy@latest

Docker

The Docker image supports two MCP calling methods by default: npx and uvx.

docker run -d -p 9090:9090 -v /path/to/config.json:/config/config.json ghcr.io/tbxark/mcp-proxy:latest

or

docker run -d -p 9090:9090 ghcr.io/tbxark/mcp-proxy:latest --config https://example.com/path/to/config.json

Configuration

The server is configured using a JSON file. Below is an example configuration:

This is the format for the new version's configuration. The old version's configuration will be automatically converted to the new format's configuration when it is loaded.

You can use https://tbxark.github.io/mcp-proxy to convert the configuration of mcp-proxy into the configuration that Claude can use.

options

Common options for mcpProxy and mcpServers.

In the new configuration, the authTokens of mcpProxy is not a global authentication token, but rather the default authentication token for mcpProxy. When authTokens is set in mcpServers, the value of authTokens in mcpServers will be used instead of the value in mcpProxy. In other words, the authTokens of mcpProxy serves as a default value and is only applied when authTokens is not set in mcpServers.

Other fields are the same.

mcpProxy

Proxy HTTP server configuration

mcpServers

MCP server configuration, Adopt the same configuration format as other MCP Clients.

For stdio mcp servers, the command field is required.

For sse mcp servers, the url field is required. When the current url exists, sse will be automatically configured.

For http streaming mcp servers, the url field is required. and transportType need to manually set to streamable-http.

Usage

Usage of mcp-proxy:
  -config string
        path to config file or a http(s) url (default "config.json")
  -help
        print help and exit
  -version
        print version and exit
  1. The server will start and aggregate the tools and capabilities of the configured MCP clients.
  2. When MCP Server type is sse, You can access the server at http(s)://{baseURL}/{clientName}/sse. (e.g., https://mcp.example.com/fetch/sse, based on the example configuration)
  3. When MCP Server type is streamable-http, You can access the server at http(s)://{baseURL}/{clientName}/mcp. (e.g., https://mcp.example.com/fetch/mcp, based on the example configuration)
  4. If your MCP client does not support custom request headers., you can change the key in clients such as fetch to fetch/{authToken}, and then access it via fetch/{authToken}.

Thanks

License

This project is licensed under the MIT License. See the LICENSE file for details.