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
{
"mcpServers": {
"server-name": {
"command": "command-to-run",
"args": ["arg1", "arg2"],
"env": {
"ENV_VAR": "value"
}
}
}
}
Example Configuration
{
"mcpServers": {
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"],
"env": {
"USER_AGENT": "MCPHub/1.0"
}
},
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--headless"]
},
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}",
"SLACK_TEAM_ID": "${SLACK_TEAM_ID}"
}
}
}
}
Server Configuration Options
Required Fields
| Field | Type | Description |
|---|
command | string | Executable command or path |
args | array | Command-line arguments |
Optional Fields
| Field | Type | Default | Description |
|---|
env | object | {} | Environment variables |
Common MCP Server Examples
Web and API Servers
Fetch Server
{
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"],
"env": {
"USER_AGENT": "MCPHub/1.0",
"MAX_REDIRECTS": "10"
}
}
}
Web Scraping with Playwright
{
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--headless"],
"timeout": 60000,
"env": {
"PLAYWRIGHT_BROWSERS_PATH": "/tmp/browsers"
}
}
}
File and System Servers
Filesystem Server
{
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/allowed/path"],
"env": {
"ALLOWED_OPERATIONS": "read,write,list"
}
}
}
SQLite Server
{
"sqlite": {
"command": "uvx",
"args": ["mcp-server-sqlite", "--db-path", "/path/to/database.db"],
"env": {
"SQLITE_READONLY": "false"
}
}
}
Communication Servers
Slack Server
{
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}",
"SLACK_TEAM_ID": "${SLACK_TEAM_ID}",
"SLACK_APP_TOKEN": "${SLACK_APP_TOKEN}"
}
}
}
Email Server
{
"email": {
"command": "python",
"args": ["-m", "mcp_server_email"],
"env": {
"SMTP_HOST": "smtp.gmail.com",
"SMTP_PORT": "587",
"EMAIL_USER": "${EMAIL_USER}",
"EMAIL_PASSWORD": "${EMAIL_PASSWORD}"
}
}
}
Development and API Servers
GitHub Server
{
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}
}
Google Drive Server
{
"gdrive": {
"command": "npx",
"args": ["-y", "@google/mcp-server-gdrive"],
"env": {
"GOOGLE_CLIENT_ID": "${GOOGLE_CLIENT_ID}",
"GOOGLE_CLIENT_SECRET": "${GOOGLE_CLIENT_SECRET}",
"GOOGLE_REFRESH_TOKEN": "${GOOGLE_REFRESH_TOKEN}"
}
}
}
Map and Location Services
Amap (高德地图) Server
{
"amap": {
"command": "npx",
"args": ["-y", "@amap/amap-maps-mcp-server"],
"env": {
"AMAP_MAPS_API_KEY": "${AMAP_API_KEY}",
"AMAP_LANGUAGE": "zh-cn"
}
}
}
OpenStreetMap Server
{
"osm": {
"command": "python",
"args": ["-m", "mcp_server_osm"],
"env": {
"OSM_USER_AGENT": "MCPHub/1.0"
}
}
}
Advanced Configuration
Environment Variable Substitution
MCPHub supports environment variable substitution using ${VAR_NAME} syntax:
{
"mcpServers": {
"api-server": {
"command": "python",
"args": ["-m", "api_server"],
"env": {
"API_KEY": "${API_KEY}",
"API_URL": "${API_BASE_URL}/v1"
}
}
}
}
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
{
"mcpServers": {
"fetch-via-proxy": {
"command": "uvx",
"args": ["mcp-server-fetch"],
"proxy": {
"enabled": true,
"type": "socks5",
"host": "127.0.0.1",
"port": 1080
}
}
}
}
Proxy Configuration Options
| Field | Type | Default | Description |
|---|
enabled | boolean | false | Enable/disable proxy routing |
type | string | socks5 | Proxy protocol: socks4, socks5, or http |
host | string | - | Proxy server hostname or IP address |
port | number | - | Proxy server port |
username | string | - | Proxy authentication username (optional) |
password | string | - | Proxy authentication password (optional) |
configPath | string | - | Path to custom proxychains4 config file |
Proxy with Authentication
{
"mcpServers": {
"secure-server": {
"command": "npx",
"args": ["-y", "@example/mcp-server"],
"proxy": {
"enabled": true,
"type": "http",
"host": "proxy.example.com",
"port": 8080,
"username": "${PROXY_USER}",
"password": "${PROXY_PASSWORD}"
}
}
}
}
Using Custom proxychains4 Configuration
For advanced use cases, you can provide your own proxychains4 configuration file:
{
"mcpServers": {
"custom-proxy-server": {
"command": "python",
"args": ["-m", "custom_mcp_server"],
"proxy": {
"enabled": true,
"configPath": "/etc/proxychains4/custom.conf"
}
}
}
}
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
{
"groups": {
"production": {
"name": "Production Tools",
"description": "Stable production servers",
"servers": ["fetch", "slack", "github"]
},
"experimental": {
"name": "Experimental Features",
"description": "Beta and experimental servers",
"servers": ["experimental-ai", "beta-search"]
}
}
}
Best Practices
Security
-
Use environment variables for sensitive data:
{
"env": {
"API_KEY": "${API_KEY}",
"DATABASE_PASSWORD": "${DB_PASSWORD}"
}
}
This comprehensive guide covers all aspects of configuring MCP servers in MCPHub for various use cases and environments.