Skip to main content

MCP Settings Configuration

This guide explains how to configure MCP servers in MCPHub using the mcp_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 config
  • servers.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. Set perSessionClient: 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.
Or with a locally spawned Playwright MCP using its --isolated flag:
Only enable perSessionClient for servers that actually hold per-session state. It multiplies upstream connections (and stdio child processes) by the number of concurrent sessions, so leave it off for stateless servers.

File and System Servers

Filesystem Server

SQLite Server

Communication Servers

Slack Server

Development and API Servers

GitHub Server

Map and Location Services

Amap (高德地图) Server

Looking for more servers? The bundled Market catalog in the dashboard lists hundreds of known MCP servers with copy-paste-ready configurations.

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:
When configPath is specified, all other proxy settings (type, host, port, etc.) are ignored, and the custom configuration file is used directly.

Group Management

Group Configuration

System Routing Settings

You can also configure runtime routing and authentication behavior under systemConfig.routing in mcp_settings.json:
  • bearerAuthHeaderName defaults to Authorization and controls which incoming header MCPHub reads for Bearer authentication.
  • Use a custom header such as X-MCP-Authorization when an upstream MCP/OpenAPI server also needs to passthrough Authorization.
  • jsonBodyLimit defaults to 1mb and 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 under systemConfig.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:
The activity log records the original upstream output before compression, so operators can inspect full results in MCPHub even when clients receive compressed content.

Best Practices

Security

  1. Use environment variables for sensitive data:
This comprehensive guide covers all aspects of configuring MCP servers in MCPHub for various use cases and environments.