.mcp.json
.mcp.json is a configuration file, usually at the root of a project, that lists which MCP servers Claude Code should start for that project, along with the command and any environment variables each one needs.
Why it matters
Because a project's .mcp.json is often committed to a shared repository, it should never contain a raw secret value. The safe pattern is to reference an environment variable by name and let each developer's own machine supply the real value.
Is .mcp.json the same for every project?
No, each project can list a different set of servers, and a user-level file adds servers available everywhere.
Should I gitignore .mcp.json?
Only if it contains machine-specific paths or values. If it only references environment variables by name, it is usually safe to commit.
Related
Looking for a different way to manage your keys? See the best Claude Code API key manager alternatives, or browse every term in the glossary.