Config Inheritance
Basic Configuration
Create a config
Section titled “Create a config”npx @himorishige/hatago-mcp-hub init
The wizard generates a sensible starter config.
{ "$schema": "https://raw.githubusercontent.com/himorishige/hatago-hub/main/schemas/config.schema.json", "version": 1, "logLevel": "info", "mcpServers": {}}
Structure
Section titled “Structure”{ "$schema": "...", "version": 1, "logLevel": "info", "mcpServers": { "server-id": { // server definition } }}
Server types
Section titled “Server types”{ "mcpServers": { "local-fs": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."], "env": { "LOG_LEVEL": "debug" }, "cwd": "." } }}
Remote (HTTP/SSE)
Section titled “Remote (HTTP/SSE)”{ "mcpServers": { "api": { "url": "https://api.example.com/mcp", "type": "http", "headers": { "Authorization": "Bearer ${API_TOKEN}" } }, "stream": { "url": "https://stream.example.com/mcp", "type": "sse" } }}
Environment variables
Section titled “Environment variables”${VAR}
— expands to variable (errors if undefined)${VAR:-default}
— uses default when undefined
Example:
{ "env": { "API_URL": "${API_URL:-https://api.example.com}", "LOG_LEVEL": "${LOG_LEVEL:-info}", "TIMEOUT": "${TIMEOUT_MS:-30000}" }}
Tag-based management
Section titled “Tag-based management”{ "mcpServers": { "dev-tools": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."], "tags": ["development", "local"] }, "prod-api": { "url": "https://api.production.com/mcp", "tags": ["production", "remote"] }, "shared-db": { "command": "mcp-postgres", "tags": ["development", "production", "database"] } }}
Start with tags:
hatago serve --tags developmenthatago serve --tags development,local
Best practices
Section titled “Best practices”- Use clear IDs
✅ "github-api", "local-filesystem" / ❌ "srv1"
- Provide defaults for env vars
{ "DATABASE_URL": "${DATABASE_URL:-postgresql://localhost/dev}" }
- Organize with tags (environment, purpose, criticality)
- Disable unused servers with
"disabled": true
- Adjust log level per environment via env
Validate & test
Section titled “Validate & test”# JSON syntaxcat hatago.config.json | jq .
# Run with verbose logs (Ctrl+C to stop)hatago serve --stdio --config ./hatago.config.json --verbose
Hot reload
Section titled “Hot reload”hatago serve --watch
On change: reload config, reconnect servers, notify clients.
Related
Section titled “Related”Remote Servers
Tag Filtering
Config Reference