Model Context Protocol (MCP) Architecture

The Model Context Protocol (MCP) is an open standard that enables AI applications to connect with external data sources and tools through a unified interface.

Overview

MCP Architecture

Pattern Description

MCP provides a standardized way for AI applications (hosts) to communicate with external systems (servers) using a client-server architecture with JSON-RPC 2.0 messaging.

Components

MCP Host

MCP Client

MCP Server

Communication Protocol

Method Purpose Example
tools/list Discover available tools List all executable functions
tools/call Execute a tool Run a database query
resources/list Discover available resources List accessible files
resources/read Read a resource Get file contents
prompts/list Discover available prompts List prompt templates
prompts/get Get a prompt Retrieve template with args

Server Examples

File System Server

{
  "tools": [
    {
      "name": "read_file",
      "description": "Read contents of a file",
      "inputSchema": {
        "type": "object",
        "properties": {
          "path": { "type": "string" }
        }
      }
    }
  ]
}

Database Server

{
  "tools": [
    {
      "name": "query",
      "description": "Execute SQL query",
      "inputSchema": {
        "type": "object",
        "properties": {
          "sql": { "type": "string" }
        }
      }
    }
  ],
  "resources": [
    {
      "uri": "db://schema",
      "name": "Database Schema",
      "mimeType": "application/json"
    }
  ]
}

When to Use

Benefits

Benefit Description
Standardization One protocol for all integrations
Reusability Servers work with any MCP-compatible host
Security Controlled access through capability negotiation
Composability Mix and match servers for different use cases
Pattern Relationship
LLM Tool Call MCP standardizes tool calling
Skills Pattern Skills can be exposed via MCP
Agent Orchestration Agents can use MCP for tool access

Resources