The Python SDK is on PyPI as mcp. It requires Python 3.10+.
These docs describe v2, the current stable release line:
=== "uv"
```bash
uv add "mcp[cli]"
```
=== "pip"
```bash
pip install "mcp[cli]"
```
!!! note "Coming from v1?"
v2 is a major version with breaking changes; the Migration Guide
covers every one. If your package depends on mcp and isn't ready to migrate, keep a
<2 upper bound (for example mcp>=1.28,<2) so an unpinned resolve stays on the 1.x line.
You don't need to know any of this to use the SDK, but if you're wondering what each dependency is for:
mcp-types: every protocol type (requests, results, content blocks) as its own package, versioned in lockstep with the SDK. Code that depends onmcpimports it through themcp.typesalias (everyfrom mcp.types import ...in these docs); importmcp_typesdirectly only in a project that installsmcp-typeswithout the SDK.anyio: the async runtime. The whole SDK is written against anyio, so it runs on eitherasyncioortrio.pydantic: what everymcp.typesmodel is built on, plus all schema generation and validation.httpx2: the HTTP client behind the Streamable HTTP and SSE client transports, with server-sent events support built in.starlette,uvicorn,sse-starlette, andpython-multipart: the HTTP server transports.jsonschema: validates a tool's structured output against its declared output schema.pyjwt[crypto]: OAuth token handling for authorization.opentelemetry-api: just the lightweight API, so the SDK's tracing middleware costs nothing unless you install an OpenTelemetry SDK and exporter yourself.typing-extensionsandtyping-inspection: modern typing features on Python 3.10.pywin32: Windows only, used forstdiosubprocess management.
mcp[cli]addstyperandpython-dotenvfor themcpcommand-line tool (mcp dev,mcp run,mcp install). You'll want this during development; you may not need it in a deployed server.mcp[rich]addsrichfor nicer server logs.