Skip to main content

What is the Model Context Protocol?

The Model Context Protocol (MCP) is an open standard that enables AI applications to securely connect to external data sources and tools. It provides a universal way for AI models to interact with the outside world through a standardized interface.
Think of MCP as “USB for AI” - a universal connector that lets AI models plug into any tool or data source through a common protocol.

Why MCP Matters

Traditional AI integrations require custom code for each tool or data source. MCP solves this by:

Universal Standard

One protocol to connect AI models to any tool, API, or data source

Security First

Built-in authentication, authorization, and sandboxed execution

Composability

Mix and match tools from different providers seamlessly

Future-Proof

Open standard that evolves with the AI ecosystem

Core Architecture

MCP follows a client-server architecture:

Components

MCP Client is the component that AI applications use to connect to MCP servers.The client:
  • Discovers available tools and resources from servers
  • Manages connections to multiple servers simultaneously
  • Routes tool calls to the appropriate server
  • Handles authentication and session management
Example:

MCP Protocol Flow

Here’s how a typical MCP interaction works:
1

Initialization

The client connects to the server and exchanges capabilities.
2

Discovery

The client discovers available tools, resources, and prompts.
3

Execution

The AI model decides which tool to call and provides arguments.
4

Response

The server executes the tool and returns results.

Protocol Specification

MCP is built on JSON-RPC 2.0 with specific message types:

Message Types

Tools are functions that AI models can call to perform actions.

Advanced Features

Progress Notifications

Servers can send progress updates during long-running operations:

Logging

Servers can emit structured logs:

Authentication

MCP supports OAuth and custom authentication:

Protocol Versions

mcp-use supports the latest MCP protocol version:
  • Current: 2024-11-05
  • Features: Tools, Resources, Prompts, Sampling, Roots, Authentication
  • Transports: stdio, HTTP/SSE, WebSocket
mcp-use automatically negotiates the protocol version with servers, so you don’t need to worry about version compatibility.

Standards Compliance

mcp-use is fully compliant with the official MCP specification:

Learn More

Official MCP Spec

Read the official Model Context Protocol specification

MCP Servers

Understand the difference between MCP Servers and Apps

Tools, Resources, Prompts

Deep dive into MCP primitives

Architecture

Learn about mcp-use architecture