MCP Server Integration
MCP connects Claude to external systems. Learn config scoping, secret handling, resources vs tools, and when to build a custom server versus reusing one.
The Model Context Protocol (MCP) is an open standard that lets Claude connect to external systems — databases, APIs, issue trackers, dev tools — through a consistent client-server interface. An MCP server exposes tools (actions), resources (readable content), and prompts. Configuring it well means the whole team shares one consistent setup instead of drifting into per-machine configuration fragmentation.
The scoping hierarchy
Where you declare a server decides who gets it. Project scope lives in .mcp.json at the repo root, is version-controlled, and is shared with everyone who clones the repo — the right home for team-wide integrations like GitHub or Jira. User scope lives in ~/.claude.json in your home directory, is personal, and is not shared — the right home for experimental or personal servers you are trialing before proposing them to the team.
| Aspect | Project (.mcp.json) | User (~/.claude.json) |
|---|---|---|
| Location | Repo root | Home directory |
| Version-controlled | Yes | No |
| Shared with team | Yes | No |
| Best for | GitHub, Jira, internal connectors | Experiments, personal integrations |
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}Hardcoding a token into a version-controlled .mcp.json leaks the secret into repository history and forces every developer to share one credential.
"env": { "GITHUB_TOKEN": "ghp_aB3xR9kLm2QpZ7vN" }Reference an environment variable with ${...} expansion. Each developer supplies their own token, secrets stay out of git, and tokens rotate without touching the config.
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }Project-level .mcp.json is version-controlled and shared with the team; user-level ~/.claude.json is personal and not shared. Use ${ENV_VAR} expansion so credentials stay out of version control entirely.
The ${VARIABLE_NAME} syntax references an environment variable instead of embedding the secret. Each developer authenticates with their own token, set through a shell profile, .env file, or secrets manager. Tokens can rotate without touching the config, and no secret ever enters repository history.
Resources vs. tools
Resources expose content that already exists so the agent can read it without spending exploratory tool calls — issue summaries, documentation tables of contents, database schemas. Tools perform actions on that data. The mental model: resources show *what data exists*; tools *do something* with it. Surfacing a schema as a resource saves Claude from a round of discovery calls just to learn table names.
Build vs. use
- Use a community server for standard integrations — GitHub, Jira, Slack, Linear, Notion. They are maintained, tested, and updated for you.
- Build a custom server only when team-specific workflows, custom business logic, or proprietary systems have no community equivalent.
Building a custom Jira (or GitHub, Slack) server from scratch for a standard integration burns effort re-solving a maintained, tested problem.
Reuse the community server first. Adopt the maintained connector, and build custom only when team-specific workflows, business logic, or proprietary systems have no equivalent.
A frequent distractor has you building a custom Jira server from scratch. The correct first move is to evaluate the community Jira server and build custom only if it cannot handle your team-specific workflows.
Descriptions must compete
Sparse MCP tool descriptions cause Claude to prefer built-in tools that carry richer documentation. A bare "Searches code" loses to a detailed built-in every time. Describe what the tool does, what it returns, when to use it, and why it beats the alternative — the same description discipline from lesson 2.1, applied so your MCP tools actually get selected.
Example of a competitive description: 'Semantic code search across the whole repo using AST-aware indexing. Returns matching functions and methods with file path, line numbers, and surrounding context. More accurate than text grep for finding code by intent.'
How the exam will try to trick you
The distractors below look right under time pressure — learn the tell.
- The trap
Build a custom MCP server from scratch for a standard integration like Jira.
Correct answerEvaluate the community Jira server first; build custom only if it cannot handle team-specific workflows.
Why: Community servers for standard integrations are already maintained, tested, and updated for you.
- The trap
Put team-wide MCP server configuration in
~/.claude.json.Correct answerDeclare team-wide servers in the project-level
.mcp.jsonat the repo root.Why:
~/.claude.jsonis personal and not version-controlled, so teammates never receive the config. - The trap
Commit the credential directly into
.mcp.json, e.g."GITHUB_TOKEN": "ghp_...".Correct answerReference it with
${GITHUB_TOKEN}expansion so each developer supplies their own token.Why: Hardcoding leaks the secret into repository history and forces one shared credential.
- The trap
Leave MCP tool descriptions sparse, e.g.
"Searches code".Correct answerDescribe what the tool does, what it returns, when to use it, and why it beats the alternative.
Why: Against a richly documented built-in tool, a bare MCP description loses the selection every time.
Key takeaways
- MCP is an open protocol connecting Claude to external systems via tools, resources, and prompts.
- Project .mcp.json is version-controlled and shared; user ~/.claude.json is personal.
- Use ${ENV_VAR} expansion to keep credentials out of version control and enable per-user tokens.
- Resources expose existing content to read; tools perform actions — surface schemas as resources.
- Reuse maintained community servers for standard integrations; build custom only when required.
- Enhance MCP tool descriptions so they compete with well-documented built-in tools for selection.
Frequently asked questions
What is MCP in Claude?+
MCP, the Model Context Protocol, is an open standard that lets Claude connect to external systems like databases, APIs, and issue trackers through a consistent client-server interface. An MCP server exposes tools for actions, resources for readable content, and prompts, so Claude can act on systems beyond its context window.
Where should team-wide MCP servers be configured?+
In the project-level .mcp.json file at the repository root, which is version-controlled and shared with everyone who clones the repo. Personal or experimental servers belong in the user-level ~/.claude.json, which is not shared. Credentials should always be referenced through environment variables.
Should I build a custom MCP server or use an existing one?+
Evaluate community servers first for standard integrations such as GitHub, Jira, Slack, and Notion, because they are maintained and tested. Build a custom server only when your team has workflows, business logic, or proprietary systems that no community server can handle.