MCP Masterclass — Part 1 of 5

What is MCP? — The Protocol That Changes Everything

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.

Open Protocol AI Agents Live Data Developer Guide
MCP from A to Z1/5
The ProblemWhat is MCP?Architecture3 PrimitivesTransport LayersEcosystemMCP vs Alternatives
The Problem

AI is Smart — But Blind

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.

The Core Paradox
LLM = Unlimited Intelligence + Zero Real-World Access

By default, an LLM has no access to:

Live Data

No stock prices, weather, news, or any real-time information

Your Databases

Cannot query SQL, read files, or access internal systems

APIs & Services

Cannot call REST endpoints, send emails, or trigger workflows

System Tools

Cannot run shell commands, manage files, or interact with the OS

Think of it This Way

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 Solution

What is MCP?

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.

MCP in One Sentence
MCP is USB-C for AI — one universal plug for all data sources

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.

The Key Innovation

MCP separates the AI model from the data sources through a clean, well-defined protocol layer. This means:

1

Build Once

Write an MCP server once, and it works with every MCP-compatible AI tool

2

Use Anywhere

Same server works in Claude Code, Cursor, Windsurf, Gemini CLI, and more

3

Compose Freely

Mix and match servers — database + API + filesystem in one session

4

No Lock-In

Switch AI providers without rewriting any of your tool integrations

A Brief History

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.

Why "Protocol" Matters

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.

Architecture

MCP Architecture — The Three Layers

MCP uses a client-server architecture with three distinct roles:


Host

Client

Server

Data Sources

1. Host (The AI Application)

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.

2. Client (The Protocol Handler)

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.

3. Server (The Tool Provider)

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).

Conceptual Flow
// 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.

JSON-RPC 2.0

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.

Capability Negotiation

When a client connects to a server, they perform a handshake:

JSON-RPC
// 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.

The Building Blocks

The Three Primitives — Tools, Resources, Prompts

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 — The Power of Action

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.

Tool Definition
{
  "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 — Structured Data Access

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.

Resource Examples
// 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 — Reusable Workflows

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.

Prompt Definition
{
  "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.

Communication

Transport Layers — How Clients Talk to Servers

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

stdio — The Default for Local Development

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.

.mcp.json (Claude Code config)
{
  "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.

Streamable HTTP — The Future of Remote MCP

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.

Streamable HTTP Flow
// 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":{...}}

Choosing the Right Transport

Decision Guide

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.

Ecosystem

Who Supports MCP? — The Growing Ecosystem

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.

AI Hosts (Clients)

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

Notable MCP Servers

GitHub

PRs, issues, repos, code search, actions

PostgreSQL

Query, schema inspection, data analysis

Filesystem

Read, write, search, directory traversal

Slack

Read channels, send messages, search

Brave Search

Web search, news, local results

DailyTickers

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.

Comparison

Why MCP > Function Calling, Plugins, and Custom Integrations

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

The Critical Advantage: Composability

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:

.mcp.json — Composing Multiple Servers
{
  "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.

The Network Effect

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).

What's Next

What You'll Build in This Series

Over the next four parts, you'll go from zero to a production-ready MCP server. Here's the roadmap:

2

Your First Server

Hello World to production — building, testing, and connecting your first MCP server

3

Live Data

APIs, web scraping, databases — connecting real data sources

4

Multi-Tool Platform

Building a real platform with 5+ tools, auth, and cross-IDE deployment

5

Case Study

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.

Prerequisites

Knowledge Check

Quick Quiz — Test Your Understanding

What does MCP stand for, and who created it?
Model Context Protocol, created by Anthropic and open-sourced in November 2024. It's an open standard — not proprietary to Anthropic, and supported by Google, Microsoft, and many others.
What are the three MCP primitives?
Tools (functions the AI can call), Resources (data the AI can read), and Prompts (pre-built conversation templates). Tools are model-controlled, resources are app-controlled, and prompts are user-controlled.
What's the difference between stdio and Streamable HTTP transport?
stdio runs the server as a local child process, communicating via stdin/stdout — fast (~1ms) and simple, ideal for local development. Streamable HTTP uses HTTP POST + SSE for remote communication — necessary for cloud deployment and multi-user scenarios, with 10-100ms latency.
Why is MCP better than OpenAI function calling?
MCP is cross-model (works with any AI), composable (multiple servers in one session), has automatic discovery (no manual tool definitions), supports resources and prompts (not just tools), and benefits from a growing open-source ecosystem of 2000+ servers. Function calling is vendor-specific and session-scoped.
Can you use MCP with GPT, Gemini, or local models?
Yes. MCP is model-agnostic. Any host application can implement an MCP client. Gemini CLI, Codex CLI (OpenAI), VS Code Copilot, and many others support MCP. Even local models via Ollama can use MCP through compatible hosts.

Key Takeaways — Part 1

Part 2 of 5
Your First MCP Server — Hello World to Production

MCP from A to Z — Supercharging AI with Live Data

Complete series in 5 parts — From protocol theory to production deployment

Back to Home
MCP from A to Z1/5