Developer

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

โšก Quick Answer

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 typeMac/Linux pathWindows pathScope
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
๐Ÿ”ฌ From the field

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.

โš ๏ธ Don't commit secrets: Once a key is in git history, it's compromised โ€” even if you delete it later. Always use ${VAR_NAME} references and set the actual values locally. Add .env to your .gitignore.

Global vs Project: The Decision Matrix

Global ConfigProject Config
Team sharingNot possible (per-machine)Easy via git commit
Personal credentialsSafe โ€” never committedRisky โ€” don't put secrets here
Project-specific toolsClutters every projectPerfect fit
Priority when both existOverridden by project configTakes precedence

The Decision Checklist

  1. Should the whole team have this? โ†’ Project config
  2. Does it use your personal credentials? โ†’ Global config
  3. Do you want it in every project? โ†’ Global config
  4. Is it specific to this project's infrastructure? โ†’ Project config
๐Ÿ’ก Priority rule: When the same server name exists in both configs, project config wins. This lets teams override a developer's global defaults for a specific project โ€” useful when you need a project-specific version of a tool.

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.

TT

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.