CCAR-F - Tool Design & MCP Integration - Section 2.4

Integrate MCP servers into Claude Code and agent workflows.

Project-level .mcp.json holds shared team tooling and user-level configuration holds personal or experimental servers. Environment variable expansion supplies credentials without committing secrets. Tools from every configured server are discovered at connection time and are available simultaneously. Candidates should enrich MCP tool descriptions so the agent stops preferring a built-in such as Grep, expose content catalogues as MCP resources, and prefer an existing community server for a standard integration.

project-scoped .mcp.jsonuser-scoped MCP configurationenvironment variable expansionMCP resources as content cataloguescommunity versus custom MCP servers

Practice question for this objective

Free sampleTool Design & MCP Integrationmedium

The Platform Tooling team at a logistics company ships a codeindex MCP server that lets engineers ask Claude Code about an unfamiliar legacy billing service. The server definition is committed to the repository in .mcp.json, shown in the configuration below, and it starts cleanly for the four engineers who built it. A newly joined engineer clones the repository and the server fails to start on her first session, while the built-in Read, Grep and Glob tools work normally. Which mechanism explains that failure?

{
  "mcpServers": {
    "codeindex": {
      "command": "node",
      "args": ["./tools/codeindex-server.js"],
      "env": { "CODEINDEX_TOKEN": "${CODEINDEX_TOKEN}" }
    }
  }
}
  • AThe token value is stored in the committed file, and a project-scoped entry may not carry credentials, so the server is blocked until the whole entry is moved into her user-scoped configuration.
  • BA project-scoped server stays inert until each engineer re-runs the command that originally generated the entry, which rewrites the definition with machine-local paths before the server can be launched.
  • CThe reference to CODEINDEX_TOKEN is expanded from her own shell environment at the moment the server process is launched, so with that variable unset and no default supplied in the entry the expansion fails and the server never starts. Correct
  • DThe committed definition distributes the server name, but the token itself is resolved from the user-scoped configuration of whoever committed the file, which a fresh clone on another machine has no way to read.
Environment variable references in a project-scoped MCP definition are expanded from each developer's own environment when the server launches. A project-scoped .mcp.json is committed precisely because it carries references rather than values. The expansion happens locally at launch time against the environment of the engineer starting the session, so a definition that works for four people fails for a fifth whose environment lacks the variable and whose entry supplies no fallback value.

Why A is wrong: Tempting because moving secrets out of a shared file is sound practice and user scope is a real alternative, but the committed file holds a variable reference rather than a value, so there is no credential in it to reject.

Why B is wrong: Tempting because some tooling does generate machine-specific configuration, but a committed definition is read as written and no regeneration step is required for it to launch.

Why C is correct: Correct: environment variable expansion in a server definition resolves against the launching developer's environment, which is what makes the file safe to commit and also what makes it fail for anyone who has not supplied the value.

Why D is wrong: Tempting because it correctly separates definition from secret, but there is no cross-machine lookup of another developer's configuration; the value comes from the local environment of whoever runs the server.

See more CCAR-F practice questions, answers explained.

More in this domain

Back to all Tool Design & MCP Integration objectives, or the CCAR-F cert hub.

Examworthy is not affiliated with or endorsed by Anthropic. Original, blueprint-aligned practice material only.