Curriculum

Agentic AI · Open Standards

Model Context Protocol (MCP)

MCP is an open standard by Anthropic that defines a uniform API for LLMs to connect to external data sources, tools, and services, eliminating per-integration glue code.

The idea

Before MCP, every AI application needed custom code to connect each LLM to each external service. MCP defines a universal protocol: MCP Servers expose resources and tools via a standard JSON-RPC interface; MCP Clients (LLM applications) discover and call these servers dynamically.

An MCP server exposes three types of capabilities: Resources (data sources the model can read, like files or DB tables), Tools (functions the model can call, like search or compute), and Prompts (reusable prompt templates). The client negotiates capabilities at connection time.

The protocol uses JSON-RPC 2.0 over stdio or HTTP+SSE. Any language can implement an MCP server. Hundreds of community servers now exist for GitHub, Google Drive, Slack, Postgres, Brave Search, and more—reducing integration from days to minutes.

Client ↔ JSON-RPC 2.0 ↔ MCP Server (Resources | Tools | Prompts)

MCP architecture: a standard JSON-RPC interface connects any LLM client to any MCP-compliant server.

What to hold onto

  • Transport Layersstdio (for local process communication) and HTTP+SSE (for remote servers). The client uses the same protocol regardless of transport.
  • Security ModelMCP servers declare their capabilities. Clients must explicitly grant permissions. Servers should never receive more access than they need (principle of least privilege).
  • SamplingMCP also defines a sampling API where servers can ask the client to generate text, enabling bidirectional AI-powered interactions.

Live: Model Context Protocol (MCP) Inspector

Client-Host-Server JSON-RPC 2.0 protocol handshake connecting AI agents to local resources and tools.

JSON-RPC 2.0 Connected

Quick answers

What is the Model Context Protocol (MCP)?

MCP is an open standard (by Anthropic, adopted broadly) that provides a uniform API for LLMs to connect to external data sources and tools. It replaces bespoke integration code with a single JSON-RPC protocol, enabling any MCP-compliant server (file systems, databases, APIs) to work with any MCP-compatible LLM client.

How does MCP differ from OpenAI function calling?

OpenAI function calling is a model-level capability where tools are defined per-conversation in the API call. MCP is a separate protocol layer—servers run as persistent processes exposing dynamic tool registries. MCP decouples tool providers from model providers, enabling a universal ecosystem of reusable AI integrations.