Track SEP-3371 (consistent SDK extension points): gaps on main
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- json, python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
This is a tracking issue for design-level gaps in the Python SDK's extension surface, not a single change. Start from the table's linked files: src/mcp/server/extension.py, src/mcp/server/lowlevel/server.py (the middleware chain), and docs/advanced/middleware.md. Done means a maintainer-agreed scope for middleware coverage, dependency declaration and stability, and a plan for the conformance fixtures in modelcontextprotocol/conformance#606.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
SEP-3371 (Consistent SDK Extension Points) was accepted by Core Maintainer vote on 28 November 2026. I'm the SEP author, and this issue tracks where main stands against it.
The SEP requires Tier 1 SDKs to provide three public extension points for protocol version 2026-07-28 and later: extension registration, custom methods, and JSON-RPC middleware. The API shape is the SDK's choice; only the outcomes are required. It takes effect with the first specification release after the SEP reaches Final.
This builds on the SEP-2133 work in #2793.
Where main stands
Based on reading the code at 77001c96. Nothing was built or run, so corrections are welcome.
Already met: extension registration by identifier with duplicate rejection in both roles, capability declaration through settings(), typed server-side custom requests with core-name and duplicate rejection, and a documented outermost-first middleware order.
| Area | Status | Detail |
|---|---|---|
| Registration | Met | Extension / ClientExtension are validated by identifier and fixed at construction; a duplicate identifier raises. server.py:336, client.py:235 |
| Dependencies | Gap | No way for an extension to declare a dependency on a core capability or another extension. |
| Custom requests | Partial | Server MethodBinding gives typed, validated handlers; the client sends vendor requests through session.send_request. No extension-level handler for server-to-client custom requests. extension.py:133 |
| Custom notifications | Partial | Client NotificationBinding observes vendor notifications; server extensions contribute request methods only. |
| Method conflicts | Partial | Server rejects core and duplicate methods at construction; a client notification binding shadowed by a core name only warns. extensions.md:299 |
| Middleware coverage | Partial | Server.middleware wraps every inbound server message. Nothing wraps outgoing server messages, and the client has no middleware. Extensions cannot contribute middleware; their one hook, intercept_tool_call, covers tools/call only. lowlevel/server.py:448, extension.py:137 |
| Middleware abilities | Partial | Inbound middleware can observe, refuse, rewrite params and answer early, but only on raw params before validation. |
| Streams | Gap | Outgoing progress and subscriptions/listen notifications bypass middleware. |
| Ordering | Partial | middleware[0] is outermost and extension interceptors nest in registration order, both documented; applications cannot place their middleware between extension layers, because the two chains are separate. middleware.md:31, extensions.md:157 |
| Stability | Gap | The middleware list is marked provisional ("may change in a 2.x minor release"). middleware.md:8 |
| Documentation | Partial | Extensions and middleware have their own pages; SEP-3371 is not mentioned per role. |
| Packaging docs (SHOULD) | Partial | "Writing your own" covers authoring; declaring SDK compatibility is not covered. |
Main gaps
- No middleware on the sending side or on the client, and extensions cannot contribute general middleware.
- Streamed messages (progress,
subscriptions/listen) bypass middleware. - Middleware is provisional, which the SEP's stability requirement rules out.
- No dependency declaration for extensions.
- No
SEP-3371statement per role.
Not verified
- Whether server extensions can register inbound custom notifications through
MethodBinding. - Whether the low-level
Server.extensionsmapping (id to settings) is public API that setup code can use to list registered extensions.server.py:352 - Preservation of unknown and nested
_metathrough validation.
Conformance
The conformance approach is proposed in modelcontextprotocol/conformance#606. It would have the Python conformance fixtures install small synthetic extensions built only on the SDK's public APIs.
What would help
- Corrections to the table above.
- A maintainer view on which gaps you would close and how; the SEP leaves the design to each SDK. The closed contribution surface ("the walls are the feature") is compatible with the SEP as long as middleware can be one of the declared contributions.
- Whether a maintainer has time to work on this with me. I can help with the conformance fixture.
AI assistance: the code read and this write-up were done with Claude at my direction.
- Ngôn ngữ chính
- Python
- Star
- 25k
- Fork
- 4.2k
- Merge trung bình
- 10 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/python-sdk
-
v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
modelcontextprotocol/python-sdk#3978 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Client serves cached tools after its context exits with an exceptionCó thể đã có người làm @jonxsong đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
modelcontextprotocol/python-sdk#3968 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
modelcontextprotocol/python-sdk#3957 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
modelcontextprotocol/python-sdk#3934 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug v1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
modelcontextprotocol/python-sdk#3929 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/python-sdk
Issue tương tự
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwiseCó thể đã có người làm @abdulwaarith0 đã nhận hôm nay. Đang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
MakazhanAlpamys/Soup#3690 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug data-types native-format
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ClickHouse/clickhouse-connect#1320 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Public benchmark import end-to-end test fails when the test stack's worker runs the parity jobĐang mởaccepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
future-agi/future-agi#6392 ·
Maintainer thường phản hồi trong vòng 1 ngày