Skip to main content

MCP — Model Context Protocol

“A USB-C port for AI applications.”

What Is MCP

MCP (Model Context Protocol) is an open standard protocol for connecting AI applications to external systems. It was created by Anthropic, inspired by Microsoft’s Language Server Protocol (LSP), and is now managed by the Linux Foundation. MCP follows the same design philosophy as LSP: through a standardized protocol layer, it reduces the N x M integration problem to N + M. Official Specification: modelcontextprotocol.io Specification Repository: github.com/modelcontextprotocol/specification Current Protocol Version: 2025-11-25 In Plain Terms: USB-C lets your phone connect to chargers, displays, and flash drives. MCP lets AI applications connect to databases, APIs, file systems, and all kinds of tools. One standard interface to connect everything.

Broad Ecosystem Support

MCP is supported by the following AI applications and development tools:

MCP Architecture

Three Participants

MCP is a stateful protocol using a client-server architecture with three core participants:

Two-Layer Architecture

Transport Methods

MCP Core Capabilities (Primitives)

Server-Side Primitives

1. Tools — Model-Controlled Executable functions that AI models autonomously decide when to invoke. Discovered via tools/list, executed via tools/call. Supports inputSchema for defining input parameters, and optional outputSchema for defining structured output.
2. Resources — Application-Controlled Data sources that provide context to AI applications, identified by URIs (supporting RFC 6570 URI templates). Discovered via resources/list, read via resources/read, with subscription support via resources/subscribe. Resources carry Annotations (audience, priority, lastModified, and other metadata). 3. Prompts — User-Controlled Reusable interaction templates. Discovered via prompts/list, retrieved via prompts/get (with parameterized arguments).

Client-Side Primitives

Content Types

MCP supports five content types, all of which can carry Annotations:

MCP in Commerce Applications

MCP Server Development Workflow

1. Define Tools

Determine which tools your MCP Server will expose. Each tool needs:
  • A name and description (the description directly influences the AI model’s selection decisions)
  • Input parameter JSON Schema (inputSchema)
  • Optional output Schema (outputSchema, defining structured return format)
  • Execution logic

2. Choose an SDK

MCP provides multi-language SDKs:
  • TypeScript/JavaScript: @modelcontextprotocol/sdk
  • Python: mcp
  • Other languages: Implement via JSON-RPC 2.0 directly

3. Implement the Server

4. Deploy

  • Local Server: Use stdio transport, runs on the user’s machine
  • Remote Server: Use Streamable HTTP transport, deployed on your server

5. User Connection

Users add your Server connection information in MCP-enabled applications such as Claude, ChatGPT, or VS Code to start using it.

Protocol Lifecycle

An MCP connection has three phases:

Table of Contents

  1. MCP Core Concepts — Architecture details, participant roles, protocol lifecycle
  2. Data Layer Protocol — JSON-RPC 2.0 message format, capability negotiation
  3. Transport Layer — stdio vs Streamable HTTP, OAuth 2.1 authentication
  4. Building an MCP Server — Complete TypeScript/Python development guide
  5. Commerce MCP Server — MCP Server design patterns for e-commerce
  6. Resources and Prompts — Working with Resources and Prompts
  7. Security and Authentication — OAuth 2.1 integration, PKCE, permission management
  8. Testing and Debugging — MCP Inspector usage guide
  9. Deployment Guide — Local deployment vs remote deployment
  10. Case Studies — MCP Server implementations for different scenarios

AI Prompt: Build a Commerce MCP Server

MCP is an actively evolving protocol with ongoing specification updates. This book is based on the official documentation as of April 2026 (protocol version 2025-11-25). Always refer to the latest version at modelcontextprotocol.io.