Skip to content
Technical Architecture Documentation

Model Context Protocol (MCP) Architectural Overview & Protocol Specification

Deep technical specification of the Model Context Protocol (MCP) architecture, bidirectional JSON-RPC 2.0 stdio message streaming, tool parameter schema validation, and client-server security isolation.

1. Executive Summary & Core Architectural Goals

The Model Context Protocol (MCP) is an open-source standard pioneered by Anthropic to solve the interoperability challenge between Large Language Model (LLM) agents and external computing ecosystems.

Prior to MCP, connecting AI coding assistants (such as Claude Desktop, Cursor IDE, VS Code, and Zed) to developer tools required custom plugins, proprietary extensions, or hardcoded API integrations for every client-server combination. MCP unifies tool execution under a single, client-agnostic protocol.

By standardizing communication over JSON-RPC 2.0 messages, MCP enables AI agents to discover available tools, read environment resources, execute functions, and stream progress events safely within local isolated runtime environments.

2. Protocol Transport Layer: stdio vs Server-Sent Events (SSE)

MCP supports two standard transport layers: Standard Input/Output (stdio) for local process execution, and Server-Sent Events (SSE) for remote HTTP communication.

Under stdio transport, the host client application (e.g., Claude Desktop) spawns the MCP server as a child subprocess (using Node.js `npx`, Python `uvx`, or Docker). The client sends JSON-RPC 2.0 request strings over `stdin` and reads responses from `stdout`. Error diagnostics and log messages stream out over `stderr`.

Under SSE transport, the MCP server hosts an HTTP server endpoint. The client establishes a persistent SSE event stream for server-to-client notifications while dispatching client-to-server RPC requests via HTTP POST payloads.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search_repository",
    "arguments": {
      "query": "authentication bug",
      "state": "open"
    }
  }
}

3. Protocol Primitives: Tools, Resources, Prompts, and Logging

MCP structures capability exposure around four fundamental protocol primitives:

• Tools: Executable functions callable by the AI model. Each tool defines a name, description, and strict JSON Schema for input parameters.

• Resources: File-like or database data sources exposed by the server for read-only inspection (e.g. log files, API schemas, configuration state).

• Prompts: Pre-built prompt templates exposed by the server to guide the AI assistant through multi-step operational workflows.

• Logging: Structured diagnostic log channels for streaming internal execution status (debug, info, warn, error) back to the client UI console.

4. Security Architecture & Credential Isolation

Security is a primary design constraint of the Model Context Protocol architecture. Unlike traditional web hooks or cloud proxies, stdio MCP servers run locally within your workstation execution context.

API keys, database password strings, and auth tokens are defined strictly in local client configuration files (e.g. `claude_desktop_config.json` or `.cursor/mcp.json`) and injected into the server process via environment variables. Auth secrets are never transmitted across third-party remote servers or exposed in LLM prompt contexts.