Model Context Protocol. A standard for connecting tools and data to LLM clients.
Model Context Protocol is Anthropic's open spec for how LLM clients (Claude Desktop, Cursor, IDEs, agent runtimes) connect to external tools and data sources. The pitch: write a server once, every MCP-aware client can use it.
Two SDKs do most of what people need: @modelcontextprotocol/sdk (TS) and mcp (Python). Both expose decorators or builder APIs that turn a function into a tool.
A typical TS server is ~50 lines: declare tools with Zod schemas, wire them to handlers, start on stdio. The complexity comes from what the tools actually do, not the protocol.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({ name: "weather", version: "0.1.0" });
server.tool(
"get_weather",
"Current weather for a city.",
{ city: z.string().describe("City name, e.g. 'Brooklyn'") },
async ({ city }) => {
const res = await fetch(`https://api.example.com/weather/${city}`);
const data = await res.json();
return { content: [{ type: "text", text: `${data.temp}°F in ${city}` }] };
}
);
await server.connect(new StdioServerTransport());