Claude Code MCP Global vs Project Config: When to Use Each
Claude Code MCP global project config explained โ when to use global vs project-level settings, how to safely share skills with your team via git, and how to handle secrets across environments.
๐Last updated 4 March 2026
Global config (~/.claude/settings.json) = personal tools, your credentials, things you want everywhere. Project config (.claude/settings.json) = team tools, stuff you'll commit to git. Never put API keys directly in project config โ use environment variable references instead.
Here's the question I get most from teams adopting Claude Code: "Where should I put the Postgres skill?" The answer depends on who needs it and whether there are secrets involved. Let me walk through the logic.
The Two Locations
| Config type | Mac/Linux path | Windows path | Scope |
|---|---|---|---|
| Global | ~/.claude/settings.json |
%USERPROFILE%\.claude\settings.json |
All projects, this machine only |
| Project | .claude/settings.json (project root) |
.claude\settings.json (project root) |
This project only โ committable to git |
Global Config โ Your Personal Toolkit
Think of global config as your personal workspace. Anything in here follows you across every project you open with Claude Code.
Good fits for global config:
- Weather, calculator, notes โ tools you want everywhere
- Web search with your personal API key
- GitHub tool with your personal access token
- Any tool using credentials that are yours, not the project's
{
"mcpServers": {
"weather": {
"command": "npx",
"args": ["-y", "@trustedskills/weather-mcp"]
},
"web-search": {
"command": "npx",
"args": ["-y", "@trustedskills/web-search-mcp"],
"env": { "SEARCH_API_KEY": "your-personal-key" }
}
}
}
Project Config โ Team Tools via Git
Project config's superpower is that it lives in your repo. Commit it, push it, and every team member who clones the repo has the same tools automatically.
Good fits for project config:
- Database tools pointing to the project's dev DB
- Project-specific validators or code generators
- Any tool that should be the same for all developers on the team
We added a Supabase MCP skill to a startup's project config. Every new hire cloned the repo and immediately had AI-assisted database queries, schema exploration, and migration help inside Claude Code โ with zero additional setup. The client calculated it saved about 30 minutes of onboarding per developer.
Project config example
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@trustedskills/postgres-mcp"],
"env": { "DATABASE_URL": "${DATABASE_URL}" }
}
}
}
Each developer sets their own DATABASE_URL in their shell or a gitignored .env file. The config commits safely โ no actual credentials in the repo.
${VAR_NAME} references and set the actual values locally. Add .env to your .gitignore.
Global vs Project: The Decision Matrix
| Global Config | Project Config | |
|---|---|---|
| Team sharing | Not possible (per-machine) | Easy via git commit |
| Personal credentials | Safe โ never committed | Risky โ don't put secrets here |
| Project-specific tools | Clutters every project | Perfect fit |
| Priority when both exist | Overridden by project config | Takes precedence |
The Decision Checklist
- Should the whole team have this? โ Project config
- Does it use your personal credentials? โ Global config
- Do you want it in every project? โ Global config
- Is it specific to this project's infrastructure? โ Project config
Frequently Asked Questions
What happens if the same skill is in both global and project config?
Project config takes precedence. The project version is used when you're working in that project. This lets you override global defaults on a per-project basis.
Can I commit the project config to git without exposing secrets?
Yes โ use ${VAR_NAME} references and keep actual values in your local shell environment or a gitignored .env file. The config file itself contains no secrets.
How do I add a project-scoped skill via the CLI?
Use the --project flag: claude mcp add my-tool --project -- npx -y @package/name. This writes to .claude/settings.json in your current directory.
TrustedSkills Team
The TrustedSkills team builds and tests AI agent integrations across Claude, OpenClaw, Cursor, and VS Code. We verify every skill in our registry and have set up hundreds of MCP configs across every major platform.