docs/index.md
!!! info "You are viewing the in-development v2 documentation" For the current stable release, see the v1.x documentation. Trying v2? Tell us what you find — it is the most useful thing you can do for the SDK right now.
The Model Context Protocol (MCP) lets applications provide context to LLMs in a standardized way, separating the concern of providing context from the LLM interaction itself.
This is the official Python SDK for it. With it you can:
Python 3.10+.
=== "uv"
```bash
uv add "mcp[cli]==2.0.0b1"
```
=== "pip"
```bash
pip install "mcp[cli]==2.0.0b1"
```
The [cli] extra gives you the mcp command; you'll want it for development.
!!! warning "Pin the version while v2 is in beta"
Installers never select a pre-release unless you name one, so an unpinned uv add "mcp[cli]"
gives you the latest v1.x release, which this documentation does not describe. Check
PyPI for the newest beta before you copy the line
above. See Installation for the details.
Create a file server.py:
--8<-- "docs_src/index/tutorial001.py"
That's a complete MCP server.
It exposes one tool, add, and one templated resource, greeting://{name}.
uv run mcp dev server.py
This starts your server and opens the MCP Inspector, an interactive UI for poking at it. Open the URL it prints.
!!! note
The Inspector is a Node.js app, so mcp dev needs npx on your PATH.
In the Inspector, go to Tools and call add with a=1, b=2.
You get 3 back. ✨
The Inspector built that form (a required integer field for a, another for b) from your type hints. So will Claude, and every other MCP host.
Now go to Resources and read greeting://World:
Hello, World!
Look again at what you did not write:
a: int, b: int is the schema.You wrote two Python functions with type hints and a docstring. The SDK does the rest.