Skip to content

CCAR-F · Domain 2: Tool Design & MCP Integration · 18% of the exam

Task 2.4: Integrate MCP servers into Claude Code and agent workflows

Project, local and user scopes for MCP servers, environment variable expansion in .mcp.json for credentials, resources as content catalogs, descriptions that make MCP tools win over built-ins, and community servers versus custom ones.

Study it

  • MCP servers in Claude Code: scopes, .mcp.json, environment variables and resources

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the Anthropic documentation page that proves it.

Question 1 · choose 1

Your team wants every developer who clones the repository to get the same GitHub MCP server in Claude Code. The server needs a personal access token in an Authorization header, and tokens must never be committed. How should the server be configured?

  1. ACommit .mcp.json with a shared service-account token so that nobody has to set anything up
  2. BHave each developer add the server with claude mcp add --scope user, passing their own token on the command line
  3. CDescribe the server's URL and the token setup in the project CLAUDE.md so that Claude connects to it
  4. DCommit it in the project's .mcp.json with the Authorization header set to "Bearer ${GITHUB_TOKEN}"
Show the answer and why
  • ACommit .mcp.json with a shared service-account token so that nobody has to set anything up

    Incorrect

    This puts a secret in version control, which the requirement rules out.

  • BHave each developer add the server with claude mcp add --scope user, passing their own token on the command line

    Incorrect

    User scope is private to each machine, so the shared configuration drifts and new teammates do not get it from the repository.

  • CDescribe the server's URL and the token setup in the project CLAUDE.md so that Claude connects to it

    Incorrect

    CLAUDE.md gives Claude instructions; it does not configure MCP servers.

  • DCommit it in the project's .mcp.json with the Authorization header set to "Bearer ${GITHUB_TOKEN}"

    Correct

    Project-scoped .mcp.json is shared through version control, and environment variable expansion keeps each developer's token out of the file.

Shared team tooling belongs in project-scoped .mcp.json, and credentials stay out of it through ${VAR} expansion in fields such as headers, which Claude Code fills from each developer's environment.

Question 2 · choose 1

Before writing any query, your agent calls list_tables and then describe_table a dozen times on an internal analytics MCP server to work out which tables exist. The schemas change a few times a month, and the team owns the server. What change gives the agent this information without the exploratory calls?

  1. AAdd a dump_database tool that returns every table's schema and sample rows in one call
  2. BRaise the server's output limit so that a single describe_table call can return several tables at once
  3. CPaste the current schemas into the project's CLAUDE.md so they load at the start of every session
  4. DExpose the table catalog and the table schemas as MCP resources that the server keeps current
Show the answer and why
  • AAdd a dump_database tool that returns every table's schema and sample rows in one call

    Incorrect

    One giant tool result floods the context with rows the agent does not need and is still a tool call per query.

  • BRaise the server's output limit so that a single describe_table call can return several tables at once

    Incorrect

    Fewer, larger calls still leave the agent exploring through tools to discover what exists.

  • CPaste the current schemas into the project's CLAUDE.md so they load at the start of every session

    Incorrect

    A hand-copied schema goes stale every time the tables change and costs context in sessions that do not need it.

  • DExpose the table catalog and the table schemas as MCP resources that the server keeps current

    Correct

    Resources are the MCP mechanism for exposing content such as database schemas, served by the server so they stay current.

Use MCP resources to expose content catalogs, such as schemas, issue summaries or documentation trees, so agents can see what data exists without exploratory tool calls. Tools stay for actions and queries.

Question 3 · choose 1

Your shared .mcp.json points a server at an internal URL. Most developers use the default, but a few run a local copy and need a different URL without editing the shared file. How should the URL be written?

  1. A"${API_BASE_URL:-https://api.internal.example}/mcp"
  2. B"${API_BASE_URL}/mcp", without a default
  3. CThe default URL hard-coded, with developers editing it locally
  4. DA separate .mcp.json per developer, committed in their branch
Show the answer and why
  • A"${API_BASE_URL:-https://api.internal.example}/mcp"

    Correct

    ${VAR:-default} uses the variable when set and the default otherwise.

  • B"${API_BASE_URL}/mcp", without a default

    Incorrect

    Only developers who set the variable get a URL; everyone on the default would have to set it too.

  • CThe default URL hard-coded, with developers editing it locally

    Incorrect

    Local edits to a tracked file are easy to commit by accident.

  • DA separate .mcp.json per developer, committed in their branch

    Incorrect

    Per-branch copies drift from the shared file.

${VAR:-default} expands to the variable when it is set and to the default otherwise, so the same entry works for both groups without local edits.

Question 4 · choose 1

A developer opens a repository whose committed .mcp.json defines two servers. In an interactive session, Claude Code asks before using them. The developer approved one by mistake and wants to be asked again. What should they run?

  1. A/clear in the session
  2. Bclaude mcp remove for both servers, then add them back
  3. Cclaude mcp reset-project-choices, then restart
  4. DNothing; approvals cannot be changed once given
Show the answer and why
  • A/clear in the session

    Incorrect

    Clearing the conversation does not reset server approvals.

  • Bclaude mcp remove for both servers, then add them back

    Incorrect

    Removing edits the shared configuration instead of the developer's choice.

  • Cclaude mcp reset-project-choices, then restart

    Correct

    This resets approval choices for project-scoped servers.

  • DNothing; approvals cannot be changed once given

    Incorrect

    Approval choices can be reset.

Claude Code asks for approval before using project-scoped servers from .mcp.json in interactive sessions; claude mcp reset-project-choices resets those choices.

Question 5 · choose 1

You maintain an internal MCP server whose get_schema tool returns a database schema of about 120,000 characters that Claude needs in full. In Claude Code, the result keeps being saved to a file and replaced in the conversation with a file path, and Claude then reads it in pieces. As the server's author, what should you change?

  1. ASet _meta["anthropic/maxResultSizeChars"] on get_schema in the server's tools/list entry
  2. BAsk every developer to raise MAX_MCP_OUTPUT_TOKENS before starting Claude Code
  3. CReturn the schema as an isError result so that it is passed to Claude directly
  4. DMark get_schema with "anthropic/alwaysLoad": true so that its output loads in full
Show the answer and why
  • ASet _meta["anthropic/maxResultSizeChars"] on get_schema in the server's tools/list entry

    Correct

    The annotation raises that tool's persist-to-disk threshold, up to 500,000 characters, so the full schema stays in the result.

  • BAsk every developer to raise MAX_MCP_OUTPUT_TOKENS before starting Claude Code

    Incorrect

    That variable does not change the 50,000-character threshold for text results, so the schema would still be saved to a file.

  • CReturn the schema as an isError result so that it is passed to Claude directly

    Incorrect

    Error text longer than about 11,000 characters is cut down to its first and last 5,000 characters, so most of the schema would be lost.

  • DMark get_schema with "anthropic/alwaysLoad": true so that its output loads in full

    Incorrect

    alwaysLoad controls whether the tool's definition loads upfront or behind tool search; it does not change result size limits.

Claude Code saves large MCP results to a file once they pass 50,000 characters (or the token limit) and gives Claude the path. For a tool whose large output is genuinely needed, the server author sets anthropic/maxResultSizeChars in the tool's _meta to raise its threshold.

Question 6 · choose 1

A developer has a user-scoped analytics MCP server that slows startup and that they never use in one particular repository. They want Claude Code to stop connecting to it there, keep its configuration for their other projects, and be able to turn it back on quickly. What should they do?

  1. ARun claude mcp remove for the server and add it back when they need it again
  2. BAdd the server's name to disabledMcpjsonServers in the project's settings
  3. CSet ENABLE_TOOL_SEARCH=false for sessions in that repository
  4. DToggle the server off in the /mcp panel while working in that repository
Show the answer and why
  • ARun claude mcp remove for the server and add it back when they need it again

    Incorrect

    Removing the server deletes its configuration everywhere, which they want to keep.

  • BAdd the server's name to disabledMcpjsonServers in the project's settings

    Incorrect

    That setting controls approval of servers defined in a project's .mcp.json, not a user-scoped server.

  • CSet ENABLE_TOOL_SEARCH=false for sessions in that repository

    Incorrect

    That loads every MCP tool upfront; it does not stop the connection.

  • DToggle the server off in the /mcp panel while working in that repository

    Correct

    The /mcp toggle stops Claude Code from connecting to the server and records the choice per project, keeping its configuration.

To disable an MCP server without removing it, toggle it off in /mcp. Claude Code records the choice per project in ~/.claude.json, keeps the server listed as disabled, and still connects to it in other projects.

Question 7 · choose 1

A remote MCP server that requires OAuth shows as failing in Claude Code, and none of its tools are available. Where do you check its status and sign in?

  1. AA restart with --verbose
  2. BThe project CLAUDE.md, by adding the OAuth token there
  3. CThe /mcp command in the Claude Code session
  4. DThe .mcp.json file, by pasting an access token into the URL
Show the answer and why
  • AA restart with --verbose

    Incorrect

    More verbose output neither shows server status in one place nor signs you in.

  • BThe project CLAUDE.md, by adding the OAuth token there

    Incorrect

    Tokens never belong in CLAUDE.md, and it does not authenticate servers.

  • CThe /mcp command in the Claude Code session

    Correct

    /mcp shows each server's status and handles authentication for remote servers.

  • DThe .mcp.json file, by pasting an access token into the URL

    Incorrect

    Embedding secrets in a shared file is unsafe, and OAuth handles this.

Use /mcp in Claude Code to inspect server status and to authenticate with remote servers that require OAuth.

Practise domain 2 →Practise all domains →