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.
Staging seguro para este activo
Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.
npx -y tokrepo@latest install 3252f257-53c7-4a55-bf5e-81b1257f7fc6 --target codexPrimero deja archivos en staging; la activación requiere revisar el README y el plan staged.
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.
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.
How to use
- 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
- 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()
- Connect the server to an MCP client (Claude Desktop, Claude Code, or any compliant client) via stdio or HTTP transport.
- The client discovers available tools, resources, and prompts through capability negotiation and presents them to the model.
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.
Related on TokRepo
- MCP Integrations — GitHub MCP server implementation
- AI Tools for Automation — Automation tools that leverage MCP for AI integration
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.
Preguntas frecuentes
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.
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.
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.
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.
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.
Referencias (3)
- MCP Specification— MCP specification defining tools, resources, and prompts primitives
- Anthropic MCP Docs— Anthropic published the Model Context Protocol
- JSON-RPC Specification— JSON-RPC 2.0 messaging protocol
Relacionados en TokRepo
Fuente y agradecimientos
Created by Anthropic. Licensed under MIT.
modelcontextprotocol/specification — Official MCP spec spec.modelcontextprotocol.io — Full specification
Discusión
Activos relacionados
Google Stitch MCP — AI Design via Model Context Protocol
Connect Claude Code, Cursor, Gemini CLI, or VS Code to Google Stitch for AI-driven UI design. Create projects, generate screens from text, edit designs, manage design systems — all via MCP.
Claude Official Skill: mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP serve...
Microsoft MCP — Official Model Context Protocol SDK
Microsoft MCP provides official Model Context Protocol building blocks and samples so teams wire reliable tools into agents without ad‑hoc contracts.
MCP Java SDK — Model Context Protocol for Java (2026)
MCP Java SDK brings Model Context Protocol to Java 17+; verified 3,412★ with Maven Central artifacts, Spring AI docs, and server conformance 40/40.