### Install Project Dependencies Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Installs project dependencies using npm or yarn. ```bash npm install # or yarn install ``` -------------------------------- ### Install Dependencies Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Installs project dependencies using npm or yarn. This is a prerequisite for building and running the server. ```bash npm install ``` ```bash yarn install ``` -------------------------------- ### Configure MCP Proxy Backend Servers (JSON) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Defines backend MCP, SSE, and HTTP servers for the proxy. Specifies connection details like type, URL or command, arguments, environment variables, and installation instructions. ```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...' "] } } } ``` -------------------------------- ### Run Development Server (Stdio Mode) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Starts the MCP proxy server in development mode using tsx, which directly executes TS files and restarts on changes. This is the default mode. ```bash npm run dev ``` -------------------------------- ### Specify Tools Folder Path (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Defines the base directory for Stdio server installations initiated via the Admin UI. If not set, installations default to a 'tools' subdirectory in the proxy server's working directory. The Dockerfile sets this to /tools by default. ```bash export TOOLS_FOLDER=/srv/mcp_tools ``` -------------------------------- ### Configure Generic HTTP Client for Streamable MCP Proxy Server Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md This JSON configuration provides a general example for connecting a Streamable HTTP client to the MCP Proxy Server's HTTP endpoint. It includes placeholders for authentication headers like API keys. ```json { "mcpServers": { "my-proxy-http": { "type": "http", "name": "MCP Proxy (Streamable HTTP)", "url": "http://localhost:3663/mcp", "requestInit": { "headers": { "X-Api-Key": "clientkey1" } } } } } ``` -------------------------------- ### Run MCP Inspector for Stdio Debugging (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md This command starts the MCP Inspector, which wraps the built server (`build/index.js`) for debugging Stdio mode communications. Access the inspector UI via the provided URL. Dependencies include Node.js and npm. ```bash npm run inspector ``` -------------------------------- ### Run Development Server (SSE Mode) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Starts the MCP proxy server in development mode using tsx, enabling SSE endpoints and the Admin UI if configured. Environment variables like PORT and ENABLE_ADMIN_UI can be set. ```bash ENABLE_ADMIN_UI=true npm run dev:sse ``` -------------------------------- ### Configure HTTP Tool Call Retries via Environment Variables Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md This example shows how to configure the retry mechanism for HTTP tool calls. It includes enabling retries, setting the maximum number of retries after the initial attempt, and defining the base delay for exponential backoff. ```bash export RETRY_HTTP_TOOL_CALL="true" export HTTP_TOOL_CALL_MAX_RETRIES="3" export HTTP_TOOL_CALL_RETRY_DELAY_BASE_MS="500" ``` -------------------------------- ### Web UI Server Configuration Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Allows configuration of various MCP server types (Stdio, SSE, HTTP) within the Web Admin UI. This includes specifying server type, command, arguments, environment variables, URL, API key, and bearer token for authentication, as well as installation configuration. ```json { "type": "stdio" | "sse" | "http", "command": "path/to/server", "args": ["--arg1", "--arg2"], "env": { "VAR_NAME": "value" }, "url": "http://backend.server.com", "apiKey": "your_api_key", "bearerToken": "your_bearer_token", "installConfig": { "commands": ["npm install", "python setup.py install"], "workingDirectory": "/path/to/install" } } ``` -------------------------------- ### Set Proxy Server Port (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Configures the port for the proxy server's HTTP-based endpoints. This is used when the server runs in a mode that starts an HTTP server. ```bash export PORT=8080 ``` -------------------------------- ### Set Max Retries for Stdio Tool Calls Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Specifies the maximum number of retry attempts after the initial failed attempt for Stdio tool calls. For example, setting to '2' allows for one initial attempt and two retries. Defaults to 2. ```bash STDIO_TOOL_CALL_MAX_RETRIES=3 ``` -------------------------------- ### Build Server Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Compiles TypeScript code to JavaScript in the 'build/' directory. This step is necessary before running the server. ```bash npm run build ``` -------------------------------- ### Build TypeScript Project Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Compiles TypeScript files into JavaScript and places them in the 'build/' directory. ```bash npm run build ``` -------------------------------- ### Usage as Stdio MCP Server Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Configure your MCP client to run the proxy server directly via its command line interface. The proxy will then connect to backend servers specified in its configuration. ```APIDOC ## Usage as Stdio MCP Server Configure your MCP client (e.g., Claude Desktop) to execute the proxy server directly using its command. The proxy server will establish connections to the backend servers as defined in its `config/mcp_server.json` file. ### Example Client Configuration (Claude Desktop) ```json { "mcpServers": { "mcp-proxy": { "name": "MCP Proxy (Aggregator)", "command": "/path/to/mcp-proxy-server/build/index.js", "env": { "NODE_ENV": "production", "TOOLS_FOLDER": "/custom/path/for/proxy/tools" } } } } ``` **Note:** Replace `/path/to/mcp-proxy-server/build/index.js` with the actual file path. Ensure the proxy's configuration directory is correctly located. ``` -------------------------------- ### Configure MCP Servers in JSON Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Defines how to configure backend MCP servers in the `config/mcp_server.json` file. It details various server types (stdio, sse, http) and their specific configuration parameters like commands, URLs, and authentication. ```json { "mcpServers": { "unique-server-key1": { "type": "stdio", "name": "我的 Stdio 服务器", "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": "我的 SSE 服务器", "active": true, "url": "http://localhost:8080/sse", "apiKey": "sse_server_api_key" }, "http-mcp-server": { "type": "http", "name": "我的 Streamable HTTP 服务器", "active": true, "url": "http://localhost:8081/mcp", "bearerToken": "some_secure_token_for_http_server" }, "stdio-default-install": { "type": "stdio", "name": "使用默认安装路径的Stdio服务器", "active": true, "command": "my_other_server", "installCommands": ["echo '安装到默认位置...'"] } } } ``` -------------------------------- ### Build MCP Proxy Server Docker Image Locally Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Command to build the MCP Proxy Server Docker image from the Dockerfile in the current directory. This allows for local development and testing. ```bash docker build -t mcp-proxy-server . ``` -------------------------------- ### Run MCP Proxy Server Docker Container Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Command to run the MCP Proxy Server Docker container. It maps ports, sets environment variables for configuration (like UI credentials and allowed keys), and mounts volumes for configuration files and tools. ```bash docker run -d \ -p 3663:3663 \ -e PORT=3663 \ -e ENABLE_ADMIN_UI=true \ -e ADMIN_USERNAME=myadmin \ -e ADMIN_PASSWORD=yoursupersecretpassword \ -e ALLOWED_KEYS="clientkey1" \ -e TOOLS_FOLDER=/my/custom_tools_volume # Optional: Override default /tools for server installations -v ./my_config:/mcp-proxy-server/config \ -v /path/on/host/to/tools:/my/custom_tools_volume `# Mount a volume for TOOLS_FOLDER if overridden` \ --name mcp-proxy-server \ ghcr.io/ptbsare/mcp-proxy-server/mcp-proxy-server:latest ``` -------------------------------- ### Debugging Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Instructions on how to debug the MCP Proxy Server, including using the MCP Inspector for Stdio mode. ```APIDOC ## Debugging For debugging communication, particularly in Stdio mode, utilize the [MCP Inspector](https://github.com/modelcontextprotocol/inspector). ### Running the MCP Inspector ```bash npm run inspector ``` This command executes the built server (`build/index.js`) with the inspector enabled. The inspector's UI can be accessed via the URL printed in the console output. For SSE mode, browser developer tools can be used to monitor network requests. ``` -------------------------------- ### Configure Claude Desktop for Stdio MCP Proxy Server Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md This JSON configuration snippet shows how to set up Claude Desktop to use the MCP Proxy Server in Stdio mode. It specifies the command to run the proxy server and allows setting environment variables for the proxy's execution. ```json { "mcpServers": { "mcp-proxy": { "name": "MCP Proxy (Aggregator)", "command": "/path/to/mcp-proxy-server/build/index.js", "env": { "NODE_ENV": "production", "TOOLS_FOLDER": "/custom/path/for/proxy/tools" } } } } ``` -------------------------------- ### Enable Admin UI (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Enables the Web Admin UI, which is applicable only in SSE mode. Defaults to false. ```bash export ENABLE_ADMIN_UI=true ``` -------------------------------- ### Run in Development Mode (SSE) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Runs the MCP proxy server in development mode, enabling the SSE endpoint and Admin UI. Requires setting environment variables like PORT and ENABLE_ADMIN_UI. ```bash ENABLE_ADMIN_UI=true npm run dev:sse ``` -------------------------------- ### Configure MCP Proxy Server Tools (JSON) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md This JSON configuration file allows overriding properties of tools discovered from backend servers. You can enable or disable tools, customize their display names, and provide custom descriptions. Keys are formatted as ``. ```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 } } } ``` -------------------------------- ### Allow API Keys for Authentication (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Specifies a comma-separated list of API keys to secure HTTP endpoints. Clients must provide a key via X-Api-Key header or ?key= query parameter. If not set, authentication is disabled. ```bash export ALLOWED_KEYS="client_key1,client_key2" ``` -------------------------------- ### Connecting MCP Clients via SSE Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/DOCS.md Details on how to connect MCP clients to the add-on's SSE endpoint. It includes the SSE URL format and authentication methods using API keys via headers or query parameters. ```Text URL: http://:/sse ``` ```Text Authentication: X-Api-Key header or ?key= query parameter ``` -------------------------------- ### Pull MCP Proxy Server Docker Images Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Instructions to pull the latest standard and bundled Docker images for the MCP Proxy Server from GHCR. The standard image is recommended for most users, while the bundled image includes additional dependencies. ```bash # Pull the latest standard image docker pull ghcr.io/ptbsare/mcp-proxy-server/mcp-proxy-server:latest # Or pull a specific version # docker pull ghcr.io/ptbsare/mcp-proxy-server/mcp-proxy-server:0.1.2 # Pull a bundled version # docker pull ghcr.io/ptbsare/mcp-proxy-server/mcp-proxy-server:latest-bundled-mcpservers-playwright ``` -------------------------------- ### Configure Claude Desktop for SSE MCP Proxy Server with API Key Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md This JSON configuration demonstrates how to connect Claude Desktop to the MCP Proxy Server's SSE endpoint using an API key for authentication. It specifies the proxy's URL with the key as a query parameter. ```json { "mcpServers": { "my-proxy-sse": { "type": "sse", "name": "MCP Proxy (SSE)", "url": "http://localhost:3663/sse?key=clientkey1" } } } ``` -------------------------------- ### Watch Files for Changes and Rebuild Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Monitors project files for changes and automatically rebuilds the project. This is an alternative to using tsx for development if hot-reloading is not desired. ```bash npm run watch ``` -------------------------------- ### Endpoint Authentication Options Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Secures HTTP-based endpoints (`/sse`, `/mcp`) using either an 'Authorization: Bearer ' header or an 'X-API-Key: ' header for flexible client authentication. ```text Authorization: Bearer X-API-Key: ``` -------------------------------- ### Usage as SSE or Streamable HTTP MCP Server Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Run the proxy server in HTTP mode (SSE or Streamable) and configure your MCP client to connect to the designated endpoints. ```APIDOC ## Usage as SSE or Streamable HTTP MCP Server Start the proxy server using its HTTP server modes (e.g., `npm run dev:sse` or via Docker). Configure your MCP client to connect to the proxy's HTTP endpoints. ### Endpoints * **SSE:** `http://localhost:3663/sse` * **Streamable HTTP:** `http://localhost:3663/mcp` ### Authentication If the proxy has authentication enabled (via `ALLOWED_KEYS` or `ALLOWED_TOKENS`), clients must provide credentials. **Methods:** * **API Key:** Use the `?key=...` query parameter for `/sse`, or the `X-Api-Key` header for both `/sse` and `/mcp`. * **Bearer Token:** Use the `Authorization: Bearer ` header. ### Example Client Configuration (Claude Desktop - SSE) ```json { "mcpServers": { "my-proxy-sse": { "type": "sse", "name": "MCP Proxy (SSE)", "url": "http://localhost:3663/sse?key=clientkey1" // Alternatively, use headers for authentication: // "headers": { // "Authorization": "Bearer your_bearer_token_1" // } } } } ``` ### Example Client Configuration (Generic Streamable HTTP) ```json { "mcpServers": { "my-proxy-http": { "type": "http", "name": "MCP Proxy (Streamable HTTP)", "url": "http://localhost:3663/mcp" // Configure authentication headers as per client requirements: // "requestInit": { // "headers": { // "X-Api-Key": "clientkey1" // } // } } } } ``` ``` -------------------------------- ### MCP Proxy Server Endpoints Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md The MCP Proxy Server exposes two primary endpoints for interaction: `/sse` for Server-Sent Events and `/mcp` for Streamable HTTP requests. Both endpoints support flexible authentication using either a Bearer token or an API key. ```APIDOC ## GET /sse ### Description This endpoint provides a Server-Sent Events (SSE) stream aggregating capabilities from connected MCP resource servers. It supports multiple concurrent client connections and can be secured with authentication. ### Method GET ### Endpoint /sse ### Parameters #### Query Parameters - **Authorization** (string) - Required - Use `Authorization: Bearer ` for authentication. - **X-API-Key** (string) - Required - Use `X-API-Key: ` for API key authentication. ### Response #### Success Response (200) - **Content-Type** (string) - `text/event-stream` - Event data will be in SSE format, representing aggregated MCP capabilities. #### Response Example ``` event: server_update data: {"servers": [{"id": "server1", "type": "stdio", "status": "connected"}, {"id": "server2", "type": "sse", "status": "connected"}]} event: tool_discovery data: {"tools": [{"name": "tool1", "description": "A sample tool"}, {"name": "tool2", "description": "Another sample tool"}]} ``` ## GET /mcp ### Description This endpoint offers a Streamable HTTP interface for interacting with the aggregated MCP resource servers. It allows for concurrent client interactions and supports token-based or API key authentication. ### Method GET ### Endpoint /mcp ### Parameters #### Query Parameters - **Authorization** (string) - Required - Use `Authorization: Bearer ` for authentication. - **X-API-Key** (string) - Required - Use `X-API-Key: ` for API key authentication. ### Request Example ```json { "method": "tool_code", "params": { "tool_code": "print('Hello from MCP')", "tool_name": "python" } } ``` ### Response #### Success Response (200) - **Content-Type** (string) - `application/json` or `application/x-ndjson` depending on the operation. - Response body contains the results of the MCP operations. #### Response Example ```json { "name": "python", "result": "Hello from MCP\n" } ``` ``` -------------------------------- ### Web UI Tool Configuration Overrides Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Enables overriding the display name and description for tools discovered from active backend MCP servers within the Web Admin UI. This allows for better organization and clarity of available tools. ```json { "tool_config.json": { "tool_name_to_override": { "displayName": "New Tool Name", "description": "A more descriptive explanation of the tool." } } } ``` -------------------------------- ### Configure Stdio Tool Call Retries (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Configures environment variables for retrying Stdio tool calls. This allows enabling retries, specifying the maximum retry attempts, and setting the base delay for exponential backoff. ```bash export RETRY_STDIO_TOOL_CALL="true" export STDIO_TOOL_CALL_MAX_RETRIES="5" export STDIO_TOOL_CALL_RETRY_DELAY_BASE_MS="1000" ``` -------------------------------- ### Run MCP Inspector for Debugging Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md This bash command executes the MCP Inspector, which wraps the proxy server's build. This is primarily used for debugging the communication in Stdio mode. The inspector UI can be accessed via a URL provided in the console output. ```bash npm run inspector ``` -------------------------------- ### Configure SSE Tool Call Retries (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Enables and configures retry settings for SSE tool calls via environment variables. This includes enabling the retry mechanism, defining the maximum number of retries, and setting the base delay for exponential backoff. ```bash export RETRY_SSE_TOOL_CALL="true" export SSE_TOOL_CALL_MAX_RETRIES="3" export SSE_TOOL_CALL_RETRY_DELAY_BASE_MS="500" ``` -------------------------------- ### Watch for Changes Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Monitors project files for changes and rebuilds automatically. This is useful when not using tsx for direct execution. ```bash npm run watch ``` -------------------------------- ### Set Admin UI Credentials (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Sets the username and password required for logging into the Admin UI. These are required if the Admin UI is enabled. ```bash export ADMIN_USERNAME=myadmin export ADMIN_PASSWORD=aVerySecurePassword123! ``` -------------------------------- ### Configure Claude Desktop for SSE MCP Proxy Server with Bearer Token Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md This JSON snippet illustrates configuring Claude Desktop to connect to the MCP Proxy Server's SSE endpoint using a Bearer Token for authentication. It shows how to set custom headers for the token. ```json { "mcpServers": { "my-proxy-sse": { "type": "sse", "name": "MCP Proxy (SSE)", "headers": { "Authorization": "Bearer your_bearer_token_1" } } } } ``` -------------------------------- ### Configure Stdio Tool Call Retries via Environment Variables Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Enables or disables retry logic for Stdio tool calls. Configures the maximum number of retries and the base delay for exponential backoff. Defaults are true for retry enabled, 2 for max retries, and 300ms for base delay. ```bash # Example environment variables for Stdio tool call retries: # export RETRY_STDIO_TOOL_CALL="true" # export STDIO_TOOL_CALL_MAX_RETRIES="3" # export STDIO_TOOL_CALL_RETRY_DELAY_BASE_MS="500" ``` -------------------------------- ### Configure HTTP Tool Call Retries via Environment Variables Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Enables or disables retry logic for HTTP tool calls. Configures the maximum number of retries and the base delay for exponential backoff. Defaults are true for retry enabled, 2 for max retries, and 300ms for base delay. ```bash # Example environment variables for HTTP tool call retries: # export RETRY_HTTP_TOOL_CALL="true" # export HTTP_TOOL_CALL_MAX_RETRIES="3" # export HTTP_TOOL_CALL_RETRY_DELAY_BASE_MS="500" ``` -------------------------------- ### Run in Development Mode (Stdio) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Runs the MCP proxy server in development mode using tsx for direct TypeScript execution with automatic restarts on file changes. This is the default mode for Stdio MCP servers. ```bash npm run dev ``` -------------------------------- ### Configure HTTP Tool Call Retries (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Sets environment variables to control the retry behavior for HTTP tool calls. This includes enabling retries, setting the maximum number of retries, and defining the base delay for exponential backoff. ```bash export RETRY_HTTP_TOOL_CALL="true" export HTTP_TOOL_CALL_MAX_RETRIES="3" export HTTP_TOOL_CALL_RETRY_DELAY_BASE_MS="500" ``` -------------------------------- ### Allow Bearer Tokens for Authentication (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Specifies a comma-separated list of Bearer Tokens for securing HTTP endpoints. Clients must provide a token via the Authorization: Bearer header. If not set, authentication is disabled. ```bash export MCP_PROXY_SSE_ALLOWED_TOKENS="your_bearer_token_1,your_bearer_token_2" ``` -------------------------------- ### Configure SSE Tool Call Retries via Environment Variables Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README_ZH.md Enables or disables retry logic for SSE tool calls. Configures the maximum number of retries and the base delay for exponential backoff. Defaults are true for retry enabled, 2 for max retries, and 300ms for base delay. ```bash export RETRY_SSE_TOOL_CALL="true" export SSE_TOOL_CALL_MAX_RETRIES="3" export SSE_TOOL_CALL_RETRY_DELAY_BASE_MS="500" ``` -------------------------------- ### Set Server Toolname Separator (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Defines the separator used to combine server and tool names for internal keys. Must be at least 2 characters and contain only alphanumeric characters, hyphens, or underscores. Defaults to '__'. ```bash export SERVER_TOOLNAME_SEPERATOR="___") # Example: using triple underscore ``` -------------------------------- ### Set Logging Level (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Controls the minimum log level output by the server. Possible values are error, warn, info, debug. Logs at the specified level and above will be shown. Defaults to 'info'. ```bash export LOGGING="debug" ``` -------------------------------- ### Enable Retries for HTTP Tool Call Errors (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Controls whether to retry on HTTP tool call connection errors. Set to 'true' to enable, 'false' to disable. Defaults to true. ```bash export RETRY_HTTP_TOOL_CALL="true" ``` -------------------------------- ### Admin Web Terminal Styling (CSS) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/public/terminal.html CSS rules to style the web terminal interface, including background, text color, layout, and status indicators for connection states (connected, disconnected, error). ```css body, html { height: 100%; margin: 0; padding: 0; background-color: #1e1e1e; /* Dark background */ color: #ccc; /* Light text */ display: flex; flex-direction: column; } #terminal-container { flex-grow: 1; /* Take remaining height */ padding: 10px; overflow: hidden; /* Let xterm handle scrolling */ } #terminal { width: 100%; height: 100%; } .terminal-header { background-color: #333; padding: 5px 10px; font-family: sans-serif; font-size: 0.9em; display: flex; justify-content: space-between; align-items: center; } .terminal-status { color: lightgreen; } .terminal-status.disconnected { color: orange; } .terminal-status.error { color: red; } .back-link { color: #aaa; text-decoration: none; } .back-link:hover { color: #fff; } ``` -------------------------------- ### Set Base Retry Delay for SSE Tool Calls (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Sets the base delay in milliseconds for SSE tool call retries, used in exponential backoff. Defaults to 300. ```bash export SSE_TOOL_CALL_RETRY_DELAY_BASE_MS="300" ``` -------------------------------- ### Enable Retries for SSE Tool Calls (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Controls whether retries are enabled for SSE tool calls. Set to 'true' to enable, 'false' to disable. Defaults to true. ```bash export RETRY_SSE_TOOL_CALL="true" ``` -------------------------------- ### Set Base Retry Delay for Stdio Tool Calls Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Defines the base delay in milliseconds for the exponential backoff calculation for Stdio tool calls. The delay increases exponentially with each retry. Defaults to 300ms. ```bash STDIO_TOOL_CALL_RETRY_DELAY_BASE_MS=500 ``` -------------------------------- ### Enable Stdio Tool Call Retries Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Enables or disables the retry mechanism for Stdio-based tool calls. If set to 'true', the proxy will attempt to restart the Stdio process and retry failed requests using an exponential backoff strategy. Defaults to true. ```bash RETRY_STDIO_TOOL_CALL=true ``` ```bash RETRY_STDIO_TOOL_CALL=false ``` -------------------------------- ### Enable SSE Tool Call Retries via Environment Variable Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md This snippet demonstrates how to enable the automatic reconnection and retry of SSE tool calls when the connection is lost. The `RETRY_SSE_TOOL_CALL_ON_DISCONNECT` environment variable controls this feature. ```bash export RETRY_SSE_TOOL_CALL_ON_DISCONNECT="true" ``` -------------------------------- ### Set Session Secret for Admin UI (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Configures a secret used to sign session cookies for the Admin UI. Recommended for security. A strong secret can be generated using openssl. ```bash # Recommended: Generate a strong secret (e.g., openssl rand -hex 32) export SESSION_SECRET='your_very_strong_random_secret_here' ``` -------------------------------- ### Set Max Retries for SSE Tool Calls (Bash) Source: https://github.com/ptbsare/mcp-proxy-server/blob/main/README.md Specifies the maximum number of retry attempts for SSE tool calls after an initial failure. Defaults to 2. ```bash export SSE_TOOL_CALL_MAX_RETRIES="2" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.