Claude Academy
Sign in

Model Context Protocol (MCP) Overview

MCP is the open protocol that connects Claude (or any compatible LLM client) to external systems — file systems, databases, APIs, your internal tools. Released by Anthropic in late 2024; now adopted broadly.

Think of it as USB-C for LLMs: standardize the connector, let any tool plug into any client.

The two layers

MCP separates what from how:

  • Data layer (inner) — JSON-RPC 2.0 protocol: lifecycle, primitives, notifications.
  • Transport layer (outer) — stdio or Streamable HTTP, with auth.

Same JSON-RPC message format across all transports.

Server primitives (what the server offers)

  1. Tools — actions the model can invoke. Side effects expected. model-controlled.
  2. Resources — read-only data identified by URIs (file://..., postgres://...). application-controlled.
  3. Prompts — parameterized templates. user-controlled.

Discovery + invocation methods follow a pattern: */list, */get/*/read, tools/call.

Client primitives (what the server can ask of the client)

  • Sampling (sampling/createMessage) — server asks client to run an LLM call. Keeps server model-independent.
  • Elicitation (elicitation/create) — server asks user for input / confirmation.
  • Logging — server sends log messages to client.

Who decides each primitive runs

PrimitiveDecided bySurfaced as
ToolsModelTool calls during conversation
ResourcesApplication / hostAttached context, picker UI
PromptsUserSlash command menu

This "who decides" mapping is a frequent exam question.

Architecture

flowchart TB
    subgraph Host["MCP Host (AI Application)"]
        C1[MCP Client 1]
        C2[MCP Client 2]
        C3[MCP Client 3]
        C4[MCP Client 4]
    end
    SA["MCP Server A (local)<br/>e.g. Filesystem"]
    SB["MCP Server B (local)<br/>e.g. Database"]
    SC["MCP Server C (remote)<br/>e.g. Sentry"]
    C1 -- "dedicated connection" --> SA
    C2 -- "dedicated connection" --> SB
    C3 -- "dedicated connection" --> SC
    C4 -- "dedicated connection" --> SC

A host can run many MCP clients simultaneously, each connected to a different server. The same server can have multiple clients (different tabs of VS Code, e.g.).

"Local" vs "remote" is determined by transport, not where code runs:

  • stdio = local subprocess (filesystem server).
  • Streamable HTTP = remote service (Sentry MCP server).

Why MCP vs raw tool use

AspectRaw API tool useMCP
Where the tool livesIn your app codeIn a separate server (your own or third-party)
ReusabilityPer-appPlug into any MCP-aware client
DiscoveryHardcodedServer advertises capabilities
Trust modelApp developer controlsExplicit user consent + scopes
EcosystemNoneGrowing registry (Slack, Linear, Postgres, etc.)

Lifecycle

sequenceDiagram
    participant C as MCP Client
    participant S as MCP Server
    C->>S: initialize (protocolVersion, capabilities, clientInfo)
    S-->>C: result (serverInfo, capabilities)
    C->>S: notifications/initialized
    Note over C,S: Ready to operate
    C->>S: tools/list
    S-->>C: tools[]
    C->>S: tools/call (name, arguments)
    S-->>C: content[]
    S->>C: notifications/tools/list_changed
    C->>S: tools/list (refresh)
    S-->>C: tools[]
  1. Initialize — client and server negotiate protocol version + capabilities.
  2. Ready — client sends notifications/initialized.
  3. List capabilitiestools/list, resources/list, prompts/list.
  4. Usetools/call, resources/read, prompts/get.
  5. Notifications — either direction (e.g., notifications/tools/list_changed).
  6. Shutdown.

Notifications only flow if the corresponding capability was declared at init (e.g., tools: {listChanged: true}).

See also