Literature: MCP Architecture Overview
Source Metadata
- File:
https://modelcontextprotocol.io/docs/concepts/architecture - Origin: Anthropic Model Context Protocol Documentation
- Relevance: Canonical definition of the MCP layers, participants, and lifecycle.
High-Level Summary
The Model Context Protocol (MCP) is an open standard for connecting AI applications to external data sources and tools. It defines a clear separation between the Data Layer (JSON-RPC 2.0 primitives) and the Transport Layer (how messages are moved), giving host applications a common way to discover and invoke server capabilities.
Core Philosophical Goal
MCP reduces the integration tax of connecting LLMs to the world. Instead of writing custom API integration code for every tool, developers build to the MCP standard once, allowing compatible AI clients to interact with that tool through a shared protocol surface.
Core Concepts
Participants
- MCP Host: The AI application (like Claude Desktop or an IDE) that initiates and orchestrates connections.
- MCP Client: Maintains a 1:1 connection with a server, typically embedded within the Host.
- MCP Server: Provides tools, resources, and prompts to the client.
Layers
- Data Layer: Defines protocol semantics. It uses JSON-RPC 2.0 to handle tools, resources, prompts, and notifications.
- Transport Layer: Handles underlying communication. Supported transports include Stdio (local process communication) and HTTP with SSE (remote communication).
Lifecycle Management
The Initialization Exchange
A mandatory handshake occurs when a connection is established:
- Initialize Request: The client sends its protocol version and capabilities.
- Initialize Response: The server responds with its version and capabilities, including supported protocol features.
- Initialized Notification: The client confirms it is ready to proceed.
Protocol Versioning
MCP protocol versions use a date-shaped format such as YYYY-MM-DD. Version negotiation occurs during initialization; both parties must agree on a protocol version before normal operation.
Primitives and Operations
Tool Discovery and Execution
- Discovery: Clients list available tools using
tools/list. - Execution: Clients invoke tools via
tools/call. The server executes the logic and returns a result. - Operational flow: Application selects the right session, calls the tool, then returns the result into the conversation or agent workflow.
Real-time Updates (Notifications)
MCP supports proactive server-to-client notifications.
notifications/tools/list_changed: Sent by the server when its tool roster changes.- Refresh cycle: Upon receiving a notification, the client typically re-fetches the tool list via
tools/list. - Benefit: Enables dynamic environments where tools may appear or disappear based on permissions, server state, or runtime context.
Strategic Importance
- Dynamic Discovery: Prevents hardcoding tool definitions; the AI application learns capabilities at runtime.
- Transport Independence: The same Data Layer logic works over local pipes or web APIs.
- Standardized Context: Provides a unified way for LLMs to interact with external systems without custom integrations for every tool.
- Agent Ecosystem Leverage: Hosts, servers, and clients can evolve independently while retaining a shared interaction contract.