CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 3 · Lesson 18/38

    Choosing between MCP, direct tools and agent-to-agent integration

    Evaluate connection protocols and select the appropriate integration mechanism

    22 min read
    2.38% of exam
    9 sources
    Published 19 Oct 2026
    Docs as of 14 Oct 2026

    What you will be able to do

    • Choose between a direct tool or CLI call, an MCP server and a hand-off to another agent for reaching a given system
    • Explain what MCP standardises, including its three primitives and its stdio and Streamable HTTP transports
    • Attach an MCP server in Claude Code, in the Agent SDK and through the Messages API MCP connector, and know the limits of each
    • Choose the Claude surface (Claude Code CLI, Agent SDK, Client SDK, Managed Agents) that fits a given workflow
    • Recognise when agent-to-agent delegation fits better than a tool or MCP server, and what a delegated agent receives and returns

    Key concept

    MCP server as a shared integration point — An MCP server exposes tools, resources and prompts through one protocol, so the same server can be plugged into any MCP client (Claude Code, the Agent SDK, the Messages API connector) without rewriting the integration for each. Choosing an integration mechanism mostly comes down to whether that reuse is worth running a separate server for.

    1.Three ways to connect Claude to a system

    Each time Claude needs to reach an outside system, such as a database, an issue tracker or a build server, the architect picks one of three mechanisms: a tool your application defines and runs, an MCP server, or another agent that owns that system. All three can get the job done. They differ in who maintains the integration, how many clients can reuse it, and how much judgement sits on the other side.

    Direct tool use is the shortest path. Your application defines a tool with an input_schema, Claude returns a tool_use block, your code runs the operation and returns a tool_result. Where that code runs is covered in Who executes tools: client tools versus server tools. As an integration choice, it wins when one application owns one system and you control the schema. A CLI belongs here too: Anthropic publishes a bash tool schema, but your application still runs each command. The cost is that this integration lives inside your application. A second client, say a developer's Claude Code session, cannot reuse it.

    An MCP server moves the integration out of your application and puts it behind a protocol. One server can then serve any MCP client, and one client can combine several servers. Each server sees only what it needs, because the full conversation stays with the host. MCP wins when the same capability has to be reachable from more than one surface, or when the vendor of the system already ships an MCP server you can attach rather than build.

    Agent-to-agent hand-off is the right choice when the system needs its own judgement, not just a function call: a security review, a test-writing pass, a domain specialist with its own system prompt and toolset. The calling agent delegates the task and reads back what the specialist reports, instead of driving each step itself. How subagents, agent teams and workflows differ is taught in Subagents vs agent teams vs workflows across Managed Agents, Agent SDK and Claude Code.

    In Managed Agents the specialist is either a predefined agent listed in the multiagent block of the lead's definition, or an inline agent that the lead defines when it delegates. Each subagent works in its own session thread, so its working context stays out of the lead's. Delegation is one level deep: a specialist cannot hand work on to further agents. Pick this over a tool or an MCP server when the system must reason about the task, and expect the lead to receive a report rather than a raw result.

    Choosing the mechanism for one system
    MechanismWho maintains the integrationWins when
    Direct tool (your input_schema, your code)Your application, which runs each call and returns tool_resultOne application owns the system and you control the schema
    MCP serverA separate server any MCP client can attachThe same capability must be reachable from several clients, or a vendor server exists
    Another agentAn agent with its own model, system prompt, tools, MCP servers and skillsThe system needs its own reasoning and toolset, not a single call

    Checkpoint 1 of 9· Match them up

    An architect is connecting Claude to three outside systems. Match each situation to the integration mechanism that fits it best.

    Tap a term, then the definition that fits it.

    Sources123

    2.What MCP standardises: primitives and transports

    MCP standardises three kinds of things a server can expose, and each one is controlled by a different party. That split matters when you compare MCP with a plain tool definition, because a tool definition only covers the first row of the table below. Resources and prompts give a client context and templates that it, or the user, chooses to bring in.

    MCP server primitives and who controls them
    PrimitiveControlExample
    ToolsModel-controlledAPI POST requests, file writing
    ResourcesApplication-controlledFile contents, git history
    PromptsUser-controlledSlash commands, menu options

    Servers and clients also negotiate capabilities. A server has to declare tool support before tools can be invoked, and a client has to declare sampling support before a server can request it. This lets each side add features at its own pace. The protocol can also run in the other direction: in Claude Code, an MCP server can act as a channel that pushes Telegram messages, Discord chats or webhook events into a session. A tool that Claude calls directly can only answer when Claude asks.

    Two transports carry the protocol, and the choice between them decides which clients can reach a server. With stdio, the client launches the server as a subprocess and exchanges newline-delimited JSON-RPC messages over stdin and stdout. The server may log to stderr but must write nothing to stdout except valid MCP messages. Stdio is the transport behind the server that runs on a developer's laptop. With Streamable HTTP, the server is a remote endpoint. The client POSTs each JSON-RPC message to that endpoint, and the server answers with either one JSON object or an SSE stream. The client may also open a GET stream so the server can send messages without being asked.

    A remote server takes on duties a subprocess never has. It must validate the Origin header on every incoming connection to block DNS rebinding. When it runs locally it should bind to 127.0.0.1 rather than 0.0.0.0, and it should authenticate every connection. Turning a stdio server into a production HTTP service is therefore deployment work, not a configuration toggle.

    Checkpoint 2 of 9· Check yourself

    A team's MCP server runs over stdio on a developer's laptop. They now want a hosted production service to reach the same server over the network. What does this change involve?

    Sources4256

    3.Attaching an MCP server in Claude Code

    Claude Code is a full MCP client, so it can attach a server over any transport. The --transport flag names the transport. What you were given tells you which one: a URL such as https://mcp.example.com/mcp means the server is remote, and a launch command such as npx -y @example/mcp-server means it runs on your machine.

    Adding a remote server over Streamable HTTP, with and without a bearer tokenbash
    # Basic syntax
    claude mcp add --transport http <name> <url>
    
    # Real example: Connect to Notion
    claude mcp add --transport http notion https://mcp.notion.com/mcp
    
    # Example with Bearer token
    claude mcp add --transport http secure-api https://api.example.com/mcp \
      --header "Authorization: Bearer your-token"
    Adding a local stdio server: everything after -- is the command Claude Code launchesbash
    # Basic syntax
    claude mcp add [options] <name> -- <command> [args...]
    
    # Real example: Add Airtable server
    claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
      -- npx -y airtable-mcp-server

    Configuration copied from another client usually arrives as an mcpServers JSON block, and you can pass it to claude mcp add-json. One mistake comes up often: Claude Code reads an entry that has no type as a stdio server. An entry with a url but no "type": "http", "sse" or "ws" therefore fails. When you stop the session, Claude Code also stops each stdio server it launched. On macOS and Linux it sends SIGINT, then SIGTERM, then SIGKILL.

    Use claude mcp list, claude mcp get <name> and /mcp to see whether a server is connected, pending approval or disabled. A project-scoped server from .mcp.json stays pending until someone runs claude interactively and approves it. Headless runs (claude -p) are stricter still: only servers passed on the command line, for example with --mcp-config, connect.

    Checkpoint 3 of 9· Fill the gap

    This command attaches an Airtable MCP server, and Claude Code starts it on your own machine with npx. Which transport value belongs in the blank?

    claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport  ?  airtable \
      -- npx -y airtable-mcp-server

    Sources57

    4.Choosing the surface: Claude Code CLI, Agent SDK, Client SDK or Managed Agents

    Where you attach an MCP server depends on which surface runs the agent, so pick the surface first. The four options differ in who writes the agent loop and whether a person is watching while it runs.

    Claude surfaces and when each fits
    SurfaceWhat you getFits when
    Claude Code CLIThe terminal interface, built for daily interactive useA person chats, watches each step and approves risky commands as they come up
    Agent SDKA library that runs the Claude Code binary, with built-in tools, permissions, sessions and hooksYour Python or TypeScript process, such as a CI job, needs the agent loop without hand-written tool handling
    Client SDKDirect access to the Claude API; you write the tool loop yourself or use the beta tool runnerYou want full control of every request and tool_result
    Managed AgentsA hosted agent harness that runs the agent loop in an Anthropic-managed or self-hosted sandboxAnthropic should host the agent, configured through the Claude API

    The Client SDK and the Agent SDK sound alike, but they split the work differently. With the Client SDK your code checks stop_reason, runs each tool_use block and sends the results back, which is exactly the code a pipeline team wants to avoid writing. The Agent SDK already contains that loop, along with Read, Edit and Bash tools and a permission system that decides which tools run automatically and which need approval. For CI, the headless form claude -p "Find and fix the bug in auth.py" --allowedTools "Read,Edit,Bash" pre-approves the tools, so nobody has to answer prompts.

    Interactive approval is the deciding case for the CLI. An engineer debugging a failing build, who wants to see every file Claude opens and approve each risky command, needs the terminal session, with no integration code. An SDK script on a schedule has nobody watching. Managed Agents runs the session in a sandbox. The Messages API connector has no terminal at all.

    In the Agent SDK, MCP servers go in the mcpServers option of query(). Tools from a server get names of the form mcp__<server>__<tool>, which is what allowedTools matches against.

    Agent SDK: attaching a remote MCP server and pre-approving its toolstypescript
    import { query } from "@anthropic-ai/claude-agent-sdk";
    
    try {
      for await (const message of query({
        prompt: "Find and run the appropriate database query",
        options: {
          mcpServers: {
            "enterprise-tools": {
              // Connect to a remote MCP server
              type: "http",
              url: "https://tools.example.com/mcp"
            }
          },
          allowedTools: ["mcp__enterprise-tools__*"], // Wildcard pre-approves all tools from this server

    Checkpoint 4 of 9· Check yourself

    A team built a nightly pipeline on the Client SDK because they expected it to handle tools on its own. Their first request comes back with stop_reason "tool_use" and a tool_use block for one of their own tools. What happens next?

    Checkpoint 5 of 9· Exam question

    A platform team is building an automated CI pipeline step where Claude must read repository files, run test commands, and edit code across multiple iterations until tests pass, without the team writing custom logic to parse tool_use blocks and resubmit tool results. Which integration approach best fits this need?

    Checkpoint 6 of 9· Exam question

    An engineer wants to interactively debug a failing build by chatting with Claude in a terminal, watching each file it opens and approving risky commands ad hoc, without writing any integration code. Which option best matches this workflow?

    Sources87

    5.The Messages API MCP connector: remote servers only

    The MCP connector lets a Messages API request use a remote MCP server directly, without a separate MCP client. Anthropic's side makes the connection. That is also why its limits are strict. The server must be publicly reachable over HTTP, using Streamable HTTP or SSE, and its url must start with https://. The API has no process to launch a stdio server from, so the laptop server above has to be deployed before production can use it. Only tool calls are supported, so the server's resources and prompts are not available through this path.

    A request names the server and enables its tools in two separate places. The mcp_servers array holds connection details: type (currently only "url"), url, name and an optional OAuth authorization_token. The tools array holds an mcp_toolset that refers to that server by name. Each server name must be referenced by exactly one toolset. The toolset is also where you enable every tool, allowlist some or denylist others. One request can attach several servers. The connector sits behind a beta flag.

    Messages API request that attaches one remote MCP server and enables all its toolspython
    client = anthropic.Anthropic()
    
    response = client.beta.messages.create(
        model="claude-opus-5-5",
        max_tokens=1000,
        messages=[{"role": "user", "content": "What tools do you have available?"}],
        mcp_servers=[
            {
                "type": "url",
                "url": "https://example-server.modelcontextprotocol.io/sse",
                "name": "example-mcp",
                "authorization_token": "YOUR_TOKEN",
            }
        ],
        tools=[{"type": "mcp_toolset", "mcp_server_name": "example-mcp"}],
        betas=["mcp-client-2025-11-20"],
    )

    Rewriting the server's functions as client tools also connects the system, but it changes who does the work. Your backend would run every call and return each tool_result itself, so the query logic moves into the application and stops being a server other clients can share. Use the connector when the server can be exposed remotely and you want the API to handle the MCP round trip. Use client tools when the system must stay private to your backend.

    Where each surface can attach an MCP server
    SurfaceHow you attachTransports
    Claude Codeclaude mcp add, add-json, or --mcp-config for claude -pstdio, http, sse, ws
    Agent SDKmcpServers option of query()Local and remote, such as type: "http"
    Messages APImcp_servers plus an mcp_toolset in toolsStreamable HTTP or SSE over https:// only; tool calls only

    Checkpoint 7 of 9· Fill the gap

    In this Messages API request, mcp_servers only holds the connection details. Which type value in the tools array turns on the server's tools for Claude?

    client = anthropic.Anthropic()
    
    response = client.beta.messages.create(
        model="claude-opus-5-5",
        max_tokens=1000,
        messages=[{"role": "user", "content": "What tools do you have available?"}],
        mcp_servers=[
            {
                "type": "url",
                "url": "https://example-server.modelcontextprotocol.io/sse",
                "name": "example-mcp",
                "authorization_token": "YOUR_TOKEN",
            }
        ],
        tools=[{"type": " ? ", "mcp_server_name": "example-mcp"}],
        betas=["mcp-client-2025-11-20"],
    )

    Checkpoint 8 of 9· Exam question

    A fintech company wants Claude to call tools hosted on an internal Postgres query service. The service currently only exposes a local stdio-based MCP server used by developers on their laptops, but the production app needs Claude to invoke it directly from server-side Messages API calls without operating a separate MCP client process. What should the team do?

    Sources9

    6.When the system is better reached as another agent

    Some systems need a whole agent rather than a tool. A tool or an MCP server gives Claude one function at a time, and the calling agent still does all the reasoning. A predefined agent brings its own model, system prompt, tools, MCP servers and skills. Handing work to it means handing over the judgement, together with the integrations that judgement needs.

    Here is a concrete case. A lead agent needs code review and test writing. Attaching every review tool and test runner to the lead fills its context and blurs its instructions. Routing the work to a reviewer agent and a test-writer agent, each with a focused prompt and its own tools, keeps each concern self-contained. The same reasoning applies when the system is an MCP server that only a specialist needs: attach it to the specialist agent, not to the agent that coordinates the work.

    Two properties of this option affect its design. Agents in a Managed Agents session share the same sandbox, filesystem and vault credentials, so a hand-off does not isolate permissions. It isolates context, because each agent runs in its own session thread with its own history. A subagent's thread also persists, so the lead can send follow-ups to a specialist that keeps its earlier work. Choose an agent over an MCP server when the conversation with the system may take several turns, not one request and one result.

    Checkpoint 9 of 9· Check yourself

    Your security team suggests delegating secret-scanning to a separate reviewer agent in the same Managed Agents session, so that the reviewer is walled off from the lead agent's credentials. What does handing work to that reviewer actually isolate?

    Sources3

    Practise it for real

    Attach a remote MCP server to Claude Code and confirm its status

    1. 1.Run claude mcp add --transport http notion https://mcp.notion.com/mcp

      Why: A URL means the server is remote, so it needs the http transport rather than a launch command

      You should see: Claude Code saves a server named notion

    2. 2.Run claude mcp list, then claude mcp get notion

      Why: These show each configured server and its connection details without opening a session

      You should see: notion appears in the list, and get shows its details

    3. 3.Start claude and run /mcp

      Why: The /mcp panel shows each server's status from inside a session and is where you re-enable a disabled server

      You should see: The notion server appears with its status

    4. 4.Run claude mcp remove notion

      Why: Removes the server when you are done, leaving the configuration as it was

      You should see: notion no longer appears in claude mcp list

    Stuck? Get a nudge

    If a pasted JSON entry fails, check whether it has a url but no type. Claude Code reads that entry as stdio.

    Sources

    (9)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Your code executes the operation and sends back a tool_result.”
      ↩︎ Three ways to connect Claude to a system
      “Anthropic publishes the schema and trains Claude on it. Your application still executes each call and returns the tool_result.”
      ↩︎ Three ways to connect Claude to a system
      “For tools you define, you write the schema and your application executes each call.”
      ↩︎ Checkpoint
      “Claude responds with stop_reason: "tool_use" and one or more tool_use blocks. Your code executes the operation and sends back a tool_result.”
      ↩︎ Checkpoint
    2. 2.
      “Full conversation history stays with the host”
      ↩︎ Three ways to connect Claude to a system
      “Tool invocation requires the server to declare tool capabilities”
      ↩︎ What MCP standardises: primitives and transports
      “Multiple servers can be combined seamlessly Shared protocol enables interoperability”
      ↩︎ Key concept
    3. 3.
      “It uses its own configuration: model, system prompt, tools, MCP servers, and skills.”
      ↩︎ Three ways to connect Claude to a system
      “With subagents, it delegates tasks itself and reads what each subagent reports.”
      ↩︎ Three ways to connect Claude to a system
      “Delegation is one level deep, and a session can have at most 25 child threads at a time, idle ones included.”
      ↩︎ Three ways to connect Claude to a system
      “rather than loading a single agent with every capability”
      ↩︎ When the system is better reached as another agent
      “All agents share the same sandbox, filesystem, and vault credentials, but each agent runs in its own session thread”
      ↩︎ When the system is better reached as another agent
      “A subagent's thread stays available until you archive it, so the agent can send it follow-up messages.”
      ↩︎ When the system is better reached as another agent
      “Delegation is one level deep, and a session can have at most 25 child threads at a time, idle ones included.”
      ↩︎ Exam trap 5
      “All agents share the same sandbox, filesystem, and vault credentials, but each agent runs in its own session thread, a context-isolated event stream”
      ↩︎ Checkpoint
    4. 4.
      “Executable functions that allow models to perform actions or retrieve information”
      ↩︎ What MCP standardises: primitives and transports
    5. 5.
      “an MCP server can also act as a channel that pushes messages into your session”
      ↩︎ What MCP standardises: primitives and transports
      “A launch command such as npx -y @example/mcp-server: the server runs on your machine.”
      ↩︎ Attaching an MCP server in Claude Code
      “Claude Code reads an entry with no type as a stdio server, so a url entry without a type fails.”
      ↩︎ Attaching an MCP server in Claude Code
      “Claude Code reads an entry with no type as a stdio server, so a url entry without a type fails.”
      ↩︎ Exam trap 3
    6. 6.
      “The client launches the MCP server as a subprocess.”
      ↩︎ What MCP standardises: primitives and transports
      “The client MUST use HTTP POST to send JSON-RPC messages to the MCP endpoint.”
      ↩︎ What MCP standardises: primitives and transports
      “When running locally, servers SHOULD bind only to localhost (127.0.0.1) rather than all network interfaces (0.0.0.0)”
      ↩︎ What MCP standardises: primitives and transports
      “Servers MUST validate the Origin header on all incoming connections to prevent DNS rebinding attacks”
      ↩︎ Checkpoint
    7. 7.
      “MCP servers: only servers supplied on the command line connect, for example with --mcp-config.”
      ↩︎ Attaching an MCP server in Claude Code
    8. 8.
      “The terminal interface, built for daily interactive use.”
      ↩︎ Choosing the surface: Claude Code CLI, Agent SDK, Client SDK or Managed Agents
      “Control which tools run automatically, which need approval”
      ↩︎ Choosing the surface: Claude Code CLI, Agent SDK, Client SDK or Managed Agents
      “A library that runs the Claude Code binary, with Claude Code’s capabilities, such as built-in tools, permissions, sessions, and hooks.”
      ↩︎ Exam trap 4
      “Read, write, edit files, run commands, and search the web”
      ↩︎ Prediction
    9. 9.
      “connect to remote MCP servers directly from the Messages API without a separate MCP client”
      ↩︎ The Messages API MCP connector: remote servers only
      “Local STDIO servers cannot be connected directly.”
      ↩︎ The Messages API MCP connector: remote servers only
      “Must be referenced by exactly one MCPToolset in the tools array.”
      ↩︎ The Messages API MCP connector: remote servers only
      “The server must be publicly exposed through HTTP (supports both Streamable HTTP and SSE transports).”
      ↩︎ Exam trap 1
      “Of the feature set of the MCP specification, only tool calls are currently supported.”
      ↩︎ Exam trap 2

    Spotted a mistake, or was something unclear? Tell us.