MCP ConfigsApr 8, 2026·2 min read

Anthropic MCP Specification — Protocol Reference

Official Model Context Protocol specification reference. Understand MCP architecture, message format, tool definitions, resource types, and transport protocols for building servers.

TL;DR
Official MCP spec covering architecture, message format, tool definitions, resource types, and transport protocols for AI integrations.
§01

What it is

The Model Context Protocol (MCP) specification defines how AI models connect to external tools, data sources, and services through a standardized interface. Published by Anthropic, MCP provides a common protocol for tool definitions, resource access, and prompt templates.

This specification reference covers the complete protocol: JSON-RPC message format, capability negotiation, tool schemas, resource types, and transport layers (stdio and HTTP+SSE). It is the canonical document for anyone building MCP servers or clients.

§02

How it saves time or tokens

Before MCP, every AI integration required custom API wrappers, bespoke tool definitions, and model-specific prompt formats. MCP standardizes this into a single protocol that any model and any tool can speak. Build one MCP server and it works with Claude, GPT, Gemini, and any compliant client.

The specification also reduces token waste by defining efficient message structures. Tool results flow through structured JSON rather than verbose natural language descriptions.

§03

How to use

  1. Read the specification to understand the three core primitives:
Tools     — Functions the model can call (with JSON Schema parameters)
Resources — Data the model can read (files, database rows, API responses)
Prompts   — Reusable prompt templates with arguments
  1. Implement a server using the official SDK:
from mcp import Server

server = Server('my-server')

@server.tool('get_weather')
async def get_weather(city: str) -> str:
    return f'Weather in {city}: 72F, sunny'

server.run()
  1. Connect the server to an MCP client (Claude Desktop, Claude Code, or any compliant client) via stdio or HTTP transport.
  1. The client discovers available tools, resources, and prompts through capability negotiation and presents them to the model.
§04

Example

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "get_weather",
    "arguments": {"city": "San Francisco"}
  },
  "id": 1
}

This JSON-RPC message shows a tool call request. The server processes it and returns a structured result.

§05

Related on TokRepo

§06

Common pitfalls

  • Confusing MCP servers with REST APIs. MCP uses JSON-RPC over stdio or SSE, not HTTP request-response. The lifecycle and connection model are different from traditional APIs.
  • Defining tools with overly broad parameters. Each tool should do one thing well with a clear JSON Schema. Models perform better when tool boundaries are sharp.
  • Ignoring capability negotiation. Servers must declare which capabilities they support (tools, resources, prompts) during initialization. Skipping this step causes clients to miss available features.

Frequently Asked Questions

What is the Model Context Protocol?+

MCP is a standardized protocol published by Anthropic that defines how AI models connect to external tools, data sources, and services. It uses JSON-RPC messaging with three core primitives: tools (callable functions), resources (readable data), and prompts (reusable templates). Any compliant client can talk to any compliant server.

Which AI models support MCP?+

MCP is designed to be model-agnostic. Claude supports MCP natively through Claude Desktop and Claude Code. Other models can support MCP through compliant client implementations. The protocol does not depend on any specific model architecture.

What transport protocols does MCP use?+

MCP supports two transport layers: stdio (standard input/output) for local server processes, and HTTP with Server-Sent Events (SSE) for remote servers. Stdio is simpler for local tools. HTTP+SSE enables networked deployments and cloud-hosted servers.

How do I build an MCP server?+

Use the official MCP SDK in Python or TypeScript. Define tools with parameter schemas, implement handler functions, and run the server. The SDK handles JSON-RPC parsing, capability negotiation, and transport. A minimal server can be built in under 20 lines of code.

Can MCP servers expose data as well as tools?+

Yes. MCP defines resources as a separate primitive from tools. Resources represent readable data like files, database rows, or API responses. The model can browse and read resources without calling a function. This separation keeps tool calls focused on actions and resources focused on data access.

Citations (3)
🙏

Source & Thanks

Created by Anthropic. Licensed under MIT.

modelcontextprotocol/specification — Official MCP spec spec.modelcontextprotocol.io — Full specification

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.