MCP Settings Configuration
This guide explains how to configure MCP servers in MCPHub using themcp_settings.json file and related configurations.
Configuration Files Overview
MCPHub uses several configuration files:mcp_settings.json: Your personal configuration of active MCP servers and system configservers.json: Metadata cataloging hundreds of available MCP servers.env: Environment variables and secrets
Basic MCP Settings Structure
mcp_settings.json
Example Configuration
Server Configuration Options
A server entry has the shape"<server-name>": ServerConfig. The relevant fields depend on the transport, which is selected by type.
Top-level fields
type: "stdio" (default)
type: "sse" or type: "streamable-http"
type: "openapi"
The authoritative definition of every field is the
ServerConfig type in src/types/index.ts — consult it if you need behavior not described here.
Common MCP Server Examples
Web and API Servers
Fetch Server
Web Scraping with Playwright
Per-session client isolation (stateful servers)
By default MCPHub keeps a single upstream connection per server and shares it across every downstream MCP session. For stateful servers this means all clients share the same state — with Playwright, for example, every session drives the same browser instance and its tabs. SetperSessionClient: true to make MCPHub open a dedicated upstream client per
downstream session instead. Each session gets its own connection (and, for
stdio servers, its own child process), created lazily on first tool call and torn
down automatically when the session ends.
perSessionClient is a MCPHub-side setting: it controls how many upstream
connections MCPHub opens. It is distinct from Playwright MCP’s own --isolated
flag, which controls browser-profile isolation on the Playwright side. The two
pair naturally — enable both for fully isolated browser sessions.--isolated flag:
File and System Servers
Filesystem Server
SQLite Server
Communication Servers
Slack Server
Development and API Servers
GitHub Server
Map and Location Services
Amap (高德地图) Server
Advanced Configuration
Environment Variable Substitution
MCPHub supports environment variable substitution using${VAR_NAME} syntax:
Proxy Configuration (proxychains4)
MCPHub supports routing STDIO server network traffic through a proxy using proxychains4. This feature is available on Linux and macOS only (Windows is not supported).To use this feature, you must have
proxychains4 installed on your system:- Debian/Ubuntu:
apt install proxychains4 - macOS:
brew install proxychains-ng - Arch Linux:
pacman -S proxychains-ng
Basic Proxy Configuration
Proxy Configuration Options
Proxy with Authentication
Using Custom proxychains4 Configuration
For advanced use cases, you can provide your own proxychains4 configuration file:Group Management
Group Configuration
System Routing Settings
You can also configure runtime routing and authentication behavior undersystemConfig.routing in mcp_settings.json:
bearerAuthHeaderNamedefaults toAuthorizationand controls which incoming header MCPHub reads for Bearer authentication.- Use a custom header such as
X-MCP-Authorizationwhen an upstream MCP/OpenAPI server also needs to passthroughAuthorization. jsonBodyLimitdefaults to1mband controls the Express JSON parser limit for API requests, including large inline OpenAPI schema uploads.
Tool Result Compression
MCPHub can transparently compress large text tool results before returning them to MCP clients. This is useful when upstream tools return large logs, diffs, search output, JSON arrays, or long text blobs that would otherwise consume too much model context. Tool result compression is disabled by default. Enable and tune it from Settings → Tool Result Compression, or configure it undersystemConfig.toolResultCompression:
Compression only applies to successful tool responses. Responses with
isError: true are returned unchanged, non-text content blocks are preserved, and each text block is evaluated independently. When MCPHub compresses a result, it prepends a marker such as:
Best Practices
Security
-
Use environment variables for sensitive data: