claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

MCP Configuration Inconsistency: CLI-managed vs File-based configs

Open gebeer opened this issue 6 months ago • 8 comments

Problem

There's an architectural inconsistency in how MCP server configurations are managed in Claude Code:

  1. CLI-managed configs (claude mcp add) are stored internally and not visible in file system
  2. File-based configs (.mcp.json) are documented but create separate configuration system
  3. This creates confusion and breaks discoverability/editability expectations

Current Behavior

When using claude mcp add:

claude mcp add task-master-ai npx -y --package=task-master-ai task-master-ai
claude mcp list  # Shows the server
  • Server appears in claude mcp list
  • No configuration file is created in standard locations:
    • ~/.claude/mcp.json (user-global)
    • .claude/mcp.json (project-local)
    • .mcp.json (project root)

Expected Behavior

CLI-managed MCP servers should be stored in discoverable configuration files following the same pattern as other Claude Code settings:

  • Global servers: ~/.claude/mcp.json
  • Project servers: .claude/mcp.json or .claude/mcp.local.json

This would align with the existing settings hierarchy:

  • ~/.claude/settings.json (user settings)
  • .claude/settings.json (project settings)
  • .claude/settings.local.json (local project settings)

Benefits of Unified Approach

  1. Discoverability: Users can see what MCP servers are configured
  2. Editability: Manual editing of configurations when needed
  3. Consistency: Same pattern as other Claude Code settings
  4. Transparency: No hidden internal storage
  5. Version Control: Project-scoped configs can be committed/shared

Environment

  • Claude Code CLI version: [current]
  • Platform: Linux
  • Configuration locations checked:
    • ~/.claude/ (contains settings.json, config.json, but no mcp.json)
    • Project .claude/ directory
    • Project .mcp.json

Related Documentation

The MCP documentation mentions .mcp.json for project-scoped configs, but doesn't clarify the relationship with CLI-managed configs.

gebeer avatar Jul 07 '25 03:07 gebeer

Claude Code currently stores these in $HOME/.claude.json I guess.

sky0hunter avatar Jul 07 '25 05:07 sky0hunter

Claude Code currently stores these in $HOME/.claude.json I guess.

Thank you. Found it there.

This is still not consistent with other global configs being stored in ~/.claude/

And that .claude.json is a giant blob that contains configs for all projects which doesn't follow the strategy of separation of concerns.

IMO it would be much cleaner to store all project related settings with the project so they can easily be shared across teams also.

gebeer avatar Jul 07 '25 07:07 gebeer

Agreed. This absence is frustrating. I would expect to be able to use ~/.claude/settings.json for this.

qbedard avatar Jul 29 '25 17:07 qbedard

Agreed. This absence is frustrating. I would expect to be able to use ~/.claude/settings.json for this.

Thanks for sharing your experience here. Hope this will help raise attention

gebeer avatar Jul 30 '25 06:07 gebeer

I'd like to version control a subset of my ~/.claude directory via git. It's not unusual to have multiple config files in a config directory, but "breaking out" into ~/.claude.json makes it incredibly hard to accomplish configuration locality. Not impossible, but definitely not clean.

So yeah, ~/.claude/mcp.json would solve this an offer a consistent global/project UX.

mavam avatar Aug 09 '25 10:08 mavam

I'd also second the idea of an mcp.local.json file. It would be nice to have personal project-specific MCP servers that aren't checked into version control but still retain the benefits of a file-based approach.

LandonSchropp avatar Aug 13 '25 03:08 LandonSchropp

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 03 '25 10:12 github-actions[bot]

This is still occurring. The CLI behaves differently from the file-based configs, which makes management of the MCP servers very difficult.

dkbush avatar Dec 09 '25 17:12 dkbush