Skip to main content
ZICQ

Wiki AI Concepts

Model Context Protocol (MCP)

AI Concepts
Aliases: Model Context Protocol MCP ·2026-10-10

Model Context Protocol (MCP)

The Model Context Protocol (MCP) is an open-standard communication protocol open-sourced by Anthropic in November 2024. Designed to unify how large language model applications (AI agents, code editors, desktop environments) interface with external data repositories and executable developer tools, MCP is widely recognized across the ecosystem as the "USB-C standard for the AI Agent era."

The Core Problem: Reducing $N \times M$ Fragmentation to $N + M$

Prior to MCP, agent integration was crippled by architectural fragmentation:

  • Given $N$ distinct AI client platforms (Claude Desktop, Cursor, Cline, in-house agents) and $M$ disparate tools or data sources (PostgreSQL, GitHub, Slack, local filesystems, Docker);
  • Developers were forced to build bespoke connectors and proprietary plugins for each pair, resulting in an unsustainable $N \times M$ engineering overhead across the industry.

MCP cleanly resolves this through protocol decoupling: Each tool or datasource exposes its capabilities once via a standardized MCP Server. Any compliant MCP Client can instantly discover, query, and invoke those assets out of the box, reducing global integration complexity to $N + M$.

Three-Tier Topology Architecture

MCP structures interaction across three dedicated layers:

┌─────────────────────────────────────────────────────────────────┐
│ Host Environment (e.g., Claude Desktop / Cursor / IDE)          │
│                                                                 │
│   ┌───────────────────────────┐   ┌───────────────────────────┐ │
│   │ MCP Client (Instance A)   │   │ MCP Client (Instance B)   │ │
│   └─────────────┬─────────────┘   └─────────────┬─────────────┘ │
└─────────────────┼───────────────────────────────┼───────────────┘
                  │ stdio channel                 │ HTTP+SSE channel
┌─────────────────▼─────────────┐   ┌─────────────▼─────────────┐
│ MCP Server (Local Filesystem) │   │ MCP Server (Remote DB)    │
└───────────────────────────────┘   └───────────────────────────┘
  1. Host: The orchestrating application executing the user session (such as Claude Desktop or Cursor). The Host manages UI presentation, enforces human-in-the-loop security gates, and lifecycle-manages multiple clients.
  2. Client: Protocol connectors instantiated inside the Host that maintain dedicated 1:1 sessions with individual Servers, handling capability negotiation, message routing, and JSON-RPC dispatch.
  3. Server: Lightweight standalone service processes that wrap specific tools or APIs, exposing structured endpoints via standardized JSON-RPC 2.0 messages.

The Three Core Protocol Primitives

An MCP Server publishes three primary categories of context and actions:

1. Resources (Passive Context)

Represent read-only context data that models can inspect without execution side-effects:

  • URI Addressing: Resources are identified via standardized URIs (e.g., file:///workspace/repo/main.go, postgres://users/schema);
  • Dynamic Subscriptions: Supports text and binary payloads alongside live subscriptions, notifying clients when underlying files or database records are modified.

2. Tools (Executable Operations)

Represent active capabilities that produce real-world side-effects (e.g., executing Git commits, writing database entries, triggering HTTP webhooks):

  • Schema Contracts: Every tool is defined by a strict JSON Schema detailing its identifier, docstring, and argument types;
  • Runtime Flow: Models trigger actions via Function Calling, which the Client forwards to the Server for localized execution before returning outputs.

3. Prompts (Pre-Packaged Workflows)

Pre-defined, server-managed prompt templates designed for high-frequency interactive tasks:

  • Surfaced to users as guided slash-commands (e.g., /review-pr or /schema-audit);
  • Accept parameter arguments and dynamically inject live resources to enforce domain best practices.

Transport Layers & Security Architecture

1. Transport Mechanisms

  • stdio (Standard Input/Output): Ideal for local desktop tooling. The Host launches the Server as a sandboxed subprocess and communicates via standard I/O pipes. Avoids open network ports and protects against local socket snooping.
  • SSE (Server-Sent Events) + HTTP POST: Tailored for distributed cloud deployments. Clients consume asynchronous updates over persistent SSE streams while submitting requests via standard HTTP POST endpoints.

2. Human-in-the-Loop Security Guardrails

Because autonomous tools can induce persistent modifications:

  • Process isolation: Each server runs in an isolated, least-privilege sandbox;
  • User confirmation gates: For tools that write data, modify state, or issue network calls, the Host is required to surface an interactive prompt, requiring explicit human approval before execution proceeds.

Further Reading