Catalog My learning Blog
Build AI Agents with MCP: 30-Day Course · Phase 3 · Lesson 11 · 5 min read

What Is MCP? Model Context Protocol Explained

On this page
  1. Learning Objective
  2. Concept Explanation
  3. Worked Example: Seeing the Roles in a Few Lines of Python
  4. Real-World Examples
  5. Review Questions & Answers

Learning Objective

Explain the problem the Model Context Protocol solves, identify the three roles in its architecture (host, client and server), and trace how a tool exposed by an MCP server becomes something a model can call inside an AI application.

Concept Explanation

Before MCP, every AI application integrated every tool on its own. A chat app that wanted GitHub, Slack and a database wrote three integrations; an IDE assistant wanted the same three and wrote them again. With M applications and N tools the industry was writing M times N integrations, each with its own auth handling, schemas and bugs. The Model Context Protocol, released as an open standard by Anthropic in November 2024, turns that into M plus N: each tool is wrapped once as an MCP server, and each application implements an MCP client once.

The design borrows from the Language Server Protocol, which did the same thing for programming languages and editors. Before LSP, every editor needed its own plugin for every language; after it, a language team writes one language server and every LSP-aware editor can use it. MCP applies that idea to the context and actions AI applications need: data to read, tools to call and prompt templates to offer.

MCP defines three roles. The host is the AI application the user interacts with, such as Claude Desktop, Claude Code, VS Code with Copilot, or your own agent. The host owns the model, the user interface and the security decisions. A client is a connector inside the host that maintains a connection to exactly one server; a host connected to five servers runs five clients. A server is a program that exposes capabilities over the protocol. It may run locally as a subprocess, for example a filesystem server, or remotely over HTTP, for example a company's hosted CRM server.

Servers offer three kinds of primitives (Day 13). Tools are functions the model can call. Resources are data the application can read and put into context. Prompts are templated workflows the user can pick. Clients can offer features back to servers, chiefly elicitation, which lets a server ask the user for input partway through an operation. Messages are JSON-RPC 2.0 over a transport, either standard input and output for local servers or Streamable HTTP for remote ones (Day 14).

The host stays in charge. The specification is explicit that tools represent arbitrary code execution, that users must consent before data is shared or tools are invoked, and that tool descriptions from untrusted servers must themselves be treated as untrusted. MCP standardizes the plumbing; it does not make a server trustworthy. Hosts implement approval prompts, allow lists and per-tool permissions on top.

Adoption moved quickly. OpenAI added MCP support to its Agents SDK in March 2025 and to ChatGPT later that year, Google and Microsoft followed, and in December 2025 Anthropic donated MCP to the Agentic AI Foundation under the Linux Foundation, alongside OpenAI's AGENTS.md and Block's goose. The protocol is versioned by date; this course targets the 2026-07-28 revision, the largest since launch, which made the protocol stateless.

RoleWhat it isExamplesResponsible for
HostThe AI applicationClaude Desktop, Claude Code, VS Code, your agentModel, UI, consent, permissions
ClientOne connection inside the hostOne per configured serverProtocol messages to one server
ServerA program exposing capabilitiesGitHub, Postgres, filesystem, internal APIsTools, resources, prompts
TransportHow messages travelstdio, Streamable HTTPFraming and delivery

Worked Example: Seeing the Roles in a Few Lines of Python

This script plays the host. It starts an MCP server as a subprocess (stdio transport), creates a client connected to it, asks what the server offers, and calls one tool. The same server would work unchanged in Claude Desktop or VS Code.

Python
import asyncio
from mcp import Client, StdioServerParameters

# The server: any MCP server launched as a local subprocess.
server = StdioServerParameters(command="uvx", args=["mcp-server-time"])

async def main():
    # The client: one connection to one server, owned by this host program.
    async with Client(server) as client:
        print("Server:", client.server_info)
        print("Protocol version:", client.protocol_version)

        tools = await client.list_tools()
        for tool in tools.tools:
            print(f"- {tool.name}: {tool.description}")

        result = await client.call_tool("get_current_time", {"timezone": "Europe/Paris"})
        print(result.content[0].text)

asyncio.run(main())

A real host does one more thing between listing and calling: it hands the tool definitions to a model, lets the model decide which to call, and asks the user for approval before running anything with side effects. Day 24 builds exactly that host loop.

The host is the AI application and owns the model, the UI and consent. It runs one MCP client per server. Servers expose tools, resources and prompts, locally over stdio or remotely over Streamable HTTP.
The host is the AI application and owns the model, the UI and consent. It runs one MCP client per server. Servers expose tools, resources and prompts, locally over stdio or remotely over Streamable HTTP.

Real-World Examples

  • Anthropic announced MCP on 25 November 2024 with reference servers for Google Drive, Slack, GitHub, Git, Postgres and Puppeteer; within a year public directories listed thousands of community servers, and by 2026 more than 20,000.
  • In December 2025 the Linux Foundation formed the Agentic AI Foundation, co-founded by Anthropic, OpenAI and Block, with MCP as a founding project, moving the protocol's governance to a vendor-neutral body.
Key TakeawaysMCP turns M times N custom integrations into M plus N by standardizing how AI applications connect to tools and data. A host is the AI application, it runs one client per server, and servers expose tools, resources and prompts over JSON-RPC on stdio or Streamable HTTP. The protocol standardizes plumbing; consent, permissions and trust remain the host's job.

Review Questions & Answers

Without a standard, every AI application had to build its own integration for every tool, giving M times N integrations. With MCP each tool is wrapped once as a server and each application implements a client once, giving M plus N.

The host is the AI application. It creates one client per server it connects to, and each client maintains the protocol connection to exactly one server.

No. MCP standardizes communication, not trust. Tools can execute arbitrary code, and tool descriptions from untrusted servers are untrusted input, so the host must obtain user consent and enforce permissions.

The Language Server Protocol. It showed that a standard protocol between editors and language servers lets each side be built once and work with every implementation of the other, which MCP applies to AI applications and tools.