Generated using AI. Be aware that everything might not be accurate.



Introduction: What is MCP and Why It Matters


AI assistants are only as useful as the context they can access. A language model that can only read what you paste into a chat window is limited. One that can query your database, call your internal APIs, read your files, and push updates to external systems is transformative.

The Model Context Protocol (MCP) is the standard that makes this possible — not just for one AI tool, but for any MCP-compatible application.


The Problem MCP Solves

Before MCP, connecting an AI assistant to an external system required custom integration work for each application. If you wanted Claude to read your Notion pages, you needed a Claude-specific plugin. If you later switched to Cursor, you had to build a separate integration from scratch. Each new AI tool meant new integration work, and none of it was portable.

This created what Anthropic calls the “M×N problem”: M AI applications each needing separate integrations with N external systems. Every combination required bespoke code.

MCP solves this by defining a standard protocol. Write one MCP server, and any MCP-compatible client can use it. The integration work drops from M×N to M+N.


What MCP Is

MCP is an open protocol specification that defines:

  1. How an AI client discovers what a server can do (capability negotiation)
  2. How the client calls server-defined tools and receives results
  3. How the client reads server-provided data (resources)
  4. How the client uses server-defined prompt templates
  5. How these messages are transported (over stdio or HTTP)

The protocol is transport-agnostic and built on JSON-RPC 2.0. It was created by Anthropic and released as an open standard in late 2024. Since then, it has been adopted by a wide range of AI tools and platforms.


The USB-C Analogy

A useful way to think about MCP: it is to AI what USB-C is to devices.

Before USB-C, you needed a different cable for every device. After USB-C, one cable works everywhere. MCP plays the same role for AI integrations. Your server is the device; the AI application is the laptop; MCP is the cable and the standard that defines what the connection can carry.


What You Can Build With MCP

MCP servers can expose three types of capabilities:

  • Tools — functions the AI can call. Examples: search a database, send an email, run a script, fetch a URL, create a file.
  • Resources — data the AI can read. Examples: the contents of a file, a database record, a configuration object, a log stream.
  • Prompts — reusable prompt templates with arguments. Examples: a “summarize this document” template, a “write a commit message for these changes” template.

A single server can expose any combination of these.


Who Supports MCP

As of early 2026, MCP is supported by:

  • Claude Desktop (Anthropic)
  • Claude Code (Anthropic’s CLI)
  • Cursor (AI code editor)
  • Windsurf (Codeium)
  • Zed (editor)
  • Sourcegraph Cody
  • A growing ecosystem of open-source clients and servers

The MCP server registry (modelcontextprotocol.io/servers) lists hundreds of community-built servers for databases, APIs, development tools, and more.


What This Book Covers

This book is a hands-on guide. By the end, you will have:

  • A solid understanding of how MCP works under the hood
  • A working MCP server written in Python with tools, resources, and prompts
  • That server connected to Claude Desktop, Claude Code, and Cursor
  • Knowledge of advanced features like OAuth and sampling

The focus is practical. Each chapter builds on the previous one, and every concept is illustrated with working code.


Prerequisites

  • Python 3.11 or newer
  • Basic familiarity with Python async/await
  • A terminal and a text editor
  • Either Claude Desktop or Claude Code installed (for testing)

You do not need prior experience with MCP, AI APIs, or protocol design.


Key Takeaways

  • MCP is an open standard for connecting AI clients to external tools and data
  • It solves the M×N integration problem by defining a universal protocol
  • MCP servers expose Tools, Resources, and Prompts
  • The protocol is adopted by Claude Desktop, Claude Code, Cursor, and many others
  • This book will take you from zero to a working, connected MCP server

Table of Contents Chapter 1: MCP Architecture →


>> You can subscribe to my mailing list here for a monthly update. <<