Claude Agent SDK vs Claude Code vs the Claude API vs MCP: what each one is for
Ask one question: who runs the agent loop? With the Claude API you write the loop yourself. The Claude Agent SDK runs Claude Code's loop for you, inside your own app. Claude Code is that agent, ready to use in your terminal or editor. MCP is not an agent at all: it is the open standard that plugs tools and data into all of them.
The one question: who runs the agent loop?
An agent works in a loop. Claude reads the task and asks for a tool, such as looking up an order. The tool runs, the result goes back to Claude, and Claude decides what to do next, until the job is done. The four names differ in who runs that loop, which is why they are so easy to mix up and why the Claude Certified Architect exam tests them as a set.
| Claude API | Claude Agent SDK | Claude Code | MCP | |
|---|---|---|---|---|
| What it is | The Messages API, called from your code | Claude Code's agent as a library | The agent, ready to use | An open protocol |
| Who runs the loop | You | The SDK, inside your app | Claude Code | Nobody: it is not an agent |
| Where it runs | Any language, via the client SDKs | Python and TypeScript | Terminal, IDE, desktop app, browser | Between any AI app and a server |
| Reach for it when | You want full control of every step | You build your own agent product | You work on code or automate CI | You connect tools and data once for every app |
| Exam domain | 1 (loops) and 4 (structured output) | 1 (27%) | 3 (20%) | 2 (18%) |
Claude API: you run the loop
With the Messages API you send messages and Claude returns one answer. When Claude wants a tool you defined, the response stops with stop_reason: "tool_use" and carries a tool_use block. Your code executes the tool and sends the result back in the next request as a tool_result. Repeat until the stop reason says Claude is done.
That is all the API does with tools you define: you write the loop, so you control every step, every retry and every limit. The client SDKs (Python, TypeScript, Java, Go, C#, PHP, Ruby) are the convenient way to call it. Server tools such as web search are the exception: Anthropic runs those and returns the result in the same response.
Claude Agent SDK: the loop runs for you
The Agent SDK gives you "the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript", in the words of its docs. You give it a task, the tools it may use and the rules, and it keeps going until the job is done.
It comes with built-in tools to read, write and edit files, run commands and search the web, plus hooks (your code at key points of the loop), subagents, permissions, sessions you can resume or fork, and MCP. It also loads skills, commands and CLAUDE.md the way Claude Code does. Reach for it when you build your own agent inside your own application: a support agent for your customers, a research assistant, an internal ops bot.
Claude Code: the agent, ready to use
Claude Code is "an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools". You use it in the terminal, in VS Code or JetBrains, in the desktop app or in the browser, and every surface runs the same engine.
You shape it with a CLAUDE.md file, slash commands, skills and hooks, and connect it to MCP servers. In a CI pipeline you run it non-interactively with the -p (print) flag, so it never stops to wait for input. Reach for it when the job is working on code: features, fixes, reviews, test generation.
MCP: the plug for tools and data
The Model Context Protocol "is an open-source standard for connecting AI applications to external systems". Its docs compare it to a USB-C port: build a server once, and any app that speaks MCP can plug it in. A server can expose tools (actions, like looking up a customer) and resources (content to read, like a catalog of documents).
MCP does not compete with the other three. Claude Code and the Agent SDK connect to MCP servers, and the Messages API can reach remote MCP servers through its MCP connector.
Skills vs CLAUDE.md: on demand vs always on
A fifth name comes up next to these four. A skill is a folder with a SKILL.md file holding instructions for one kind of task. Claude sees a short description of every skill and loads the full instructions only when it needs them, or when you type /skill-name. CLAUDE.md is read at the start of every session.
So: a task-specific workflow belongs in a skill, a standard that applies to everything belongs in CLAUDE.md. The exam guide lists exactly this choice under task statement 3.2.
The exam trap: building an agent vs using one
A team wants its own support agent inside its own product, and one answer says "use Claude Code". It sounds right, since Claude Code is an agent. But Claude Code is a finished tool for working on code; to build your own agent in your own app, the answer is the Agent SDK.
It works the other way round too. A team that only wants automatic reviews on its pull requests does not need to build an agent: Claude Code in CI with -p already does it. Building an agent points to the Agent SDK; using one points to Claude Code.
What's new since the exam guide
The official comparison now lists two more options. The client SDKs have a tool runner (in beta) that can drive the loop over your own tools, and Managed Agents lets Anthropic host the agent loop for you, in a managed or self-hosted sandbox. Neither appears in the exam guide, which is built on the four above, so on the exam, think in four.
Watch it in five minutes
This article goes with video 3 of the free CCAR-F playlist. Start with the Claude Certified Architect study plan for the whole exam, or browse all articles.
Sources: Claude Agent SDK overview (comparison table and capabilities); Claude Code overview; Tool use with Claude; What is MCP; MCP connector; Skills; Claude Certified Architect Foundations exam guide v1.0 (sections 1 and 6).
FAQ
What is the difference between the Claude Agent SDK and Claude Code?
Claude Code is a finished agentic coding tool you use in a terminal, editor, desktop app or browser. The Agent SDK gives you the same tools, agent loop and context management as a library for Python and TypeScript, so you can build your own agent inside your own application.
Do I need the Agent SDK to use tools with the Claude API?
No. The Messages API supports tool use directly: Claude answers with stop_reason tool_use, your code runs the tool and sends back a tool_result. The Agent SDK saves you from writing that loop and adds built-in tools, hooks, permissions and sessions.
Is MCP an alternative to the Agent SDK?
No. MCP is a protocol for connecting AI applications to tools and data. Claude Code, the Agent SDK and the Messages API (through the MCP connector) can all connect to MCP servers.
What are Claude skills compared with CLAUDE.md?
A skill is a folder with a SKILL.md file whose full instructions load only when needed or when you call it with a slash. CLAUDE.md is read at the start of every session. Skills are on demand, CLAUDE.md is always on.