Guide · MCP Architecture

The Complete Guide to Model Context Protocol (MCP): Architecture & Real-World Use Cases

Model Context Protocol (MCP) has quickly become the USB-C standard for connecting AI models to external data, tools, and application state. Here is how the protocol works under the hood and why developers are building on it.

  • Updated 18 September 2026
  • Architecture Guide
  • Applies to Claude Code, Cursor, & Windsurf

Method 1

What is Model Context Protocol (MCP)?

As AI models like Claude, GPT-4, and open-source LLMs evolved, developers faced a repeating problem: every AI assistant required custom integrations, API wrappers, and prompt hacks to read files, run database queries, or check project specs.

Model Context Protocol (MCP) solves this by providing an open standard for bidirectional communication between an AI application (the Host) and an external context provider (the Server).

Works for

  • Single unified protocol across Cursor, Claude Code, Copilot, and Windsurf.
  • Dynamic runtime tool discovery and JSON-RPC 2.0 schema validation.
  • Supports stdio and HTTP SSE remote servers with Bearer auth.

Where it breaks

  • Requires client support for MCP (supported in all modern AI coding tools).
  • Poorly implemented local servers can leak processes if shutdown handling is missing.

Method 2

Core Architecture: Client, Host, & Server

MCP operates on a client-server model over JSON-RPC 2.0. The architecture consists of three key entities:

  • Host Application: The AI program the developer interacts with (e.g. Claude Code CLI, Cursor IDE, Windsurf).
  • MCP Client: The protocol implementation inside the Host that initiates requests and handles protocol negotiation.
  • MCP Server: The service exposing context, executable tools, or prompt templates to the AI client.

Here is how a standard JSON-RPC tool invocation request looks over MCP:

JSON-RPC 2.0 Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_feature_spec",
    "arguments": {
      "feature_id": "F-102"
    }
  }
}
JSON-RPC 2.0 Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Feature F-102: User Authentication. Rules: 1. Require 2FA for admin roles. 2. Tokens expire in 24 hours."
      }
    ]
  }
}

Method 3

The Three Core Primitives: Tools, Resources, & Prompts

MCP divides functionality into three fundamental primitives:

1. Tools (Executable Actions)

Tools allow AI agents to perform side effects or query dynamic data (e.g. running tests, creating database migrations, reading a feature specification).

2. Resources (Passive Context Data)

Resources act like file handles or URI-addressable state (e.g. file:///project/schema.sql or contextsbase://features/F-102). AI models can read resources to load context into their prompt window.

3. Prompts (Reusable Templates)

Prompts are pre-configured workflow templates exposed by the server to guide the AI assistant on specific engineering tasks.

Method 4

Transports: Stdio vs Remote HTTP / SSE

MCP supports two main transport layers for message delivery:

Stdio vs HTTP SSE comparison
DimensionStdio TransportHTTP + SSE Transport
ConnectionLocal subprocess spawned directlyRemote web server over HTTP/HTTPS
Use CaseLocal CLI tools, git, desktop appsSaaS platforms, team databases, cloud memory
AuthenticationSystem level (process ownership)HTTP headers (Bearer token, OAuth)
Multi-clientSingle client per spawned processConcurrent multi-client access

Method 5

Real-World Developer Use Cases

  • Codebase Memory & Specs: Serving architectural rules, entities, and specs to AI coding agents so they write compliant code without hallucinating.
  • Live Database Querying: Allowing agents to inspect SQL schemas and safely execute read-only queries during debugging.
  • API Inspection & Testing: Interacting with local environment APIs, Postman collections, and automated test runners.
  • Production Monitoring & Logs: Feeding Sentry errors or Datadog log snippets directly into the agent's context during root-cause analysis.

Method 6

Serving Persistent Context via MCP with ContextsBase

ContextsBase operates as a native HTTP SSE MCP server. Instead of letting coding agents start every task from zero context or rely on static markdown files, ContextsBase serves living features, entity data models, business rules, and test suites over MCP directly to Claude Code, Cursor, or Copilot.

Who created Model Context Protocol (MCP)?

MCP was created as an open standard by Anthropic in late 2024 to standardize how AI applications connect to external data sources, tools, and context repositories.

Which AI clients support MCP?

Claude Code, Cursor, Windsurf, Roo Code, Cline, Goose, Zed, and LibreChat all natively support MCP connections via configuration files or CLI commands.

How does MCP differ from REST APIs?

MCP is built specifically for LLM context negotiation over JSON-RPC 2.0. It defines standard schemas for discovering tools, reading resource state, and exposing prompts without hardcoding custom API logic for every new LLM client.

Build with Living MCP Context

Connect ContextsBase to your AI coding agents in under 2 minutes over MCP.

  • Free for one project
  • Bring your own agent