Study guides / CCAR-P / Domain 1

Integration · Lesson 7 of 8

1.7 - Choosing an Integration Mechanism: MCP, API/CLI, or Agent-to-Agent

Compare direct API tools, CLI access, MCP and agent-to-agent protocols on reuse, governance, latency and coupling, and select and justify the mechanism for a given integration.

Every capability you give Claude has to be reached somehow, and the mechanism you choose fixes your coupling, your governance story and your latency. There are four you must be able to compare: direct API tool definitions, CLI or shell access, the Model Context Protocol (MCP), and agent-to-agent (A2A) protocols. They are not mutually exclusive, and a scenario question usually turns on one or two of the criteria below rather than on a slogan such as "standardise on MCP".

What each mechanism is

Know the platform limits of MCP on the Messages API. The MCP connector (beta) reaches only remote servers exposed over HTTP, supports only the tool-call part of the specification, and is not covered by zero data retention arrangements. For local stdio servers, prompts or resources, run your own MCP client and use the SDK's conversion helpers. The MCP specification itself evolves; the current 2026-07-28 revision, for example, makes the protocol stateless and deprecates roots, sampling and logging, so check the current revision rather than assuming older behaviour.

A decision framework

CriterionLeans direct toolLeans MCPLeans CLILeans A2A
ConsumersOne applicationSeveral hosts or teamsDeveloper or CI environmentAnother agent or organisation
Ownership and couplingYou own both sides and change them togetherSeparate owners need a stable contractA tool already existsThe other side plans and decides for itself
Governance and auditEnforced per appEnforced once, centrally, at the serverWeakest; needs a sandboxAt the agent boundary
LatencyLowest (in process)Extra hop; small for stdio, network for remoteProcess spawn per callHighest; multi-turn
Interaction shapeStateless callStateless call, plus read-only contextStateless commandLong-running, negotiated, stateful
Context costOnly tools you sendAll of a server's tool definitions unless deferredFew definitionsAgent description only

Read the table as questions. How many consumers need this? Do the owners change together? Where should authentication, logging and allowlisting live so that they are enforced once? Is the other end a function or an agent that will reason about my request? A single-app, single-function need rarely justifies a server; a capability shared by several hosts with central auth usually does; a partner's autonomous planner is an A2A case.

Key concept: tools are called, agents are asked

If the other side will do a stateless lookup or action with a fixed contract, it is a tool (direct, CLI or MCP). If it will interpret an intent, plan, ask clarifying questions and take multiple turns, it is an agent, and that is where A2A fits. MCP and A2A layer rather than compete: an agent can serve other agents over A2A while using MCP servers for its own tools.

Build versus use, and the trust cost of MCP

For standard integrations (issue trackers, source control, chat, document stores) evaluate maintained servers before writing your own; build custom only for workflows those servers cannot handle, for business logic that must live in the tool layer, or for proprietary internal systems. That pragmatic default is common in exam scenarios, but it comes with a duty of care: a third-party server is code that holds credentials and returns content the model will read. Claude Code's docs warn to verify trust before connecting servers that fetch external content. In practice: review the tools it exposes and the credentials it needs, pin versions, scope it narrowly (local, project or user scope; .mcp.json for the project, with ${VAR} expansion so tokens stay out of the file), restrict it with organisation allowlists and toolset configuration (Lesson 1.1), and treat its tool results as untrusted input (Lesson 1.2).

Two more MCP design points. Resources can expose read-only context such as schemas or document indexes so the agent does not burn calls exploring, though the Messages API connector does not surface them. And tool descriptions matter as much as for direct tools (Lesson 1.1): write them to say what the tool does, when to use it and what it returns. Claude Code truncates MCP tool descriptions and server instructions at 2KB each, so put the critical details first. Large MCP catalogues carry token cost; Lesson 1.8 covers loading them on demand.

Common exam distractor

Beware slogans. "Use MCP for everything" adds a hop and definition overhead for a single in-process function. "A2A replaces MCP" misreads two complementary layers. "MCP is secure because it is a standard" ignores server trust and token handling. "A shell wrapper is simplest" hides an audit and permission gap. "Always build a custom server" ignores maintained ones. And "the connector reaches my local server" is false: it needs a remote HTTP endpoint.

Exam traps

Practice question

Four internal products, plus the engineering team's Claude Code setup, all need the same inventory-availability lookup. The inventory API requires the corporate identity provider's OAuth, security wants one place to log calls and restrict which operations agents may use, and the lookup is a stateless request with a fixed response shape. Which integration mechanism fits best?

  • A Each product team writes its own direct tool definition and executor for the inventory API, sharing a code template so the tools stay consistent

    This works for one app but duplicates authentication, logging and allowlisting in four places, so governance is enforced inconsistently and every API change is repeated.

  • B One remote MCP server fronting the inventory API with OAuth, a fixed tool set and central logging, consumed by the products and by Claude Code Correct

    Shared consumers and central auth, audit and allowlisting are exactly the reuse and governance case MCP addresses, and the stateless fixed-shape lookup is a tool, not an agent conversation.

  • C Expose the inventory service as an A2A agent and have each product delegate the lookup to it, so calls are governed at the agent boundary

    A stateless lookup with a fixed contract does not need an autonomous, multi-turn agent. A2A adds negotiation and state that this use case does not require.

  • D Give the agents a shell tool and a shared script that calls the inventory API with one service key, kept in a single repository for easy review

    It weakens governance: broad shell access, a shared credential that hides who called, and no central enforcement of which operations are permitted.

Build exercise: Choose and document integration mechanisms for three capabilities

Intermediate · 75 minutes

You'll practice:

  1. Define three capabilities and their consumers: (1) an inventory lookup shared by several hosts, (2) an in-process document-merging function used by one app, (3) a partner logistics agent that negotiates delivery windows. State for each whether it is stateless, who owns it and who consumes it.

    The mechanism follows from consumers, ownership and interaction shape, so those facts must be written down before choosing.

    You should see: A three-row table with columns: capability, consumers, owner, stateless or stateful, latency sensitivity, auth needs.

    Hints
    1. Which of the three would still be needed if you added a second consuming application?
    2. Fill the table honestly, including who changes the capability and how often. Note whether the other side reasons about requests.
    3. Example: inventory lookup | 4 apps + Claude Code | inventory team | stateless | moderate | corporate OAuth. Merge function | 1 app | same team | stateless | high | none. Partner agent | our coordinator | partner | stateful, multi-turn | low | cross-org.
  2. Score each capability against direct tool, CLI, MCP and A2A on the criteria in the lesson (consumers, coupling, governance, latency, interaction shape, context cost) and pick one primary mechanism each.

    Scoring forces you to justify the choice by criteria instead of habit, and it exposes where two options are close.

    You should see: A scoring grid with a chosen mechanism and a one-sentence reason per capability.

    Hints
    1. Where did the winner lose points, and is that acceptable?
    2. Use 1 to 3 per cell. Expect: inventory to MCP, merge function to direct tool, partner agent to A2A. Write the weakest cell for each winner.
    3. Example reason: inventory lookup -> MCP because four consumers need central OAuth, audit and an operation allowlist; accepted cost is an extra network hop and the server's tool definitions in context.
  3. For the MCP choice, write the consumption config twice: a Messages API connector fragment with an allowlist, and a Claude Code project-scope .mcp.json using environment variable expansion for the token. State which of the two can reach a local stdio server.

    The two consumption paths have different capabilities and limits, and exam scenarios test whether you know them.

    You should see: Two JSON fragments and a sentence explaining that the connector needs a remote HTTP endpoint and supports only tools.

    Hints
    1. Which fragment keeps the token out of version control, and how?
    2. The connector uses mcp_servers plus an mcp_toolset with default_config.enabled false and named tools enabled. The .mcp.json uses ${INVENTORY_TOKEN} in a header.
    3. {"mcp_servers":[{"type":"url","url":"https://inventory-mcp.example.com/mcp","name":"inventory","authorization_token":"<from your secret store>"}],"tools":[{"type":"mcp_toolset","mcp_server_name":"inventory","default_config":{"enabled":false},"configs":{"check_availability":{"enabled":true}}}]}
      Project .mcp.json: {"mcpServers":{"inventory":{"type":"http","url":"https://inventory-mcp.example.com/mcp","headers":{"Authorization":"Bearer ${INVENTORY_TOKEN}"}}}}
      The connector needs the beta header mcp-client-2025-11-20 and a remote HTTPS server.
  4. Suppose a maintained community MCP server exists for a SaaS tool your team wants. Write the vetting checklist you would apply before connecting it, and the configuration constraints you would put around it.

    Choosing 'use rather than build' is only defensible if you also control the supply-chain and prompt-injection risks that come with third-party servers.

    You should see: A checklist of at least six items and a short list of constraints (scope, allowlist, pinned version, credential scope).

    Hints
    1. What can this server do with the credential you give it, and what content can it inject into the model's context?
    2. Include: list its tools and read the code or source, minimum credential scope, pin the version, restrict to needed tools, run with least privilege or in a sandbox, treat outputs as untrusted, and add it via project scope with review.
    3. Checklist example: 1) tools it exposes reviewed, 2) token scoped to read-only where possible, 3) version pinned, 4) unneeded tools disabled, 5) egress limited, 6) results treated as untrusted, 7) reviewed on each upgrade, 8) listed in the organisation allowlist.
  5. Write the decision record for the inventory capability: context, options considered, decision, consequences, and exit criteria that would make you revisit it.

    A decision record is how you defend and later revisit the choice. Exit criteria stop the decision from becoming dogma.

    You should see: A half-page record naming the rejected alternatives and at least three re-evaluation triggers.

    Hints
    1. What would have to change for a direct tool to become the better choice?
    2. Consider consumer count falling to one, latency requirements tightening, tool-definition overhead growing (see Lesson 1.8), or a new MCP specification revision changing the contract.
    3. Example triggers: only one consumer remains; measured server-hop latency breaks the SLO; the server's tool count pushes definitions past the point where deferred loading is needed; the MCP revision changes auth or transport behaviour.

Sources