MCP Server Configuration & Scoping
CoreIntegrate MCP servers into Claude Code and agent workflows · Difficulty 3/5
Model Context Protocol (MCP) provides a standardized way to connect Claude to external tools and data sources.
MCP Server Scoping
| Scope | Config File | Use Case | Version Controlled |
|---|
|-------|------------|----------|-------------------|
| Project | `.mcp.json` | Shared team tooling | Yes |
|---|---|---|---|
| User | ~/.claude.json | Personal/experimental servers | No |
Tools from all configured MCP servers are discovered at connection time and available simultaneously to the agent.
Project-Scoped Configuration
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}Environment variable expansion (${GITHUB_TOKEN}) keeps credentials out of version control while providing a single source of truth for team configuration.
MCP Resources
MCP resources expose content catalogs (issue summaries, documentation hierarchies, database schemas) to give agents visibility into available data without requiring exploratory tool calls. This reduces unnecessary tool invocations and improves agent efficiency.
Best Practices
~/.claude.json to avoid polluting the team config.Key Takeaways
- ✓Use project-scoped .mcp.json for team tools, user-scoped ~/.claude.json for personal tools
- ✓Environment variable expansion (${TOKEN}) keeps credentials out of version control
- ✓Enhance MCP tool descriptions to prevent agents from preferring built-in tools over more capable MCP tools
- ✓Use MCP resources to expose content catalogs and reduce exploratory tool calls
Related Concepts
Test Yourself1 of 2
Your team wants to add a GitHub MCP server for PR lookups. Each developer has their own GitHub personal access token. You want consistent tooling without committing credentials. What's the most effective configuration approach?