Skip to content

2.4 MCP Server Integration

An MCP (Model Context Protocol) server extends Claude by connecting it to an external system. That system can be a database, an API, a development tool or an issue tracker. The way a team configures its servers decides whether the team shares one consistent toolset or has a confusing mix of different configurations.

This lesson uses one made-up example throughout: a toy shop. Its two developers use Claude Code on the shop’s online store. Both need Claude to reach the store’s GitHub repository and stock database. One developer also wants to trial a code search server alone.

Configuration exists at two levels. Most setup problems start when the two levels are confused.

Project level: .mcp.json. The file is in the project repository root and is version-controlled. So every team member who clones or pulls the repository gets it. Use it for servers the whole team needs: a Jira integration, GitHub tools, internal API connectors. The toy shop’s GitHub and stock database servers belong in this file.

{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
},
"atlassian": {
"type": "http",
"url": "https://mcp.atlassian.com/v1/mcp/authv2"
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "${WORKSPACE_ROOT:-.}"]
}
}
}

The example shows two forms of entry. A remote server declares "type": "http" and a url. A local server declares a command and args, and communicates over stdio (standard input and output). An entry with a url but no type is a configuration error. Claude Code reads it as a stdio server, skips it, and tells you to add the type.

User level: ~/.claude.json. The file is in the user’s home directory and is personal. It is not version-controlled and not shared with teammates. Use it for experimental servers, personal integrations, or servers you are testing before proposing them to the team. The toy shop’s trial search server belongs in this file.

All tools from all configured servers, project and user level, are discovered at connection time and available simultaneously. There is no manual activation step. If a server is configured and reachable, its tools appear in the agent’s toolkit. The trial developer’s Claude sees all three servers’ tools.

.mcp.json supports ${VARIABLE_NAME} syntax for environment variable expansion. This syntax keeps credentials out of version control whilst the server configuration stays shared.

{
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}",
"DATABASE_URL": "${DATABASE_URL}"
}
}

The file references variable names, not values. Each developer sets their own tokens locally, in a shell profile, a .env file or a secrets manager. Each toy shop developer uses their own GitHub token. This means:

  • The configuration file is safe to commit to version control
  • Each developer authenticates with their own credentials
  • Token rotation does not require config file changes
  • No secrets leak through repository history

A second form, ${VAR:-default}, expands to VAR when VAR is set, and to default when VAR is not set. Use it for machine-specific paths with a sensible default, like ${WORKSPACE_ROOT:-.} above. Current state (checked 6 October 2026): an unset variable with no default does not stop the rest of the configuration loading. Claude Code warns and continues, so do not rely on a missing token to cause a visible failure.

An MCP resource exposes a content catalogue to an agent upfront. So the agent needs no exploratory tool calls to discover what data exists. This description is the way exam guide v1.0 describes resources and the answer that the exam marks as correct.

Current state (checked 6 October 2026): the MCP specification says resources are application-driven. The server lists them, but the client decides when to attach one to the model’s context. So the agent sees a resource only when the host, the application that contains the MCP client, shows it. Claude Code shows resources through @server:resource mentions and a resource-listing tool.

What to expose as resources:

  • Issue summaries: a list of current Jira issues with titles and statuses
  • Documentation hierarchies: a table of contents for your internal docs
  • Database schemas: table names, column types, and relationships

The benefit is fewer wasted calls. Without resources, an agent might call list_tables, then describe_table for every table, to learn what data exists. With a database schema resource, the agent has that information immediately. For the toy shop, that resource is the shop’s stock database schema.

Resources show agents what data is available. Tools let them act on it.

A team that integrates with an external system can build a custom MCP server or use a community server. This choice appears constantly, in the exam and in real work.

Use community servers for standard integrations:

  • Jira, GitHub, Slack, Linear and Notion all have maintained community MCP servers
  • They cover standard use cases, the community tests them, and they receive updates
  • Using them saves development time and maintenance burden

Build custom servers only when:

  • Your team has specific workflows that community servers cannot handle
  • You need custom business logic embedded in the tools that the server provides
  • You require integration with proprietary internal systems that have no community server

The toy shop uses a community GitHub server. The shop’s stock database is internal. So if no community server covers that database, a custom connector for it is worth building.

Built-in tools such as Grep have rich, detailed descriptions, so the model has better context about them. When an MCP tool has a sparse description, the agent may prefer the built-in tool even when the MCP tool is more capable.

The fix is a description that explains capabilities and outputs in detail. Instead of:

search_codebase: "Searches code"

Write:

search_codebase: "Performs semantic code search across the
entire repository using AST-aware indexing. Returns matching
functions, classes, and methods with full context including
file path, line numbers, and surrounding code. More accurate
than text-based grep for finding code by intent rather than
exact string match. Use this instead of Grep when searching
for code by what it does rather than what it contains."

The detailed description gives the model enough context to prefer the MCP tool when it is more capable than the built-in alternative. The toy shop’s trial search server needs the same kind of detailed description, or Claude may keep using Grep.

On build-vs-use questions, the exam consistently favours the pragmatic choice. “Evaluate community servers first” is always correct when a standard integration is involved. “Build custom” is only correct when the scenario explicitly describes team-specific requirements that community servers cannot meet.

Both GitHub and Atlassian provide official remote servers now, so neither server uses an npx line in the first example.

Five exam-style multiple-choice questions on MCP Server Integration. Pick an answer, then open the explanation.

A team needs to integrate with Jira for issue tracking in their Claude Code workflow. A developer proposes building a custom MCP server. What is the correct first step?

  • A. Evaluate the existing community MCP servers for Jira, and build custom only if none covers the team’s workflow.
  • B. Build a custom MCP server with the exact API endpoints the team needs.
  • C. Call the Jira REST API directly from Bash commands rather than going through MCP at all, which avoids the server entirely.
  • D. Add the Jira integration to ~/.claude.json so each developer configures it independently.
Answer & explanation

Correct: A

  • A is correct because a community server is the first thing to reach for on a standard integration. They are maintained, tested and already cover the common cases, which leaves a custom build justified only where team-specific requirements genuinely are not met.
  • B is wrong because building custom before looking is premature. Community MCP servers for Jira already exist and handle standard use cases.
  • C is wrong because direct API calls bypass the MCP tool interface, giving up tool descriptions, structured responses and agent-native integration.
  • D is wrong because a team-wide integration belongs in project-level .mcp.json, where it is version-controlled and shared. ~/.claude.json is for personal servers.

A developer commits the following to .mcp.json: {“env”: {“GITHUB_TOKEN”: “ghp_abc123xyz789”}}. What is the security problem?

  • A. The token format is invalid for GitHub.
  • B. The token belongs in ~/.claude.json rather than in .mcp.json.
  • C. The literal credential is committed to version control instead of using ${GITHUB_TOKEN} expansion.
  • D. env is not a valid field in .mcp.json, so the configuration will be silently ignored when the server starts.
Answer & explanation

Correct: C

  • C is correct because a credential written straight into .mcp.json enters the repository history and is readable by anyone with access, including after it is deleted. The ${GITHUB_TOKEN} syntax keeps the value on each developer’s machine.
  • A is wrong because the token is syntactically valid, ghp_ prefix and all. The problem is that it is exposed, not that it is malformed.
  • B is wrong because moving the file does not help while the value is still hard-coded. The fix is environment variable expansion, not a different location.
  • D is wrong because env is a valid field. What is wrong here is the value it holds, not the key.

An agent makes 5 tool calls just to understand a database structure: list_tables, then describe_table for each of 4 tables. What MCP feature would reduce these exploratory calls?

  • A. Caching the tool responses at the server so that every subsequent schema request returns faster.
  • B. Adding a get_full_schema tool that returns every table description in a single call up front.
  • C. Including the schema in the system prompt so that the agent already knows the structure before it starts work.
  • D. Exposing the database schema as an MCP resource, so it is available without any tool call.
Answer & explanation

Correct: D

  • D is correct because MCP resources expose a content catalogue, a database schema being the textbook case, at connection time. The structure is simply there, so list_tables and describe_table never need to run.
  • A is wrong because caching speeds up repeat calls but leaves the first five in place, and the first five are the ones being paid for here.
  • B is wrong because one call is better than five yet still a call. A resource supplies the same information with none.
  • C is wrong because the system prompt is the wrong home for structured data. It costs context tokens on every single request and goes stale the moment the schema changes.

A team has project-level servers in .mcp.json and a developer has personal servers in ~/.claude.json. When Claude Code connects, which tools are available?

  • A. Only the project-level tools, since .mcp.json takes precedence over user configuration.
  • B. Every tool from both levels, discovered at connection time and available at once.
  • C. Only user-level tools, since personal configuration overrides the project settings entirely.
  • D. Neither, until the developer explicitly activates one server level for the current session.
Answer & explanation

Correct: B

  • B is correct because tools from all configured servers, project-level and user-level alike, are discovered when Claude Code connects and are then available together. Neither level overrides the other and nothing has to be switched on.
  • A is wrong because user-level servers are not excluded. Both levels contribute their tools.
  • C is wrong because project-level servers are not overridden. Both levels contribute their tools.
  • D is wrong because there is no activation step. Discovery happens automatically at connection time.

An MCP tool named search_codebase has the description “Searches code.” The agent consistently prefers the built-in Grep tool instead. Why, and what is the fix?

  • A. The MCP tool is slower than Grep, so the agent optimises for speed.
  • B. The sparse MCP description loses to Grep’s detailed one, so expand it to cover capabilities and output.
  • C. Built-in tools always take priority over MCP tools, whatever their descriptions happen to say.
  • D. The tool should be renamed grep_enhanced to signal that it supersedes the built-in Grep.
Answer & explanation

Correct: B

  • B is correct because the model prefers the tool it understands best. Grep arrives with a detailed built-in description while “Searches code” says almost nothing, so expanding it to cover what the tool returns and when to prefer it over Grep is what shifts the choice.
  • A is wrong because the agent has no performance data. It selects on descriptions, not on measured speed.
  • C is wrong because built-in tools carry no inherent priority. Selection turns on description quality and relevance to the query.
  • D is wrong because naming an MCP tool to impersonate a built-in one adds confusion rather than removing it. The description is what needs the work.