MCP Architecture Overview
MCP (Model Context Protocol) features a distributed architecture enabling AI applications to communicate seamlessly with multiple data sources and tools through standardized interfaces.
Understanding MCP Architecture
The Model Context Protocol uses a three-tier architecture that connects AI applications with external data sources and tools through a standardized communication layer.
The Three-Tier Model
How components work together in MCP
MCP Hosts
LLM applications that initiate connections
- β’ Claude Desktop
- β’ Cursor IDE
- β’ Windsurf
- β’ VS Code
- β’ Zed, Trae, etc.
MCP Clients
Connectors within the host
- β’ 1:1 with servers
- β’ JSON-RPC 2.0 messages
- β’ Per-request metadata
- β’ Stateless requests
MCP Servers
Services providing context & capabilities
- β’ Databases
- β’ APIs
- β’ File systems
- β’ Document stores
- β’ Code repositories
Key Architectural Principle:
Each MCP client maintains a 1:1 relationship with exactly one MCP server. Hosts can run multiple clients to connect to multiple servers simultaneously.
Communication Protocol
JSON-RPC 2.0 Protocol
MCP uses JSON-RPC 2.0 for structured communication. The 2026-07-28 revision is stateless: every request is self-contained, carrying its protocol version and client capabilities.
β‘οΈ Client-to-Server
Servers do not initiate JSON-RPC requests; server-to-client interactions are embedded in results
π Stateless
No protocol-level sessions; all context needed for a request travels with it
π€ Per-Request Capabilities
Each request declares the capabilities it relies on rather than negotiating a connection
π Standardized
Consistent error handling and logging
Inspired by LSP:
MCP draws inspiration from the Language Server Protocol (LSP), applying similar standardization principles to AI application integrations.
Server-to-Client Features
MCP servers expose three primary types of capabilities to clients. These form the foundation of how AI systems access and interact with external resources.
Resources
Context and data accessible to users or AI models
π Structured Data Sources
- β’ Code files and repositories
- β’ Documents and wikis
- β’ Database query results
- β’ API responses
π Access Control
- β’ Application-controlled permissions
- β’ Read-only information exchange
- β’ Can be dynamic or static
- β’ Provides factual context
Read-Only Pattern:
Resources follow a read-only pattern, providing information to AI models without allowing modification.
Server-to-Client Interactions
MCP is client-to-server at the JSON-RPC level: servers never initiate their own requests. When a server needs more input, the 2026-07-28 revision uses Multi Round-Trip Requests β the server returns an InputRequiredResult (resultType: "input_required") carrying inputRequests, and the client retries the original request with inputResponses.
Elicitation
Servers request additional information from the user through an input request the client fulfils
Sampling (deprecated)
Server-initiated LLM completions are deprecated as of 2026-07-28; new implementations should integrate directly with provider APIs
Roots (deprecated)
Deprecated as of 2026-07-28; pass directories or files through tool parameters, resource URIs, or server configuration instead
Long-lived change notifications use subscriptions/listen: a single request whose response stream carries the notification types the client opted into.
Supporting Infrastructure
Beyond the core primitives, MCP includes essential utilities for production deployments:
βοΈ Configuration Management
Server setup, preferences, and runtime configuration
π Progress Monitoring
Track long-running operations with progress indicators
π Operation Cancellation
User-controlled workflow termination for any operation
β οΈ Error Handling
Comprehensive error reporting and recovery mechanisms
π Structured Logging
Debugging and observability for development and production
Security and Trust Considerations
Security is Paramount:
MCP implementations must carefully address security and trust at every layer of the architecture.
β User Consent
Explicit authorization required for:
- β’ Data access requests
- β’ Tool execution
- β’ Resource modifications
- β’ External API calls
π Data Privacy
Secure handling of sensitive information:
- β’ Encrypted transmission
- β’ Minimal data exposure
- β’ Access control enforcement
- β’ Audit logging
π‘οΈ Tool Safety
Validation and sandboxing:
- β’ Input validation
- β’ Execution sandboxing
- β’ Rate limiting
- β’ Permission boundaries
ποΈ LLM Sampling Controls
Governance over model invocations:
- β’ Context boundaries
- β’ Token limits
- β’ Model selection controls
- β’ Cost management
Ready to Implement?
Now that you understand the architecture, learn how to implement MCP in your own applications.
Sources
Related Articles & Guides
How to Set Up MCP Servers in Antigravity CLI (Step-by-Step)
Connect Antigravity CLI to external tools with MCP servers. Complete setup guide covering the /mcp manager, mcp_config.json locations, remote serverUrl configuration, and troubleshooting.
Setting up MCP Servers in Claude Code
Learn how to configure Model Context Protocol (MCP) servers in Anthropic's Claude Code CLI to supercharge your AI-assisted development workflow with external tools and services.
How to Set Up MCP Servers in GitHub Copilot (Step-by-Step)
Connect GitHub Copilot to external tools with MCP servers. Complete Copilot MCP setup guide covering VS Code mcp.json, Copilot CLI mcp-config.json, configuration examples, and troubleshooting.