[FEATURE] Add MCP_CONFIG_PATH environment variable as alternative to --mcp-config flag
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The --mcp-config flag works, but requires passing it on every invocation. There's no environment variable equivalent, which creates friction when:
- CI/CD and containers - env vars are the idiomatic configuration mechanism, not CLI args
- Team consistency - can't set a project-wide default without everyone remembering the flag or maintaining wrapper scripts
- Shell ergonomics - repetitive to type or remember; aliases/wrappers are workarounds, not solutions
Proposed Solution
Add MCP_CONFIG_PATH environment variable support, following the existing naming convention (MCP_TIMEOUT, MAX_MCP_OUTPUT_TOKENS).
MCP_CONFIG_PATH=.claude/.mcp.json claude
Precedence: --mcp-config flag > MCP_CONFIG_PATH env var > default locations
Alternative Solutions
- Symlink .mcp.json → actual config location - works but feels hacky
- Shell alias - alias claude='claude --mcp-config ...' - not portable across team members
- Wrapper script - adds maintenance overhead
Priority
Low - Nice to have
Feature Category
CLI commands and flags
Use Case Example
Our team keeps Claude Code configuration organized in .claude/:
.claude/
├── .mcp.json
├── settings.json
└── ...
We don't want .mcp.json at the project root alongside package.json, pyproject.toml, etc. Currently we pass --mcp-config .claude/mcp-config.json every invocation, which is error-prone.
With MCP_CONFIG_PATH, we can set it once in our shell profile and it just works.
Additional Context
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗