此服务器充当 Model Context Protocol (MCP) 资源服务器的中心枢纽。
/sse, /mcp) with flexible authentication options (Authorization: Bearer or X-API-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:
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:
…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 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}/).TOOLS_FOLDER is also empty or not set, it defaults to a tools subdirectory within the proxy server's working directory (e.g., ./tools/).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
}
}
}, where 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=8080ALLOWED_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 header. If both ALLOWED_KEYS and ALLOWED_TOKENS are configured, Bearer Token authentication will be attempted first.
export MCP_PROXY_SSE_ALLOWED_TOKENS="your_bearer_token_1,your_bearer_token_2"ENABLE_ADMIN_UI: (Optional) Set to true to enable the Web Admin UI (only applicable in SSE mode). Default: false.
export ENABLE_ADMIN_UI=trueADMIN_USERNAME: (Required if Admin UI enabled) Username for Admin UI login. Default: admin.
ADMIN_PASSWORD: (Required if Admin UI enabled) Password for Admin UI login. Default: password (Change this!).
export ADMIN_USERNAME=myadmin
export ADMIN_PASSWORD=aVerySecurePassword123!SESSION_SECRET: (Optional, recommended if Admin UI enabled) Secret used to sign session cookies. If not set, a default, less secure secret is used, and a warning is issued. A secure secret is automatically generated and saved to config/.session_secret on first run if not provided via environment variable.
# Recommended: Generate a strong secret (e.g., openssl rand -hex 32)
export SESSION_SECRET='your_very_strong_random_secret_here'TOOLS_FOLDER: (Optional) Specifies the base directory for Stdio server installations initiated via the Admin UI, used when installDirectory is not explicitly set in mcp_server.json for a specific server.
/custom/tools_path), installations for servers without a specific installDirectory will target a subdirectory named after the server key within this folder (e.g., ${TOOLS_FOLDER}/).TOOLS_FOLDER is not set or is empty, such installations will default to a tools subdirectory within the proxy server's working directory (e.g., ./tools/)./tools by default.export TOOLS_FOLDER=/srv/mcp_toolsSERVER_TOOLNAME_SEPERATOR: (Optional) Defines the separator used to combine the server name and tool name when generating the unique key for tools (e.g., server-key__tool-name). This key is used internally and in the tool_config.json file.
__.-), and underscores (_).__) will be used, and a warning will be logged.export SERVER_TOOLNAME_SEPERATOR="___" # Example: using triple underscoreLOGGING: (Optional) Controls the minimum log level output by the server.
error, warn, info, debug.info.export LOGGING="debug"RETRY_SSE_TOOL_CALL: (Optional) Controls whether to enable retries for SSE tool calls. Set to "true" to enable, "false" to disable. Default: true. See the "Enhanced Reliability Features" section for details.
export RETRY_SSE_TOOL_CALL="true"SSE_TOOL_CALL_MAX_RETRIES: (Optional) Maximum number of retry attempts for SSE tool calls (after the initial failure). Default: 2. See the "Enhanced Reliability Features" secti
暂无开放 Issues,或尚未同步最近议题。