mcp 2.2.0


pip install mcp

  Latest version

Released: Sep 07, 2026


Meta
Author: Model Context Protocol a Series of LF Projects, LLC.
Maintainer: David Soria Parra, Marcelo Trylesinski, Max Isbey, Felix Weinberger
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Programming Language
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

MCP Python SDK

Python implementation of the Model Context Protocol (MCP)

PyPI MIT licensed Python Version Documentation Protocol Specification

[!NOTE] This is v2 of the MCP Python SDK, the current stable release line. It is a major rework of the SDK, both to support the 2026-07-28 MCP specification (and every earlier revision) and to fix long-standing architectural issues. Coming from v1? See What's new in v2 for the tour of what changed and the migration guide for every breaking change.

Not ready to migrate? v1.x lives on the v1.x branch, continues to receive critical bug fixes and security patches, and is documented at https://py.sdk.modelcontextprotocol.io/v1/. Since pip install mcp now installs 2.x, keep a <2 upper bound on your requirement (for example mcp>=1.28,<2) until you've migrated.

Something rough, confusing, or broken? Open an issue or find us in #python-sdk-dev on the MCP Contributors Discord.

Documentation

The documentation lives at https://py.sdk.modelcontextprotocol.io/.

It has a Get started guide, What's new in v2, the API reference, and the migration guide.

What is MCP?

The Model Context Protocol lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but designed for LLM interactions. With this SDK you can:

  • Build MCP servers that expose tools, resources, and prompts to any MCP host
  • Build MCP clients that connect to any MCP server
  • Speak every standard transport: stdio, Streamable HTTP, and SSE

Requirements

Python 3.10+.

Installation

uv add "mcp[cli]"      # or: pip install "mcp[cli]"

The cli extra adds the mcp command-line tool (mcp dev, mcp run, mcp install) on top of the SDK; install plain mcp if you don't need it. For one-off commands, uv run --with "mcp[cli]" mcp ... works without a project.

A server in 15 lines

Create a server.py:

from mcp.server import MCPServer

mcp = MCPServer("Demo")


@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b


@mcp.resource("greeting://{name}")
def greeting(name: str) -> str:
    """Greet someone by name."""
    return f"Hello, {name}!"

Full example: docs_src/index/tutorial001.py

That's a complete MCP server: one tool, one templated resource. Open it in the MCP Inspector:

uv run mcp dev server.py

Call add with a=1, b=2 and you get 3 back.

Notice what you did not write: no JSON Schema (a: int, b: int is the schema), no request parsing, no validation code, no protocol handling. Two type-hinted Python functions and a docstring.

Get started takes it from here.

A client in 10 lines

The same package is a full MCP client. Serve server.py over HTTP:

uv run mcp run server.py --transport streamable-http

then point a Client at it:

import asyncio

from mcp import Client


async def main() -> None:
    async with Client("http://localhost:8000/mcp") as client:
        result = await client.call_tool("add", {"a": 1, "b": 2})
        print(result.structured_content)  # {'result': 3}


asyncio.run(main())

A URL means Streamable HTTP, the transport you deploy. Client can also launch a local server as a stdio subprocess or take any custom transport; Clients has the rest.

Contributing

We are passionate about supporting contributors of all levels of experience and would love to see you get involved in the project. See the contributing guide to get started.

License

This project is licensed under the MIT License. See the LICENSE file for details.

2.2.0 Sep 07, 2026
2.1.1 Aug 25, 2026
2.1.0 Aug 24, 2026
2.0.1 Aug 26, 2026
2.0.0 Jul 28, 2026
2.0.0rc1 Jul 27, 2026
2.0.0b2 Jul 14, 2026
2.0.0b1 Jun 30, 2026
2.0.0a3 Jun 26, 2026
2.0.0a2 Jun 16, 2026
2.0.0a1 Jun 11, 2026
1.30.0 Sep 07, 2026
1.29.1 Aug 24, 2026
1.29.0 Jul 28, 2026
1.28.1 Jun 26, 2026
1.28.0 Jun 16, 2026
1.27.2 May 29, 2026
1.27.1 May 08, 2026
1.27.0 Apr 02, 2026
1.26.0 Jan 24, 2026
1.25.0 Dec 19, 2025
1.24.0 Dec 12, 2025
1.23.3 Dec 09, 2025
1.23.2 Dec 08, 2025
1.23.1 Dec 02, 2025
1.23.0 Dec 02, 2025
1.22.0 Nov 20, 2025
1.21.2 Nov 17, 2025
1.21.1 Nov 13, 2025
1.21.0 Nov 06, 2025
1.20.0 Oct 30, 2025
1.19.0 Oct 24, 2025
1.18.0 Oct 16, 2025
1.17.0 Oct 10, 2025
1.16.0 Oct 02, 2025
1.15.0 Sep 25, 2025
1.14.1 Sep 18, 2025
1.14.0 Sep 11, 2025
1.13.1 Aug 22, 2025
1.13.0 Aug 14, 2025
1.12.4 Aug 07, 2025
1.12.3 Jul 31, 2025
1.12.2 Jul 24, 2025
1.12.1 Jul 22, 2025
1.12.0 Jul 17, 2025
1.11.0 Jul 10, 2025
1.10.1 Jun 27, 2025
1.10.0 Jun 26, 2025
1.9.4 Jun 12, 2025
1.9.3 Jun 05, 2025
1.9.2 May 29, 2025
1.9.1 May 22, 2025
1.9.0 May 15, 2025
1.8.1 May 12, 2025
1.8.0 May 08, 2025
1.7.1 May 02, 2025
1.7.0 May 01, 2025
1.6.0 Mar 27, 2025
1.5.0 Mar 21, 2025
1.4.1 Mar 14, 2025
1.4.0 Mar 13, 2025
1.3.0 Feb 20, 2025
1.3.0rc1 Feb 13, 2025
1.2.1 Jan 27, 2025
1.2.0 Jan 03, 2025
1.2.0rc1 Dec 23, 2024
1.1.3 Jan 03, 2025
1.1.2 Dec 12, 2024
1.1.1 Dec 09, 2024
1.1.0 Dec 03, 2024
1.0.0 Nov 25, 2024
0.9.1 Nov 20, 2024

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
anyio (>=4.10)
anyio (>=4.9)
httpx2 (>=2.5.0)
jsonschema (>=4.20.0)
mcp-types (==2.2.0)
opentelemetry-api (>=1.28.0)
pydantic (>=2.12.0)
pyjwt[crypto] (>=2.10.1)
python-multipart (>=0.0.9)
pywin32 (>=311)
sse-starlette (>=3.0.0)
starlette (>=0.27)
starlette (>=0.48.0)
typing-extensions (>=4.13.0)
typing-inspection (>=0.4.1)
uvicorn (>=0.31.1)