GitShow/modelcontextprotocol/python-sdk
modelcontextprotocol

python-sdk

The official Python SDK for Model Context Protocol servers and clients

by modelcontextprotocol
Star on GitHubForkWebsite

Python

23.5k stars3.6k forks192 contributorsActive · 10h agoSince 2024v1.28.1MIT

Meet the team

See all 192 on GitHub →
dsp-ant
dsp-ant244 contributions
maxisbey
maxisbey157 contributions
Kludex
Kludex110 contributions
ihrpr
ihrpr59 contributions
jspahrsummers
jspahrsummers39 contributions
felixweinberger
felixweinberger38 contributions
nick-merrill
nick-merrill18 contributions
jerome3o-anthropic
jerome3o-anthropic13 contributions

Languages

View on GitHub →
Python100%
Shell0%
HTML0%

Commit activity

Last 12 weeks · 125 commits

Full graph →

Community health

5 of 6 standards met

Community profile →
87
✓README✓License✓Contributing✓Code of Conduct○Issue Template✓PR Template

Recent PRs & issues

Active · Last activity 10h ago
See all on GitHub →
Sehlani042
fix(client): unblock streamable HTTP calls on early SSE closeOpenPR

Summary Fixes a streamable HTTP client hang when a POST request receives an SSE response that closes before sending a JSON-RPC response. This targets #1577. It overlaps with the older #1578, but keeps the current-main patch narrow: preserve the existing reconnect behavior when a resumable event id is available, and only resolve the pending request with the existing SDK error when there is no response and no resumable event to follow. Root Cause consumed the POST SSE stream and returned silently if the stream ended before a response and no had been observed. Because no or transport exception was written to the read stream, the JSON-RPC dispatcher kept the corresponding waiter pending forever. Changes Send a correlated when a POST SSE response closes before a reply and cannot be resumed. Also resolve the pending request with if reconnection attempts are exhausted. Add a non-SDK server regression test that closes an SSE response without a JSON-RPC reply and asserts raises instead of hanging. Validation

Sehlani042 · 8m ago
Sehlani042
fix(client): surface streamable HTTP 401 as JSON-RPC errorOpenPR

Summary map bare Streamable HTTP 401 POST responses for JSON-RPC requests to a correlated JSON-RPC error instead of the generic fallback keep existing JSON-RPC error bodies, 404 pre-session, and session-terminated handling unchanged add a regression test for operation-specific authorization failures Fixes #1295. Verification RED: failed with vs GREEN: Note: the local Homebrew uv is 0.9.4 while this repo requires >=0.9.5, so verification used an isolated binary.

Sehlani042 · 1h ago
Robin1987China
[Bug] validate_tool_use_result_messages raises false positive when tool_use is not followed by tool_resultOpenIssue

Bug Description in raises a false when a block in the previous message is not followed by a block in the last message. Spec Context Per SEP-1577: blocks MUST be preceded by a block ✅ (already checked) There is no requirement that must be followed by A plain text response after a is valid. Reproduction Root Cause Line 83 runs the ID-matching check outside the block: Fix (proposed) Add to the condition: AI Disclosure Bug discovered with AI assistance (opencode).

Robin1987China · 1h ago
Structured data for AI agents

Repository: modelcontextprotocol/python-sdk. Description: The official Python SDK for Model Context Protocol servers and clients Stars: 23507, Forks: 3599. Primary language: Python. Languages: Python (100%), Shell (0%), HTML (0%). License: MIT. Homepage: https://py.sdk.modelcontextprotocol.io/ Latest release: v1.28.1 (5d ago). Open PRs: 100, open issues: 419. Last activity: 10h ago. Community health: 87%. Top contributors: dsp-ant, maxisbey, Kludex, ihrpr, jspahrsummers, felixweinberger, nick-merrill, jerome3o-anthropic, calclavia, dependabot[bot] and others.

·@ofershap

Replace github.com with gitshow.dev