AI models are incredibly smart — but they're blind. No live data, no tool access, no memory. The Model Context Protocol (MCP) changes that forever. Learn the open standard that turns any AI into an autonomous agent with real-world capabilities.
Large Language Models like Claude, GPT-4, and Gemini are extraordinarily capable. They can write code, analyze data, reason through complex problems, and generate human-quality text. But there's a fundamental limitation that holds them back from being truly useful agents.
By default, an LLM has no access to:
No stock prices, weather, news, or any real-time information
Cannot query SQL, read files, or access internal systems
Cannot call REST endpoints, send emails, or trigger workflows
Cannot run shell commands, manage files, or interact with the OS
Imagine hiring the world's smartest analyst — someone who has read every textbook, every paper, every manual ever written. But on their first day, you put them in a windowless room with no computer, no phone, and no internet. They can answer questions brilliantly from memory, but they can't check today's stock price, look up your customer database, or send an email. That's what an LLM is without MCP.
Before MCP, developers solved this with ad-hoc solutions — custom function calling, proprietary plugins, hardcoded tool definitions. Each AI tool vendor had their own approach. It was the equivalent of every website inventing its own version of HTTP.
The result? A fragmented ecosystem where:
The Model Context Protocol (MCP) is an open standard created by Anthropic in late 2024. It defines a universal way for AI models to discover, connect to, and use external tools and data sources — regardless of which AI model or host application is being used.
Just as USB-C standardized how devices connect to peripherals, MCP standardizes how AI models connect to the outside world. Before USB-C, every manufacturer had proprietary connectors. Before MCP, every AI tool had proprietary integrations.
MCP separates the AI model from the data sources through a clean, well-defined protocol layer. This means:
Write an MCP server once, and it works with every MCP-compatible AI tool
Same server works in Claude Code, Cursor, Windsurf, Gemini CLI, and more
Mix and match servers — database + API + filesystem in one session
Switch AI providers without rewriting any of your tool integrations
Anthropic open-sourced MCP in November 2024. Within weeks, major IDE makers and AI tool providers announced support. By early 2025, MCP had become the de facto standard for AI-to-tool communication. By Q1 2026, virtually every major AI coding tool supports it natively.
A protocol is a set of rules for communication. HTTP is a protocol (browsers talk to servers). SMTP is a protocol (email clients talk to mail servers). MCP is a protocol (AI hosts talk to data/tool servers). The beauty of a protocol is that it's vendor-neutral. Just as any browser can talk to any web server via HTTP, any AI tool can talk to any MCP server via MCP.
MCP uses a client-server architecture with three distinct roles:
The host is the application where the user interacts with the AI. It's the outer container that manages the overall experience. Examples include Claude Desktop, Claude Code CLI, Cursor IDE, or Windsurf.
The client lives inside the host and manages the connection to one or more MCP servers. It handles protocol negotiation, capability discovery, and message routing. Each client maintains a 1:1 connection with a single server. A host can run multiple clients simultaneously.
The server exposes tools, resources, and prompts to the AI. It's where the actual integration logic lives — calling APIs, querying databases, reading files, etc. Servers can be local processes (stdio) or remote services (HTTP/SSE).
// User asks Claude Code: "What's the weather in Paris?" // 1. Host (Claude Code) receives the message // 2. Claude identifies it needs the "get_weather" tool // 3. Client sends a tool call request to the weather MCP server // 4. Server calls the weather API // 5. Server returns structured data to the client // 6. Client passes it back to Claude // 7. Claude formats a natural language response User --> Host (Claude Code) | v Client --JSON-RPC--> MCP Server --HTTP--> Weather API | | v v Claude <--result-- { temp: 18, condition: "sunny" } | v "It's 18°C and sunny in Paris right now!"
The key insight is that Claude never talks to the weather API directly. It talks to the MCP server through a standardized protocol. This means the same MCP server works whether Claude, GPT, or Gemini is the model behind the host.
MCP uses JSON-RPC 2.0 as its message format. This is a lightweight remote procedure call protocol that uses JSON. Every MCP message is a JSON object with a method name, parameters, and an ID for matching requests to responses. It's the same protocol used by Ethereum nodes and the Language Server Protocol (LSP) in code editors.
When a client connects to a server, they perform a handshake:
// Client sends initialize request { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-03-26", "capabilities": { "roots": { "listChanged": true } }, "clientInfo": { "name": "claude-code", "version": "1.0.0" } } } // Server responds with its capabilities { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2025-03-26", "capabilities": { "tools": { "listChanged": true }, "resources": { "subscribe": true } }, "serverInfo": { "name": "weather-server", "version": "1.2.0" } } }
After the handshake, the client knows exactly what the server offers — which tools, which resources, which prompts. The AI model can then decide when and how to use them.
MCP defines three core primitives that servers can expose. Understanding the distinction between them is crucial for building effective MCP servers.
| Primitive | What It Is | Controlled By | Analogy |
|---|---|---|---|
| Tools | Functions the AI can call | Model (AI decides when to call) | POST endpoints — actions with side effects |
| Resources | Data the AI can read | Application (user/host selects) | GET endpoints — read-only data access |
| Prompts | Pre-built conversation templates | User (explicitly triggered) | Slash commands — structured workflows |
Tools are the most commonly used primitive. They're functions that the AI model can decide to call based on the conversation context. The model sees the tool's name, description, and parameter schema, and autonomously decides when to invoke it.
{
"name": "get_stock_price",
"description": "Get the current stock price for a given ticker symbol",
"inputSchema": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Stock ticker symbol (e.g., AAPL, MSFT)"
}
},
"required": ["symbol"]
}
}
When the user asks "What's Apple's stock price?", the AI sees this tool definition, recognizes it's relevant, and calls it with {"symbol": "AAPL"}. The server executes the function and returns the result.
Resources are data endpoints that the AI can read. Unlike tools, resources are typically selected by the application or user, not autonomously by the model. They use URI-based addressing.
// Static resource — always the same URI { "uri": "config://app/settings", "name": "App Settings" } // Dynamic resource template — URI varies { "uriTemplate": "db://users/{userId}/profile", "name": "User Profile" } // File resource { "uri": "file:///var/log/app.log", "name": "Application Logs", "mimeType": "text/plain" }
Resources are ideal for providing context — configuration files, database schemas, documentation, log files. The AI reads them to understand the environment before taking action with tools.
Prompts are pre-built templates that define structured interactions. They're like slash commands — the user explicitly selects one, and it generates a conversation with specific context, instructions, and tool references.
{
"name": "analyze_stock",
"description": "Deep analysis of a stock with technical + fundamental data",
"arguments": [
{ "name": "ticker", "description": "Stock ticker", "required": true }
]
}
When triggered, the prompt generates a multi-message conversation that guides the AI through a complete workflow — fetching data, analyzing it, and producing a formatted report. Prompts are the most underused primitive but incredibly powerful for standardizing complex workflows.
MCP supports multiple transport mechanisms. The transport layer determines how messages are physically delivered between client and server.
| Transport | How It Works | Best For | Latency |
|---|---|---|---|
| stdio | Server runs as child process; messages via stdin/stdout | Local tools, CLI integration, development | ~1ms |
| Streamable HTTP | HTTP POST for requests, SSE for server-initiated messages | Remote servers, cloud deployment, multi-user | 10-100ms |
| SSE (legacy) | Server-Sent Events for streaming, HTTP POST for client messages | Legacy support (superseded by Streamable HTTP) | 10-50ms |
With stdio transport, the host spawns the MCP server as a child process. Communication happens through standard input and standard output — the same pipes used by Unix commands. This is the simplest and fastest option.
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["./weather-server/index.js"],
"env": {
"WEATHER_API_KEY": "your-api-key-here"
}
}
}
}
When Claude Code starts, it reads .mcp.json, spawns the weather server process, and connects via stdio. Zero network overhead, zero configuration complexity.
For production deployments and remote servers, Streamable HTTP is the modern transport. Introduced in the 2025-03-26 protocol revision, it combines the simplicity of HTTP with the streaming capabilities of SSE.
// Client sends requests via HTTP POST POST /mcp HTTP/1.1 Content-Type: application/json {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{...}} // Server can respond with: // A) Single JSON response (simple) Content-Type: application/json {"jsonrpc":"2.0","id":1,"result":{...}} // B) SSE stream (for long-running operations) Content-Type: text/event-stream data: {"jsonrpc":"2.0","id":1,"result":{...}}
Use stdio when: You're running the server locally, in development, or deploying as an npm package that users install and run on their machine.
Use Streamable HTTP when: Your server needs to be shared across teams, deployed on a cloud server, or accessed by multiple clients simultaneously.
Most MCP servers start with stdio and add HTTP support later when they need to scale. The protocol layer is transport-agnostic — your tool logic stays the same regardless of transport.
MCP adoption has been remarkably fast. Within 18 months of its release, it has become the de facto standard for AI-tool integration across the industry.
| Host | Type | MCP Config | Transport |
|---|---|---|---|
| Claude Code | CLI Agent | .mcp.json |
stdio, HTTP |
| Claude Desktop | Desktop App | claude_desktop_config.json |
stdio, HTTP |
| Cursor | IDE | .cursor/mcp.json |
stdio, HTTP |
| Windsurf | IDE | .windsurf/mcp.json |
stdio, HTTP |
| Gemini CLI | CLI Agent | .gemini/settings.json |
stdio, HTTP |
| Codex CLI | CLI Agent | .codex/mcp.json |
stdio, HTTP |
| VS Code (Copilot) | IDE Extension | .vscode/mcp.json |
stdio, HTTP |
| Zed | Editor | settings.json |
stdio |
PRs, issues, repos, code search, actions
Query, schema inspection, data analysis
Read, write, search, directory traversal
Read channels, send messages, search
Web search, news, local results
Stocks, screener, market regime, earnings
The MCP server ecosystem is growing exponentially. As of early 2026, there are over 2,000 open-source MCP servers on GitHub, covering databases, APIs, cloud providers, developer tools, financial data, and more.
Before MCP, there were several approaches to giving AI tools access to external systems. Here's how they compare:
| Feature | Function Calling | ChatGPT Plugins | Custom Code | MCP |
|---|---|---|---|---|
| Standard | Vendor-specific | OpenAI-only | None | Open spec |
| Cross-model | No | No | No | Yes |
| Discovery | Manual | Store | Manual | Automatic |
| Streaming | Limited | No | DIY | Native |
| Stateful | No | No | DIY | Yes |
| Auth | DIY | OAuth | DIY | OAuth 2.1 |
| Resources | No | No | DIY | Native |
| Composability | Low | Low | Medium | High |
| Community | Fragmented | Deprecated | N/A | 2000+ servers |
With function calling, you define tools inline in your API call. They exist for that one session. With MCP, servers are independent processes that can be composed freely:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["@modelcontextprotocol/server-github"]
},
"postgres": {
"command": "npx",
"args": ["@modelcontextprotocol/server-postgres"],
"env": { "DATABASE_URL": "postgresql://..." }
},
"filesystem": {
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "/home/user/project"]
},
"dailytickers": {
"command": "npx",
"args": ["@anthropic/dailytickers-mcp"]
}
}
}
With this configuration, the AI agent has simultaneous access to GitHub (code), PostgreSQL (data), the filesystem (files), and DailyTickers (financial data). It can query the database, push results to GitHub, write a report to disk, and enrich it with market data — all in a single conversation.
MCP benefits from a powerful network effect. Every new server makes all MCP hosts more capable. Every new host makes all existing servers more useful. This is why adoption has been exponential — the value of the ecosystem grows quadratically with each new participant (Metcalfe's Law).
Over the next four parts, you'll go from zero to a production-ready MCP server. Here's the roadmap:
Hello World to production — building, testing, and connecting your first MCP server
APIs, web scraping, databases — connecting real data sources
Building a real platform with 5+ tools, auth, and cross-IDE deployment
The DailyTickers MCP server — a real-world production system
By the end of Part 5, you'll have a complete mental model of MCP — from protocol theory to production deployment. You'll know how to build servers that give AI agents real-world superpowers.
MCP from A to Z — Supercharging AI with Live Data
Complete series in 5 parts — From protocol theory to production deployment
Back to Home