Config Inheritance
Basic idea
Section titled “Basic idea”Use extends
to compose configs and keep them DRY.
{ "extends": ["~/.hatago/base.json", "./team.json"], "mcpServers": { "local": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] } }}
- Multiple parents are supported:
"extends": ["./base1.json", "./base2.json"]
- Paths support
~
(home), relative, and absolute - Deep merge: child values override parent values
- Remove inherited env vars by setting
null
Env override example
Section titled “Env override example”{ "extends": "~/.hatago/global.json", "mcpServers": { "github": { "env": { "GITHUB_TOKEN": "${WORK_GITHUB_TOKEN}", "DEBUG": null } } }}
Verify behavior
Section titled “Verify behavior”hatago serve --stdio --config ./hatago.config.json --verbose
Troubleshooting
Section titled “Troubleshooting”Circular extends
Section titled “Circular extends”Break the cycle and ensure each file appears once in the chain.
File not found
Section titled “File not found”Check path correctness, ~
expansion, and relative path base (current file).
Unexpected merge results
Section titled “Unexpected merge results”Remember child overrides parent. Inspect the effective config with --verbose
and review logs.