🤖AI Agents Guide
TutorialsComparisonsReviewsExamplesIntegrationsUse CasesTemplatesGlossary
Get Started
🤖AI Agents Guide

Your comprehensive resource for understanding, building, and implementing AI Agents.

Learn

  • Tutorials
  • Glossary
  • Use Cases
  • Examples

Compare

  • Tool Comparisons
  • Reviews
  • Integrations
  • Templates

Company

  • About
  • Contact
  • Privacy Policy

© 2026 AI Agents Guide. All rights reserved.

Home/Glossary/What Is the MCP SDK?
Glossary7 min read

What Is the MCP SDK?

The MCP SDK is the official collection of libraries published by Anthropic for building MCP clients and servers. The TypeScript SDK and Python SDK are the primary implementations, with community SDKs available for Go, Rust, Java, and other languages.

Developer coding on laptop representing the MCP SDK development experience
Photo by Ilya Pavlov on Unsplash
By AI Agents Guide Team•March 1, 2026

Term Snapshot

Also known as: Model Context Protocol SDK, MCP Development Kit, MCP Library

Related terms: What Is an MCP Server?, What Is an MCP Client?, What Is MCP Transport?, What Is MCP Authentication?

Table of Contents

  1. Quick Definition
  2. The Two Primary SDKs
  3. TypeScript SDK: @modelcontextprotocol/sdk
  4. Python SDK: mcp
  5. High-Level Server Pattern: McpServer vs. Low-Level Server
  6. High-Level (Recommended for most use cases)
  7. Low-Level (For advanced use cases)
  8. Resources and Prompts: Beyond Tools
  9. Resources
  10. Prompts
  11. Community SDKs
  12. SDK Versioning and the MCP Spec
  13. Debugging and Testing Tools
  14. Getting Started Paths
  15. Related Terms
  16. Frequently Asked Questions
brown wooden cross on white surface
Photo by Brett Jordan on Unsplash

What Is the MCP SDK?

The MCP SDK is the official collection of libraries published by Anthropic for building Model Context Protocol servers and clients. Rather than implementing the full JSON-RPC protocol, connection management, and capability negotiation yourself, you use the SDK and focus on writing your tool implementations.

The SDK handles the boring parts of MCP: message framing, transport lifecycle, schema validation, error formatting, and the initialization handshake. You handle the interesting parts: what your tools actually do.

Quick Definition#

The MCP SDK is a set of official libraries (TypeScript, Python, and community variants for other languages) that abstract MCP protocol details so developers can focus on building tools, resources, and prompts rather than protocol implementation.

The Two Primary SDKs#

TypeScript SDK: @modelcontextprotocol/sdk#

Published to npm under the @modelcontextprotocol organization. This is the reference implementation and tends to receive new MCP features first.

Installation:

npm install @modelcontextprotocol/sdk
# or
pnpm add @modelcontextprotocol/sdk

Requirements: Node.js 18+

Package structure: The SDK uses ESM modules with subpath imports. Key entry points:

  • @modelcontextprotocol/sdk/server/mcp.js — McpServer class for building servers
  • @modelcontextprotocol/sdk/server/stdio.js — StdioServerTransport
  • @modelcontextprotocol/sdk/server/sse.js — SSEServerTransport
  • @modelcontextprotocol/sdk/client/index.js — Client class for building clients
  • @modelcontextprotocol/sdk/client/stdio.js — StdioClientTransport
  • @modelcontextprotocol/sdk/client/sse.js — SSEClientTransport

Minimal TypeScript MCP server:

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-server",
  version: "1.0.0",
});

// Register a tool using Zod for schema validation
server.tool(
  "get_weather",
  "Get current weather for a city",
  {
    city: z.string().describe("City name"),
    units: z.enum(["celsius", "fahrenheit"]).default("celsius"),
  },
  async ({ city, units }) => {
    const data = await fetchWeatherAPI(city, units);
    return {
      content: [{ type: "text", text: `${city}: ${data.temp}° ${data.condition}` }],
    };
  }
);

// Start the server over stdio transport
const transport = new StdioServerTransport();
await server.connect(transport);

The TypeScript SDK integrates with Zod for schema validation, which gives you both TypeScript type safety and the JSON Schema definitions that MCP uses for capability descriptions.

Python SDK: mcp#

Published to PyPI as the mcp package. Maintained by Anthropic with feature parity to the TypeScript SDK for all stable MCP features.

Installation:

pip install mcp
# or with uv:
uv add mcp

# For HTTP/SSE transport support:
pip install "mcp[fastapi]"

Requirements: Python 3.10+

Minimal Python MCP server:

import mcp.server.stdio
from mcp.server import Server
from mcp.server.models import InitializationOptions
from mcp.types import Tool, TextContent
import mcp.types as types

server = Server("weather-server")

@server.list_tools()
async def list_tools() -> list[Tool]:
    return [
        Tool(
            name="get_weather",
            description="Get current weather for a city",
            inputSchema={
                "type": "object",
                "properties": {
                    "city": {"type": "string", "description": "City name"},
                    "units": {"type": "string", "enum": ["celsius", "fahrenheit"]},
                },
                "required": ["city"],
            },
        )
    ]

@server.call_tool()
async def call_tool(name: str, arguments: dict) -> list[types.ContentBlock]:
    if name == "get_weather":
        city = arguments["city"]
        units = arguments.get("units", "celsius")
        data = await fetch_weather_api(city, units)
        return [TextContent(type="text", text=f"{city}: {data['temp']}° {data['condition']}")]
    raise ValueError(f"Unknown tool: {name}")

async def main():
    async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
        await server.run(
            read_stream,
            write_stream,
            InitializationOptions(
                server_name="weather-server",
                server_version="1.0.0",
                capabilities=server.get_capabilities(),
            ),
        )

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

The Python SDK uses decorator-based registration (similar to FastAPI) and asyncio for concurrency.

High-Level Server Pattern: McpServer vs. Low-Level Server#

Both SDKs offer two levels of abstraction:

High-Level (Recommended for most use cases)#

TypeScript: McpServer class with .tool(), .resource(), and .prompt() methods. Python: FastMCP class (as of late 2025) with decorator-based registration.

The high-level API handles routing, schema conversion, and error wrapping automatically. Use this unless you have a specific reason to drop to the low level.

Low-Level (For advanced use cases)#

TypeScript: Server class where you manually implement ListToolsRequestSchema and CallToolRequestSchema handlers. Python: Server class with @server.list_tools() and @server.call_tool() decorators.

Use the low level when you need dynamic tool registration (tools change at runtime), custom capability negotiation, or fine-grained control over protocol messages. See advanced MCP patterns for examples.

Resources and Prompts: Beyond Tools#

The SDK supports all three MCP primitive types:

Resources#

Read-only data the AI can access. Registered with a URI scheme:

server.resource(
  "config://app",
  "Application configuration",
  async () => ({
    contents: [{
      uri: "config://app",
      text: JSON.stringify(await loadAppConfig()),
      mimeType: "application/json",
    }],
  })
);

Prompts#

Reusable prompt templates with parameters:

server.prompt(
  "analyze_logs",
  "Analyze application logs for errors",
  { timeRange: z.string().describe("Time range like '1h' or '24h'") },
  async ({ timeRange }) => ({
    messages: [{
      role: "user",
      content: {
        type: "text",
        text: `Analyze the following logs from the last ${timeRange} and identify errors:\n\n${await fetchLogs(timeRange)}`,
      },
    }],
  })
);

Community SDKs#

Beyond the official TypeScript and Python SDKs, community-maintained implementations exist for other languages:

LanguagePackageStatus
Gogithub.com/mark3labs/mcp-goActive
Rustmcp-sdk-rs (crates.io)Active
Javaio.github.stephanj:mcp4jActive
C# / .NETModelContextProtocol (NuGet)Active
Rubymcp-rbEarly
SwiftCommunity packagesEarly

Community SDKs vary in how closely they track the spec. For production use, verify that the SDK version you are using supports the specific MCP spec version your client requires.

SDK Versioning and the MCP Spec#

The SDKs follow the MCP specification version. When Anthropic updates the spec, the SDK releases a new version. Key things to know:

  • The TypeScript SDK package version does not directly correspond to the MCP spec version — check the package changelog for which spec features are supported.
  • The initialize handshake includes a protocolVersion field; both client and server SDKs negotiate which spec version to use.
  • Using mismatched SDK versions (very old client, very new server) may result in the negotiated version falling back to an older feature set.

Debugging and Testing Tools#

The MCP SDK ecosystem includes tools for development:

  • MCP Inspector: A browser-based debugging tool that connects to your server and lets you call tools manually. Run it with npx @modelcontextprotocol/inspector. See the test and debug MCP server tutorial for a complete walkthrough.
  • Claude Desktop: The fastest way to test an stdio server in a real client environment.
  • SDK test utilities: Both SDKs include InMemoryTransport for writing unit tests that test your tool logic without launching real processes.

Getting Started Paths#

For TypeScript developers:

  1. npm install @modelcontextprotocol/sdk zod
  2. Build a custom MCP server
  3. Test with MCP Inspector
  4. Add to Claude Desktop config
  5. Deploy remotely following the deploy remote MCP server tutorial

For Python developers:

  1. pip install mcp
  2. Build a server following the Python examples in the build MCP server tutorial
  3. Test with mcp dev your_server.py (the SDK includes a dev mode)
  4. Package and deploy

Related Terms#

Browse all terms in the AI agent glossary.

  • MCP Server — what you build with the server side of the SDK
  • MCP Client — what you build with the client side of the SDK
  • MCP Transport — how SDK-built servers and clients communicate
  • Agent SDK — broader category of SDKs for building AI agents
  • Model Context Protocol — the specification the SDK implements

Frequently Asked Questions#

Is the MCP SDK open source?

Yes. Both the TypeScript SDK (@modelcontextprotocol/sdk) and Python SDK (mcp) are published under the MIT license. The source code is at github.com/modelcontextprotocol/typescript-sdk and github.com/modelcontextprotocol/python-sdk respectively. Anthropic actively maintains both repositories and accepts community contributions.

Do I need to use the official SDK, or can I implement MCP from scratch?

You can implement MCP from scratch — it is a JSON-RPC 2.0 protocol with well-documented message schemas available at modelcontextprotocol.io. However, the SDKs handle substantial complexity including transport abstraction, capability negotiation, message routing, and error formatting. Implementing this correctly from scratch is several weeks of work. Use the SDK unless you have a language that no SDK covers and cannot use one of the community SDKs.

How do I keep my server updated as the MCP spec evolves?

Follow the @modelcontextprotocol/sdk or mcp package changelogs for breaking changes. Subscribe to the modelcontextprotocol GitHub organization for spec updates. New spec versions are typically negotiated backward-compatibly in the initialize handshake — your server will continue to work with older clients, just without access to newer features. Plan SDK updates with the same care you would give any core infrastructure dependency.

Tags:
mcpdevelopmentframeworks

Related Glossary Terms

What Is an Agent SDK?

An agent SDK (Software Development Kit) is a framework that provides pre-built abstractions, tools, and runtime primitives for building, orchestrating, and deploying AI agents — enabling developers to focus on agent logic instead of infrastructure plumbing.

What Is MCP Authentication?

MCP authentication is how MCP servers verify the identity of connecting clients. The MCP specification mandates OAuth 2.1 for remote HTTP servers, while local stdio servers rely on OS-level process isolation. API keys and bearer tokens are common practical implementations.

What Is an MCP Client?

An MCP client is the host application that connects to one or more MCP servers to gain access to tools, resources, and prompts. Examples include Claude Desktop, VS Code extensions, Cursor, and custom AI agents built with the MCP SDK.

What Is MCP Transport?

MCP transport is the communication layer that carries messages between an MCP client and an MCP server. The three transports are stdio (local subprocess), HTTP with Server-Sent Events, and WebSocket — each suited for different deployment scenarios.

← Back to Glossary