Model Context Protocol

From llmref.wiki
(Redirected from MCP)
Model Context Protocol — An open protocol that standardizes the interface through which applications supply context, tools, and resources to language models at runtime.

Overview

The Model Context Protocol (MCP) is an open protocol published by Anthropic in November 2024 that defines a standard interface for connecting language models to external data sources, tools, and services. MCP decouples the application layer (which knows about the context and tools) from the model layer (which processes them), so that any MCP-compatible host can work with any MCP server without custom integration code.[1]

Before MCP, each application that wanted to give an LLM access to a database, file system, or API had to implement its own integration. MCP provides a shared transport and schema so these integrations become reusable servers that any compatible host application can connect to.

Architecture

MCP uses a client-server model with three components:

Component Role
MCP host The application (e.g., Claude Desktop, an IDE) that manages the model and maintains connections to MCP servers
MCP client A protocol-level client within the host that communicates with MCP servers
MCP server A lightweight service exposing tools, resources, and prompts to the host over a standardized interface

Servers expose three primitive types:

  • Tools — callable functions (e.g., run a database query, call an API).
  • Resources — readable data sources (e.g., files, schemas, documents).
  • Prompts — reusable prompt templates parameterized by arguments.

The transport layer supports local (stdin/stdout) and remote (HTTP + SSE) communication.

Distinction from function calling

Dimension Function calling Model Context Protocol
Scope Per-model schema for declaring tools Cross-model, cross-vendor protocol
Reusability Tools defined per-application Servers reusable across any MCP host
Standardization Vendor-specific JSON schema format Open protocol with defined transport
State Stateless per-call Servers can maintain stateful resources

MCP is a protocol layer built above function calling: an MCP server exposes tools that a model invokes through its function-calling mechanism, but MCP standardizes discovery, connection management, and resource types across vendors.

See also

References

  1. Anthropic. "Introducing the Model Context Protocol." November 2024. https://www.anthropic.com/news/model-context-protocol