# .mcp.json

Canonical page: /glossary/mcp-json

API keys & secrets glossary, Claude Code & MCP. .mcp.json: Where Claude Code Stores Server Config

**Short answer:** .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.

## In Claude Keychain

Claude Keychain avoids the .mcp.json secret problem entirely: instead of listing a key inside the file, the config just points to Claude Keychain's server, which looks the key up in the macOS Keychain at call time.

## Common questions

**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

[claude mcp add](/glossary/claude-mcp-add), [MCP server](/glossary/mcp-server), [.env file](/glossary/env-file)
