by ptbsare
This server acts as a central hub for Model Context Protocol (MCP) resource servers.
# Add to your Claude Code skills
git clone https://github.com/ptbsare/mcp-proxy-server/sse, /mcp) with flexible authentication options (Authorization: Bearer <token> or X-API-Key: <key>).endpoint events) and support for concurrent connections./mcp) also supports concurrent client interactions./mcp) and SSE (/sse) endpoints. Can also run in a pure Stdio mode.This server acts as a central hub for Model Context Protocol (MCP) resource servers. It can:
No comments yet. Be the first to share your thoughts!
config/mcp_server.json.ENABLE_ADMIN_UI=true)Provides a browser-based interface for managing the proxy server configuration and connected tools. Features include:
mcp_server.json). Supports Stdio, SSE, and HTTP server types with relevant options (type, command, args, env, url, apiKey, bearerToken, install config).tool_config.json).Configuration is primarily done via environment variables and JSON files located in the ./config directory.
config/mcp_server.json)This file defines the backend MCP servers the proxy should connect to.
Example config/mcp_server.json:
{
"mcpServers": {
"unique-server-key1": {
"type": "stdio",
"name": "My Stdio Server",
"active": true,
"command": "/path/to/server/executable",
"args": ["--port", "1234"],
"env": {
"API_KEY": "server_specific_key"
},
"installDirectory": "/custom_install_path/unique-server-key1",
"installCommands": [
"git clone https://github.com/some/repo unique-server-key1",
"cd unique-server-key1 && npm install && npm run build"
]
},
"another-sse-server": {
"type": "sse",
"name": "My SSE Server",
"active": true,
"url": "http://localhost:8080/sse",
"apiKey": "sse_server_api_key"
},
"http-mcp-server": {
"type": "http",
"name": "My Streamable HTTP Server",
"active": true,
"url": "http://localhost:8081/mcp",
"bearerToken": "some_secure_token_for_http_server"
},
"stdio-default-install": {
"type": "stdio",
"name": "Stdio Server with Default Install Path",
"active": true,
"command": "my_other_server",
"installCommands": ["echo 'Installing to default location...'"]
}
}
}
Fields:
mcpServers: (Required) An object where each key is a unique identifier for a backend server.name: (Optional) A user-friendly display name for the server (used in Admin UI).active: (Optional, default: true) Set to false to prevent the proxy from connecting to this server.type: (Required) Specifies the transport type. Must be one of "stdio", "sse", or "http".command: (Required if type is "stdio") The command to execute the server process.args: (Optional if type is "stdio") An array of string arguments to pass to the command.env: (Optional if type is "stdio") An object of environment variables (KEY: "value") to set for the server process. These are merged with the proxy server's environment.url: (Required if type is "sse" or "http") The full URL of the backend server's endpoint (e.g., SSE endpoint for "sse", MCP endpoint for "http").apiKey: (Optional if type is "sse" or "http") An API key to send in the X-Api-Key header when the proxy connects to this specific backend server.bearerToken: (Optional if type is "sse" or "http") A token to send in the Authorization: Bearer <token> header when connecting to this specific backend server. (If both apiKey and bearerToken are provided, bearerToken generally takes precedence for that specific backend connection).installDirectory: (Optional if type is "stdio") The absolute path where the server itself should be installed (e.g., /opt/my-server-files). Used by the Admin UI's installation feature.
mcp_server.json, this exact path is used.TOOLS_FOLDER environment variable (see Environment Variables section).
TOOLS_FOLDER is set and not empty, the server will be installed in a subdirectory named after the server key within this folder (e.g., ${TOOLS_FOLDER}/<server_key>).TOOLS_FOLDER is also empty or not set, it defaults to a tools subdirectory within the proxy server's working directory (e.g., ./tools/<server_key>).TOOLS_FOLDER or ./tools) is writable by the user running the proxy server.installCommands: (Optional for Stdio type) An array of shell commands executed sequentially by the Admin UI's installation feature if the target server directory (derived from installDirectory or defaults) does not exist. Commands are executed from the parent directory of the target server installation directory (e.g., if installDirectory resolves to /opt/tools/my-server, commands run in /opt/tools/). Use with extreme caution due to security risks.config/tool_config.json)This file allows overriding properties of tools discovered from backend servers. It is primarily managed via the Admin UI but can be edited manually.
Example config/tool_config.json:
{
"tools": {
"unique-server-key1__tool-name-from-server": {
"enabled": true,
"displayName": "My Custom Tool Name",
"description": "A more user-friendly description."
},
"another-sse-server__another-tool": {
"enabled": false
}
}
}
<server_key><separator><original_tool_name>, where <separator> is the value of the SERVER_TOOLNAME_SEPERATOR environment variable (defaults to __).enabled: (Optional, default: true) Set to false to hide this tool from clients connecting to the proxy.displayName: (Optional) Override the tool's name in client UIs.description: (Optional) Override the tool's description.PORT: Port for the proxy server's HTTP-based endpoints (/sse, /mcp, and Admin UI if enabled). Default: 3663. Note: This is only used when running in a mode that starts an HTTP server (e.g., via npm run dev:sse or the Docker container). The npm run dev script runs in Stdio mode.
export PORT=8080
ALLOWED_KEYS: (Optional) Comma-separated list of API keys to secure the proxy's HTTP-based endpoints (/sse, /mcp). If neither ALLOWED_KEYS nor ALLOWED_TOKENS are set, authentication is disabled for these endpoints. Clients must provide a key via X-Api-Key header or ?key= query parameter.
export ALLOWED_KEYS="client_key1,client_key2"
ALLOWED_TOKENS: (Optional) Comma-separated list of Bearer Tokens to secure the proxy's HTTP-based endpoints (/sse, /mcp). If neither ALLOWED_KEYS nor ALLOWED_TOKENS are set, authentication is disabled. Clients must provide a token via the Authorization: Bearer <token> header. If both ALLOWED_KEYS