Study guide
10.3 MCP Architecture & Core Primitives
Claude Certified Developer - Foundations CCDV-F
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Core Messages API & Streaming
1.1 Messages API Fundamentals & Request Lifecycle 1.2 Streaming & Server-Sent Events (SSE) 1.3 Thinking: Adaptive Mode, Effort & Reasoning Budgets
2 Chapter 2: Optimization & Asynchronous Batches
2.1 Prompt Caching Mechanics & Breakpoints 2.2 Message Batches API & Asynchronous Workloads
3 Chapter 3: Structured Outputs, Documents & Files API
3.1 Structured Outputs & JSON Extraction 3.2 Files API, Document Blocks & Citations
4 Chapter 4: Application Design, Resilience & Delivery Life Cycle
4.1 API Resilience, Error Handling & Retries 4.2 Production Backend Architecture & State Management 4.3 Requirements Analysis & Claude Application Design 4.4 The Claude Application Life Cycle & Configuration Management
5 Chapter 5: LLM Fundamentals, Model Selection & Versioning
5.1 LLM & Technical Fundamentals: Tokens, Context Windows & Sampling 5.2 Claude Model Family Selection 5.3 Model Versioning, Snapshot Pinning & Migration 5.4 Latency & Throughput Optimization
6 Chapter 6: Cost Engineering & Context Management
6.1 Production Cost Optimization Strategies 6.2 Context Window Management & Compaction
7 Chapter 7: Foundations of Workflows & Deterministic Patterns
7.1 Agent vs. Workflow Architectural Foundations 7.2 Workflow Patterns: Prompt Chaining & Routing 7.3 Workflow Patterns: Parallelization & Voting
8 Chapter 8: Autonomous Agents & Multi-Step Systems
8.1 Workflow Patterns: Orchestrator-Workers & Evaluator-Optimizer 8.2 Agent Loop Implementation & State Tracking 8.3 Agent Frameworks & Human-in-the-Loop (HITL)
9 Chapter 9: Prompt and Context Engineering
9.1 System Prompt Design & Role Framing 9.2 XML Tags & Structural Prompt Delimiters 9.3 Few-Shot Prompting & In-Context Learning 9.4 RAG Context Injection & Document Formatting
10 Chapter 10: Tool Calling & Model Context Protocol (MCP)
10.1 Tool Schema Design & Parameter Validation 10.2 Tool Execution, Multi-Tool Calls & Error Handling 10.3 MCP Architecture & Core Primitives 10.4 MCP Transports & Client/Server Integration 10.5 Agentic Customization: Built-in Tools, Custom Tools, Skills & MCP
11 Chapter 11: Security, Safety & Governance
11.1 Direct & Indirect Prompt Injection Defenses 11.2 Tool Permissions, Sandboxing & Least Privilege 11.3 Data Privacy, Redaction & Audit Logging 11.4 Identity, Secrets & API Key Management
12 Chapter 12: Claude Code Developer Tooling
12.1 Claude Code Architecture & Project Configuration 12.2 Permissions, Modes & Hooks
13 Chapter 13: Evaluation, Testing & Production Observability
13.1 Evaluation Design & Golden Datasets 13.2 Production Observability, Tracing & Debugging
10.3 MCP Architecture & Core Primitives
Key Takeaways Explain This Topic AI
The Model Context Protocol (MCP) is an open, standardized protocol that replaces fragile, proprietary point-to-point integrations with a universal client-server architecture connecting AI models to enterprise tools and data sources.
Built on JSON-RPC 2.0, MCP exchanges requests, responses, and notifications; in the current revision (2026-07-28) clients send the requests, and servers deliver change notifications over an opted-in subscriptions/listen stream instead of initiating requests of their own.
MCP defines three foundational primitives: Tools (model-controlled executable functions with side effects), Resources (application-controlled read-only context identified by URIs), and Prompts (user-controlled interactive workflow templates).
The MCP architecture cleanly decouples responsibilities across three actors: MCP Hosts (orchestration runtimes like Claude Desktop or custom agents), MCP Clients (protocol connection managers), and MCP Servers (lightweight providers of tools and data).
In the current MCP revision (2026-07-28) there is no initialize handshake: every request carries its protocol version and client capabilities in _meta, and servers advertise versions and capabilities through the mandatory server/discover RPC; the initialize / notifications/initialized handshake is the lifecycle of revisions 2025-11-25 and earlier.
Last updated: October 2026
MCP Architecture & Core Primitives
Exam Blueprint Focus: The Model Context Protocol (MCP) represents Anthropic's open standard for connecting AI models to external tools, databases, and contextual data. The CCDV-F exam requires deep architectural understanding of why MCP was created, its underlying JSON-RPC 2.0 messaging protocol, the three core primitives (Tools, Resources, Prompts), how versions and capabilities are declared (per request in the current 2026-07-28 revision; through the initialize handshake in 2025-11-25 and earlier), and the operational boundaries between MCP Hosts, Clients, and Servers.
The Integration Challenge & The Model Context Protocol
Prior to the introduction of MCP, enterprise AI developers faced an unsustainable M × N M \times N M × N integration crisis :
There are M M M different AI models, runtime environments, and developer frontends (Claude Desktop, Claude Code, custom internal agents, IDE extensions, web chat interfaces).
There are N N N different enterprise data sources, development tools, and business APIs (PostgreSQL databases, GitHub repositories, Slack workspaces, Jira trackers, local file systems, internal REST services).
Without a universal standard, connecting every host to every data source required writing M × N M \times N M × N bespoke, proprietary adapters. Each adapter had its own error handling, authentication scheme, schema definition, and security model. Maintenance costs scaled quadratically, and adding a new tool required rewriting code across every application. THE FRAGMENTED M x N CRISIS: THE STANDARDIZED MCP ARCHITECTURE:
- [ Claude Desktop ] [ Custom Agent ] [ Claude Desktop ] [ Custom Agent ]
- \ / \ / \ /
- \ / \ / \ /
- [ Bespoke ] [ Custom Glue ] v v
- [ Plugins ] [ Code / REST ] +--------------------------+
- / \ / \ | MCP CLIENT |
- / \ / \ +--------------------------+
- [ Postgres ] [ GitHub ] [ Slack ] | (JSON-RPC 2.0)
- v
- +--------------------------+
- | MCP SERVERS |
- | [Postgres] [GitHub] [FS] |
- +--------------------------+
In late 2024, Anthropic open-sourced the Model Context Protocol (MCP) to establish the "USB-C of AI connectivity." MCP is an open, vendor-neutral standard that standardizes how AI applications communicate with local and remote data stores and tools. By adopting MCP, developers write a single server for a data source (e.g., an MCP Postgres Server), and that server becomes immediately accessible to any MCP-compliant host application.
Protocol Foundation: JSON-RPC 2.0 Specification
MCP is built on top of the JSON-RPC 2.0 specification. JSON-RPC 2.0 provides a lightweight, stateless, language-agnostic, and transport-independent mechanism for executing remote procedure calls over bidirectional channels.
Message Types in MCP
MCP utilizes three standard JSON-RPC 2.0 message formats:
Requests: Messages expecting a response, which must include a unique id . In revision 2026-07-28, servers do not initiate JSON-RPC requests; when a server needs more input from the client, it returns an input_required result and the client retries the original request with the answers (the Multi Round-Trip Requests pattern): {
- "jsonrpc": "2.0",
- "id": 101,
- "method": "tools/call",
- "params": {
- "name": "query_database",
- "arguments": {"sql": "SELECT * FROM users LIMIT 5"}
- }
- }
Responses: Sent in reply to a request with a matching id . Contains either a result object or an error object: {
- "jsonrpc": "2.0",
- "id": 101,
- "result": {
- "content": [{"type": "text", "text": "[{\"id\": 1, \"name\": \"Alice\"}]"}]
- }
- }
Notifications: One-way messages that do not include an id . Notifications never receive a response and are used for progress updates and change events such as resource invalidation (in 2026-07-28, change notifications arrive on a subscriptions/listen stream the client opts into): {
- "jsonrpc": "2.0",
- "method": "notifications/resources/updated",
- "params": {
- "uri": "file:///workspace/project/schema.sql"
- }
- }
- Version and Capability Declaration
Current revision (2026-07-28): stateless, no handshake. The specification removed the initialize / notifications/initialized handshake. Instead:
Every request carries its protocol version and client capabilities in _meta ( io.modelcontextprotocol/protocolVersion , io.modelcontextprotocol/clientCapabilities ); clients should also identify themselves on each request, and servers in each result.
server/discover is a mandatory server RPC that returns supported protocol versions, capabilities, and identity. Clients may call it first for up-front version selection, or simply send requests and handle a version error.
The server accepts or rejects each request independently; a version mismatch returns an UnsupportedProtocolVersion error listing the versions it supports.
Earlier revisions (2025-11-25 and before): the initialization handshake. The exam guide (v1.0, July 2026) predates the change, and many deployed servers still use this lifecycle, so know it too:
initialize Request: The client declares its protocol version, client metadata, and capabilities (e.g., roots , sampling ).
initialize Response: The server responds with its protocol version, server metadata, and capabilities (e.g., tools: {listChanged: true} , resources: {subscribe: true} , prompts: {listChanged: true} ).
notifications/initialized Notification: The client confirms the handshake is complete; only then do standard RPC calls proceed.
The 2026-07-28 specification documents backward compatibility with these handshake-based revisions.
The Three Core MCP Primitives
MCP structures all context and functionality into three foundational primitives , each calibrated for a distinct operational role and control plane:
1. Tools: Model-Controlled Actions
Definition: Executable functions that allow Claude to perform computations, trigger business logic, or mutate external systems.
Control Plane: Model-controlled . Claude determines autonomously whether and when to invoke tools based on user instructions and registered schemas.
Side Effects: Tools are explicitly permitted and expected to have side effects (e.g., writing records to a database, deploying a container, sending a Slack message).
Protocol Methods:
tools/list : Discovers available tools and their JSON Schema parameter definitions.
tools/call : Executes a tool with specific arguments.
notifications/tools/list_changed : Server notifies client that tools were added or updated.
2. Resources: Application-Controlled Contextual Data
Definition: Read-only data sources that provide passive background context, ground-truth data, or system state to the AI model.
Control Plane: Application-controlled . The host application or end user decides which resources to read and attach into the model's prompt. The model does not autonomously fetch resources without host orchestration.
Addressing Scheme: Resources are addressed via standardized URIs (Uniform Resource Identifiers) , such as file:///workspace/src/index.ts , postgres://cluster/prod/orders/schema , or github://repos/org/repo/issues/42 .
Side Effects: Strictly read-only and idempotent . Reading a resource must never alter system state.
Content Payloads: Can return UTF-8 text or base64-encoded blob data (for binary assets like PDFs, images, or audio).
Dynamic Templates & Subscriptions: Servers can expose dynamic URI patterns via resources/templates/list (e.g., git://repo/{branch}/commit/{hash} ). In revision 2026-07-28, clients receive resource change notifications by opting in on a subscriptions/listen stream ( resourceSubscriptions ); resources/subscribe / resources/unsubscribe were the mechanism in 2025-11-25 and earlier.
3. Prompts: User-Controlled Interactive Workflows
Definition: Pre-configured prompt templates, slash commands, and guided multi-turn interaction patterns exposed by the server.
Control Plane: User-controlled . Prompts are surfaced in the client UI for the end user to select (such as typing /code-review or /generate-api-client in Claude Desktop).
Arguments & Messages: Prompts accept user arguments and return a structured array of prompt messages ( role: "user" or role: "assistant" ) pre-populated with context and resource references.
Protocol Methods:
prompts/list : Discovers available prompt templates and required argument schemas.
prompts/get : Renders the specified prompt with user-supplied arguments.
notifications/prompts/list_changed : Server notifies client of template updates.
Comprehensive Comparison: Tools vs Resources vs Prompts
Architectural Dimension Tools Resources Prompts
Primary Control Plane Model-Controlled (LLM decides when to execute) Application-Controlled (Host/App attaches to context) User-Controlled (End user selects via UI/slash command)
Primary Function Execute functions, perform compute, mutate state Provide read-only ground-truth data and documents Provide structured workflow templates and guidance
Side Effects Permitted Yes (State mutations, external API writes) No (Strictly read-only and idempotent) No (Template rendering only)
Addressing Mechanism Unique tool name ( name: "query_db" ) Standardized URI ( file:///... , postgres://... ) Prompt name ( name: "debug_pipeline" )
Dynamic Arguments JSON Schema object arguments Dynamic URI templates ( {param} ) Declared argument list with defaults
Core Protocol Methods tools/list , tools/call resources/list , resources/read prompts/list , prompts/get
Real-Time Notifications notifications/tools/list_changed notifications/resources/updated notifications/prompts/list_changed
Client-Server Architectural Topology
MCP establishes a strict separation of concerns across three distinct entities: +-------------------------------------------------------------------------+
- | MCP HOST |
- | (Claude Desktop, Claude Code CLI, Custom Agent Runtime, IDE Extension) |
- | |
- | - Orchestrates conversation turns and user interface |
- | - Manages LLM inference (Anthropic Messages API calls) |
- | - Enforces user security policies & confirmation prompts |
- | |
- | +---------------------------------------------------------------+ |
- | | MCP CLIENT | |
- | | - Manages 1:1 connection to an MCP Server | |
- | | - Handles JSON-RPC 2.0 serialization/deserialization | |
- | | - Routes requests and receives event notifications | |
- | +---------------+-------------------------------+---------------+ |
- +--------------------|-------------------------------|--------------------+
- | (Transport: Stdio) | (Transport: Streamable HTTP)
- v v
- +--------------------------+ +--------------------------+
- | LOCAL MCP SERVER | | REMOTE MCP SERVER |
- | (Filesystem, Local Git) | | (Postgres Cloud, Slack) |
- +--------------------------+ +--------------------------+
MCP Host: The outer user-facing application (e.g., Claude Desktop, Cursor, Claude Code, or an enterprise agent platform). The host coordinates the overall workflow, presents the UI, stores conversation history, holds API keys for the LLM, and prompts human users for confirmation before executing state-mutating actions.
MCP Client: The protocol adapter maintained by the host. A host instantiates one MCP Client per connected MCP Server. The client declares the protocol version and capabilities on each request (or runs the initialization handshake with servers on older revisions), serializes JSON-RPC messages, and dispatches requests.
MCP Server: A lightweight, decoupled service that exposes specific capabilities. A server specializes in a single domain (e.g., a GitHub MCP Server exposes GitHub repositories and issue tools). MCP Servers have no direct relationship with the LLM ; they simply respond to JSON-RPC requests from the MCP Client.
Security Boundaries & Permission Models
Because MCP Tools can perform arbitrary operations (including deleting files, altering databases, or transferring funds), security boundaries matter:
Human-in-the-Loop Verification: The specification says that, for trust & safety and security, there SHOULD always be a human in the loop with the ability to deny tool invocations. In practice, hosts present confirmation prompts for sensitive tools: when Claude emits a tools/call for a destructive tool, the host pauses and shows the exact arguments to the human for approval. (SHOULD is a strong recommendation, not a protocol-enforced MUST, so the host is responsible for implementing it.)
Root Scoping: Roots let a client tell filesystem servers which directories they may work in. Roots are deprecated as of revision 2026-07-28 ; the suggested migration is to pass directories or files via tool parameters or resource URIs.
Sampling: Sampling ( sampling/createMessage ) let an MCP server ask the host to run an LLM completion on its behalf, keeping billing, model choice, and guardrails under the host's control. Sampling is deprecated as of revision 2026-07-28 (it remains functional during the deprecation window, but new implementations should not add it), and server-initiated requests such as sampling/createMessage , roots/list , and elicitation/create are replaced by the Multi Round-Trip Requests pattern.
Exam Watchouts & Common Anti-Patterns
Conflating Tools and Resources: Remember that Resources are passive and read-only; Tools are active and can produce side effects. Passing a database update function as a Resource violates MCP architecture.
Assuming MCP Servers Call Claude: MCP Servers do not call the Anthropic API to generate completions for the user. The Host calls the Anthropic API; the server merely executes local RPC requests.
Mixing up revision lifecycles: On revision 2026-07-28, each request must carry its protocol version (and client capabilities) in _meta ; there is no handshake to perform. On servers using 2025-11-25 or earlier, a custom client that skips the notifications/initialized notification leaves the server uninitialized, causing subsequent requests to be rejected.