Claude Code/
Lesson

Imagine you want Claude to read files on your computer, query a database, and open a pull requestWhat is pull request?A proposal to merge code changes into a shared branch, where teammates review the diff before it's accepted. on GitHub. Today, each of those integrations requires custom code, different APIs, different authenticationWhat is authentication?Verifying who a user is, typically through credentials like a password or token. flows, different data formats. You are essentially building a new power cable for every device in your house.

MCPWhat is mcp?Model Context Protocol - a standard that lets AI tools connect to external services like databases, issue trackers, or APIs. (Model Context ProtocolWhat is protocol?An agreed-upon set of rules for how two systems communicate, defining the format of messages and the expected sequence of exchanges.) is the universal plug. It is an open protocol, created by Anthropic, that standardizes how AI applications connect to external systems. Build one connector, and any MCP-compatible AI application can use it.

Good to know
MCP is an open standard, not a proprietary Anthropic feature. Anyone can build an MCP server, and any AI application can become an MCP client. This means the MCP server you build for Claude will also work with Cursor, Windsurf, and other MCP-compatible tools.

The problem: fragmented integrations

Before MCPWhat is mcp?Model Context Protocol - a standard that lets AI tools connect to external services like databases, issue trackers, or APIs., every AI tool integration was a bespoke project:

  • Want Claude to search your codebase? Write a custom tool.
  • Want ChatGPT to query your database? Write a different custom tool.
  • Want Cursor to read your Jira tickets? Write yet another custom tool.

Each integration had its own protocolWhat is protocol?An agreed-upon set of rules for how two systems communicate, defining the format of messages and the expected sequence of exchanges., its own authenticationWhat is authentication?Verifying who a user is, typically through credentials like a password or token., its own data format. If you switched AI assistants, you started over. If you added a new data source, every AI tool needed a new integration.

This is exactly the situation the hardware industry faced before USB. Every printer, keyboard, and mouse had a different connector. Every manufacturer invented their own plug. Then USB arrived: one standard, every device, every computer.

02

The USB analogy

Before USBBefore MCP
Every device had a different connectorEvery AI integration was custom-built
Switching devices meant buying adaptersSwitching AI tools meant rewriting integrations
Manufacturers each invented their own standardEvery developer built their own protocol
After USB: one plug for everythingAfter MCP: one protocol for every AI tool

MCPWhat is mcp?Model Context Protocol - a standard that lets AI tools connect to external services like databases, issue trackers, or APIs. is that moment for AI. One protocolWhat is protocol?An agreed-upon set of rules for how two systems communicate, defining the format of messages and the expected sequence of exchanges. that any AI application can use to connect to any external system.

03

Client-server architecture

MCPWhat is mcp?Model Context Protocol - a standard that lets AI tools connect to external services like databases, issue trackers, or APIs. uses a simple client-server model with three layers:

┌─────────────────────────────────────────────┐
│  Host Application                            │
  (Claude Desktop, Claude Code, Cursor, etc.) │
│                                              │
│   ┌──────────┐  ┌──────────┐  ┌──────────┐  │
│   │MCP Client│  │MCP Client│  │MCP Client│  │
│   └────┬─────┘  └────┬─────┘  └────┬─────┘  │
└────────┼─────────────┼─────────────┼────────┘
         │             │             │
   ┌─────┴─────┐ ┌────┴──────┐ ┌────┴──────┐
   │MCP Server │ │MCP Server │ │MCP Server │
   (Filesystem)(GitHub)(Postgres) │
   └─────┬─────┘ └────┬──────┘ └────┴──────┘
         │             │             │
   Local Files    GitHub API    PostgreSQL DB
  • Host application: The AI-powered app you interact with (Claude Desktop, Claude Code, Cursor). It manages one or more MCP clients.
  • MCP client: Lives inside the host. Each client maintains a one-to-one connection with an MCP server. It sends requests and receives responses using the MCP protocolWhat is protocol?An agreed-upon set of rules for how two systems communicate, defining the format of messages and the expected sequence of exchanges..
  • MCP server: A lightweight program that exposes capabilities from an external system. It translates between the MCP protocol and the actual APIWhat is api?A set of rules that lets one program talk to another, usually over the internet, by sending requests and getting responses., file system, or database.

The host can connect to multiple MCP servers simultaneously. Claude Desktop might connect to a filesystem server, a GitHub server, and a Postgres server all at once, giving the AI access to files, repos, and databases in one conversation.

04

The three primitives

MCPWhat is mcp?Model Context Protocol - a standard that lets AI tools connect to external services like databases, issue trackers, or APIs. defines three types of capabilities that a server can expose:

Tools, actions the AI can take

Tools are functions the AI can call. They have a name, a description, input parameters, and they return a result.

Examples:

  • search_files, search for files matching a pattern
  • run_query, execute a SQLWhat is sql?A language for querying and managing data in relational databases, letting you insert, read, update, and delete rows across tables. query against a database
  • create_issue, open a new GitHub issue
  • send_message, post a message to Slack

Tools are model-controlled: the AI decides when to call them based on the conversation context.

Resources, data the AI can read

Resources are data sources the AI can access. They are identified by URIs (like web URLs) and return content.

Examples:

  • file:///Users/you/project/config.json, a local file
  • db://users/schema, a database schemaWhat is schema?A formal definition of the structure your data must follow - which fields exist, what types they have, and which are required.
  • github://repo/issues, a list of open issues

Resources are application-controlled: the host application decides which resources to expose to the AI.

Prompts, reusable templates

Prompts are pre-written templates that guide the AI through a specific workflow. They can accept parameters and structure the AI's approach to a task.

Examples:

  • A "code review" prompt that takes a file path and produces a structured review
  • A "database analysis" prompt that takes a table name and generates insights
  • A "git commitWhat is commit?A permanent snapshot of your staged changes saved in Git's history, identified by a unique hash and accompanied by a message describing what changed." prompt that takes staged changes and drafts a message

Prompts are user-controlled: the user explicitly selects them (like choosing a template).

05

MCPWhat is mcp?Model Context Protocol - a standard that lets AI tools connect to external services like databases, issue trackers, or APIs. vs function calling

If you have used tool use (function calling) with the Claude APIWhat is api?A set of rules that lets one program talk to another, usually over the internet, by sending requests and getting responses., you might wonder: how is MCP different?

Function calling / Tool useMCP
What it isA model capability, the AI can call functions you defineA protocol, standardizes how AI apps discover and connect to tools
Who defines toolsYou define them in each API callMCP servers expose them dynamically
DiscoveryYou hardcode available toolsAI discovers tools from connected servers at runtime
ReusabilityTools are tied to your applicationMCP servers are reusable across any compatible AI app
ScopeSingle API interactionPersistent connection across a session

Think of it this way: function calling is the ability to use tools. MCP is the infrastructure that connects tools to the AI in a standard way. They complement each other, MCP servers expose tools, and the AI uses function calling to invoke them.

AI pitfall
When you ask AI about MCP, it sometimes confuses MCP with function calling or with generic "plugins." MCP is specifically a protocol for discovery and connection, it defines how an AI app finds and talks to external tools, not the mechanism the AI uses to call them.
Edge case
MCP servers run locally on your machine by default, which means they have access to your local files and network. This is a feature (your data stays local), but it also means a malicious MCP server could read your files or make network requests on your behalf. Only install servers you trust.
06

Why MCPWhat is mcp?Model Context Protocol - a standard that lets AI tools connect to external services like databases, issue trackers, or APIs. matters

MCP matters because it turns AI tool integration from a custom engineering project into a configuration step:

  1. Build once, use everywhere: An MCP server for Postgres works with Claude, Cursor, and any future MCP-compatible AI tool.
  2. Ecosystem growth: Anyone can build and share MCP servers. The community grows the ecosystem, not just one company.
  3. Reduced complexity: Instead of N AI tools times M integrations, you have N + M components that all speak the same protocolWhat is protocol?An agreed-upon set of rules for how two systems communicate, defining the format of messages and the expected sequence of exchanges..
  4. Security boundary: MCP servers run locally on your machine, keeping sensitive data (APIWhat is api?A set of rules that lets one program talk to another, usually over the internet, by sending requests and getting responses. keys, database credentials) under your control.