MCP SDK for Python 1
Last reviewed Oct 12, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- MCP SDK for Python 190 lines · 4.3K tokens
Total245 lines · 8.1K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 78
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 306
- 319
- 328
- 338
- 346
- 347
- 367
- 379
- 409
- 416
- 426
- 427
- 470
- 488
- 502
- 522
- 532
- 611
- 613
- 674
- 732
- 770
- 772
- 776
- 807
- 829
- 862
- 863
- 916
- 918
- 1104
- 1284
- 1333
- 1395
- 1426
- 1427
Prompt Preview
Apply the Python 3 baseline first. These rules cover the mcp package on its 1.x maintenance line: FastMCP and low-level servers, the stdio, SSE, and Streamable HTTP transports, OAuth resource-server authentication, tools, resources, elicitation, and client-side process spawning.
Version scope and protocol negotiation
- Constrain
mcpto the 1.x maintenance line with an upper bound such as<2and let the lock file record the exact release, so a resolve never moves to the 2.x line, which is a different API surface and a different protocol era. The SDK ships 1.x security fixes in new 1.x releases, sometimes only in a new minor rather than a patch to the current one, so move to the newest 1.x release when one ships and re-check these rules against it. - Run 1.x on a security-supported CPython minor verified with the deployed SDK and integrations.
requires-python >=3.10and the 3.10 classifier describe package compatibility, not interpreter support: CPython 3.10 is end of life. 1.30.0 advertises and runs CI for 3.10 through 3.14, so use 3.11 through 3.14 within that matrix. CPython 3.15 is maintained upstream but outside it; verify that interpreter and the resolved integrations separately before deploying on it. Keep the higher Pydantic, Starlette and Windowspywin32requirements 1.30.0 declares for Python 3.14. - Treat 2025-11-25 as the newest revision this line negotiates and do not write handlers that depend on fields or lifecycle behavior introduced after it.
- A non-initialize Streamable HTTP request with no
MCP-Protocol-Versionheader is treated as