modelcontextprotocol/python-sdk

Description: The official Python SDK for Model Context Protocol servers and clients

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 1 hour ago
Added to GitGenius on July 16th, 2026
Created on September 24th, 2024
Open Issues & Pull Requests: 528 (-2)
GitHub issues: Enabled
Number of forks: 3,696
Total Stargazers: 23,725 (+1)
Total Subscribers: 172 (+0)

Issue Activity (beta)

Open issues: 244
New in 7 days: 12
Closed in 7 days: 27
Avg open age: 205 days
Stale 30+ days: 180
Stale 90+ days: 112

Recent activity

Opened in 7 days: 8
Closed in 7 days: 27
Comments in 7 days: 18
Events in 7 days: 29

Top labels

  • bug (266)
  • enhancement (244)
  • ready for work (197)
  • question (120)
  • P2 (119)
  • P1 (114)
  • v2 (108)
  • P3 (95)

Repository Insights (GitGenius)

Median issue/PR response: 7.9 hours
Mean response time: 11.0 days
90th percentile: 25.8 days
Tracked items: 1,194

Most active contributors

Detailed Description

The Model Context Protocol Python SDK is the official Python implementation for building and connecting to MCP servers and clients. MCP is a standardized protocol that allows developers to expose data and functionality to large language model applications in a secure, structured manner, functioning similarly to a web API but designed specifically for LLM interactions. The SDK enables developers to build MCP servers that expose tools, resources, and prompts to any MCP host, as well as build MCP clients that connect to any MCP server. It supports multiple standard transports including stdio, Streamable HTTP, and Server-Sent Events.

The repository is currently in a significant transition period. Version 2 of the SDK is under active development as a pre-release (alpha and beta versions) and represents a major rework designed to support the 2026-07-28 Model Context Protocol specification release while addressing long-standing architectural issues. The README explicitly cautions against using v2 in production, noting that each pre-release may contain breaking changes from the previous one. Version 1.x remains the only stable release line and is recommended for production use, continuing to receive critical bug fixes and security patches on the v1.x branch. The stable v2 release is targeted for 2026-07-27, coinciding with the specification release.

The SDK is written in Python and requires Python 3.10 or higher. The documentation is comprehensive and hosted at py.sdk.modelcontextprotocol.io/v2/, including a get-started guide, migration guide from v1 to v2, and full API reference. The project demonstrates its accessibility through minimal code examples, showing how to create a complete MCP server in just 15 lines of Python code and an MCP client in 10 lines. These examples highlight the SDK's design philosophy of reducing boilerplate by automatically handling JSON Schema generation, request parsing, validation, and protocol handling based on type hints and docstrings.

The repository is licensed under the MIT License and actively encourages community contributions. The project maintains a dedicated Discord channel for SDK development discussions and provides a specific feedback template for v2-related issues. For developers using the SDK, the project recommends adding an upper version bound constraint such as mcp>=1.27,<2 to prevent unexpected breaking changes when v2 becomes stable. The SDK's dual support for both server and client implementations within a single package, combined with its flexible transport options, makes it suitable for various use cases ranging from local development with stdio transport to remote deployments using HTTP or SSE.

python-sdk
by
modelcontextprotocolmodelcontextprotocol/python-sdk

Repository Details

Fetching additional details & charts...