modelcontextprotocol/python-sdk

The official Python SDK for Model Context Protocol servers and clients

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 1 hour ago
Added to GitGenius on July 16th, 2026
Created on September 24th, 2024
Open Issues & Pull Requests: 422 (+0)
Number of forks: 3,774
Total Stargazers: 23,981 (+0)
Total Subscribers: 177 (+0)

Issue Activity (beta)

Open issues: 204
New in 7 days: 10
Closed in 7 days: 43
Avg open age: 173 days
Stale 30+ days: 132
Stale 90+ days: 70

Recent activity

Opened in 7 days: 7
Closed in 7 days: 43
Comments in 7 days: 29
Events in 7 days: 55

Top labels

  • bug (268)
  • enhancement (244)
  • ready for work (197)
  • P2 (121)
  • question (121)
  • P1 (115)
  • v2 (115)
  • P3 (100)

Repository Insights (GitGenius)

Median issue/PR response: 3.0 days
Mean response time: 32.8 days
90th percentile: 128.8 days
Tracked items: 1,197

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 98% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "question" is answered fastest, typically in about 3 days, while "enhancement" waits about 2 weeks. 36% of tracked open issues have had no activity in three months. Only 5% of issues opened in the past year have been closed.

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. 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. 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...