Skip to content

Commit 63fe92d

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/experimental-server-card
2 parents 5e4acb5 + a4f4ccd commit 63fe92d

347 files changed

Lines changed: 6743 additions & 2859 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,26 @@ body:
1111
id: checks
1212
attributes:
1313
label: Initial Checks
14-
description: Just making sure you're using the latest version of MCP Python SDK.
14+
description: >
15+
Both the 2.x stable line and the 1.x maintenance line are supported, and only
16+
the newest release of each line receives fixes.
1517
options:
16-
- label: I confirm that I'm using the latest version of MCP Python SDK
18+
- label: I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1)
1719
required: true
1820
- label: I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue
1921
required: true
2022

23+
- type: dropdown
24+
id: release-line
25+
attributes:
26+
label: Release line
27+
description: Which major version of the SDK are you using?
28+
options:
29+
- 2.x (current stable)
30+
- 1.x (maintenance line, v1.x branch)
31+
validations:
32+
required: true
33+
2134
- type: textarea
2235
id: description
2336
attributes:

.github/ISSUE_TEMPLATE/v2-feedback.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: v2 feedback
22
description: Bugs, API friction, or docs gaps in v2 of the SDK
33
title: "[v2] "
4-
labels: ["v2-alpha"]
4+
labels: ["v2"]
55

66
body:
77
- type: markdown
88
attributes:
99
value: |
10-
Thanks for trying v2. Anything that broke, surprised you, or slowed you down is useful API feedback is explicitly welcome while v2 is in pre-release.
10+
Anything in v2 that broke, surprised you, or slowed you down is useful, including API friction and docs gaps.
1111
12-
Docs: https://py.sdk.modelcontextprotocol.io/v2/ · Migration from v1: https://py.sdk.modelcontextprotocol.io/v2/migration/
12+
Docs: https://py.sdk.modelcontextprotocol.io/ · Migration from v1: https://py.sdk.modelcontextprotocol.io/migration/
1313
1414
- type: textarea
1515
id: what

.github/actions/conformance/expected-failures.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,23 @@
1010
# scenarios start passing and MUST be removed from this list (the runner fails
1111
# on stale entries), so the baseline burns down per milestone.
1212

13-
client: []
13+
client:
14+
# SEP-1932 (DPoP): the SDK's OAuth client does not implement DPoP proofs.
15+
# The entries are per-check (conformance #406) because both scenarios
16+
# pass their non-DPoP checks (discovery, token acquisition, request
17+
# flow) live.
18+
- auth/dpop:sep-1932-client-token-request-proof
19+
- auth/dpop:sep-1932-client-dpop-auth-scheme
20+
- auth/dpop:sep-1932-client-fresh-proof
21+
- auth/dpop-nonce:sep-1932-client-token-request-proof
22+
- auth/dpop-nonce:sep-1932-client-dpop-auth-scheme
23+
- auth/dpop-nonce:sep-1932-client-fresh-proof
24+
- auth/dpop-nonce:sep-1932-client-as-nonce
25+
- auth/dpop-nonce:sep-1932-client-rs-nonce
26+
# Workload identity federation: the OAuth client does not implement the
27+
# urn:ietf:params:oauth:grant-type:jwt-bearer grant (it answers with
28+
# authorization_code). Per-check for the same reason.
29+
- auth/wif-jwt-bearer:wif-grant-type
1430

1531
server:
1632
# SEP-2663 (io.modelcontextprotocol/tasks): the SDK does not implement the

.github/workflows/conformance.yml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,9 @@ permissions:
1515

1616
env:
1717
# Pinned conformance harness package spec (passed verbatim to `npx --yes`).
18-
# Use a published version, e.g. @modelcontextprotocol/conformance@0.2.0-alpha.7.
1918
# Bump deliberately and reconcile both
2019
# .github/actions/conformance/expected-failures*.yml files in the same change.
21-
#
22-
# Temporarily pinned to the pkg.pr.new build of conformance main@4944b268
23-
# (0.2.0-alpha.8, which includes #372: fail checks whose prerequisite is
24-
# missing instead of skipping them) — alpha.8 is not published to npm yet.
25-
# Pinned by commit SHA so the tarball cannot move under us;
26-
# CONFORMANCE_PKG_SHA256 pins the bytes and the fetch-and-verify step below
27-
# downloads, checks the digest, and repoints CONFORMANCE_PKG at the
28-
# verified local copy. Repin to the next published @modelcontextprotocol/
29-
# conformance release (>=0.2.0-alpha.8) once it ships, then drop
30-
# CONFORMANCE_PKG_SHA256 and the fetch-and-verify steps.
31-
CONFORMANCE_PKG: "https://pkg.pr.new/@modelcontextprotocol/conformance@4944b268"
32-
CONFORMANCE_PKG_SHA256: "0f70c035782d319d72ab427653c5275db5c50429d59fae0241a645b33aeda1a7"
20+
CONFORMANCE_PKG: "@modelcontextprotocol/conformance@0.2.0-alpha.10"
3321

3422
jobs:
3523
server-conformance:
@@ -45,19 +33,6 @@ jobs:
4533
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4634
with:
4735
node-version: 24
48-
- name: Fetch and verify conformance harness
49-
# Only when CONFORMANCE_PKG is a URL: download, check the recorded
50-
# sha256, and re-point CONFORMANCE_PKG at the verified local tarball.
51-
# When CONFORMANCE_PKG is a registry spec, this step is a no-op (npm's
52-
# own integrity check applies).
53-
run: |
54-
case "$CONFORMANCE_PKG" in
55-
https://*)
56-
curl -fsSL "$CONFORMANCE_PKG" -o /tmp/conformance.tgz
57-
echo "$CONFORMANCE_PKG_SHA256 /tmp/conformance.tgz" | sha256sum -c -
58-
echo "CONFORMANCE_PKG=file:/tmp/conformance.tgz" >> "$GITHUB_ENV"
59-
;;
60-
esac
6136
- run: uv sync --frozen --all-extras --package mcp-everything-server
6237
- name: Run server conformance (active suite)
6338
run: >-
@@ -117,19 +92,6 @@ jobs:
11792
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
11893
with:
11994
node-version: 24
120-
- name: Fetch and verify conformance harness
121-
# Only when CONFORMANCE_PKG is a URL: download, check the recorded
122-
# sha256, and re-point CONFORMANCE_PKG at the verified local tarball.
123-
# When CONFORMANCE_PKG is a registry spec, this step is a no-op (npm's
124-
# own integrity check applies).
125-
run: |
126-
case "$CONFORMANCE_PKG" in
127-
https://*)
128-
curl -fsSL "$CONFORMANCE_PKG" -o /tmp/conformance.tgz
129-
echo "$CONFORMANCE_PKG_SHA256 /tmp/conformance.tgz" | sha256sum -c -
130-
echo "CONFORMANCE_PKG=file:/tmp/conformance.tgz" >> "$GITHUB_ENV"
131-
;;
132-
esac
13395
# --compile-bytecode: without it, ~40 concurrently spawned interpreters
13496
# race to byte-compile site-packages during the timing-sensitive window.
13597
- run: uv sync --frozen --all-extras --package mcp --compile-bytecode

.github/workflows/deploy-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ name: Deploy Docs
33
on:
44
push:
55
branches:
6+
# main is the sole deployer of the combined site (v2 at / and /v2/, v1.x
7+
# at /v1/); the v1.x branch has no deploy workflow. A v1.x docs change is
8+
# published by the next main deploy or a manual workflow_dispatch here.
69
- main
7-
- v1.x
810
paths:
911
- docs/**
1012
# docs pages include their code blocks from these files via `--8<--`, so a
@@ -48,7 +50,7 @@ jobs:
4850
enable-cache: true
4951
version: 0.9.5
5052

51-
- name: Build combined docs (v1.x at /, main at /v2/)
53+
- name: Build combined docs (main at / and /v2/, v1.x at /v1/)
5254
run: bash scripts/build-docs.sh site
5355

5456
- name: Configure Pages

.github/workflows/shared.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: mcp-types installs and imports standalone
5252
run: |
5353
uv run --isolated --no-project --with ./src/mcp-types python -c \
54-
"import mcp_types, mcp_types.jsonrpc, mcp_types.methods, mcp_types.version, mcp_types.v2025_11_25, mcp_types.v2026_07_28"
54+
"import mcp_types, mcp_types.jsonrpc, mcp_types.methods, mcp_types.version, mcp_types._v2025_11_25, mcp_types._v2026_07_28"
5555
5656
test:
5757
name: test (${{ matrix.python-version }}, ${{ matrix.dep-resolution.name }}, ${{ matrix.os }})

AGENTS.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
## Branching Model
44

5-
<!-- TODO: drop this section once v2 ships and main becomes the stable line -->
6-
7-
- `main` is currently the V2 rework.
8-
- Breaking changes are expected here — removing or replacing an API must be
9-
intentional. Adding a replacement API or `@deprecated` shim must likewise be
10-
a deliberate design choice, not bolted on for free.
11-
- Breaking changes (including those softened by a backwards-compatibility
12-
shim) must be documented in `docs/migration.md`.
13-
- `v1.x` is the release branch for the current stable line. Backport PRs target
14-
this branch and use a `[v1.x]` title prefix.
5+
- `main` is the current stable line (v2); releases are cut from it (see
6+
`RELEASE.md`).
7+
- Removing or replacing an API must be intentional, and what shipped in 2.x
8+
is public surface. Adding a replacement API or `@deprecated` shim is
9+
likewise a deliberate design choice, not bolted on for free.
10+
- Changes that break code written against v1 (including those softened by a
11+
backwards-compatibility shim) must be documented in `docs/migration.md`.
12+
- `v1.x` is the maintenance branch for the previous major. Backport PRs
13+
target it and use a `[v1.x]` title prefix; only critical bug fixes and
14+
security fixes land there.
1515
- `README.md` documents v2. The v1 README lives on the `v1.x` branch.
1616

1717
## Package Management

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ uv tool install pre-commit --with pre-commit-uv --force-reinstall
7676

7777
| Change Type | Target Branch | Example |
7878
|-------------|---------------|---------|
79-
| New features, breaking changes | `main` | New APIs, refactors |
79+
| New features and fixes for v2 | `main` | New APIs, refactors |
8080
| Security fixes for v1 | `v1.x` | Critical patches |
81-
| Bug fixes for v1 | `v1.x` | Non-breaking fixes |
81+
| Critical bug fixes for v1 | `v1.x` | Backports of severe bugs |
8282

83-
> **Note:** `main` is the v2 development branch. Breaking changes are welcome on `main`. The `v1.x` branch receives only security and critical bug fixes.
83+
> **Note:** `main` is the current stable line (v2). The `v1.x` branch is the previous major's maintenance line and receives only security and critical bug fixes.
8484
8585
2. Create a new branch from your chosen base branch
8686

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
</div>
1515

16-
> [!CAUTION]
17-
> **This README documents v2 of the MCP Python SDK — a pre-release (alpha/beta) line under active development. Do not use v2 in production.** Pre-releases are published to PyPI as `2.0.0aN` / `2.0.0bN`, and **each pre-release may contain breaking changes from the previous one**. Pin an exact version and expect to update your code when you bump the pin.
16+
> [!NOTE]
17+
> **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](https://modelcontextprotocol.io/specification/2026-07-28) (and every earlier revision) and to fix long-standing architectural issues. Coming from v1? See [What's new in v2](https://py.sdk.modelcontextprotocol.io/whats-new/) for the tour of what changed and the [migration guide](https://py.sdk.modelcontextprotocol.io/migration/) for every breaking change.
1818
>
19-
> **v1.x is the only stable release line and remains recommended for production.** It lives on the [`v1.x` branch](https://github.com/modelcontextprotocol/python-sdk/tree/v1.x) and continues to receive critical bug fixes and security patches; see [the v1.x README](https://github.com/modelcontextprotocol/python-sdk/blob/v1.x/README.md) for its documentation. `pip` and `uv` don't select a pre-release unless you explicitly request one, so existing installs are unaffected. **If your package depends on `mcp`, add a `<2` upper bound to your version constraint (for example `mcp>=1.27,<2`) before the stable release lands.**
19+
> **Not ready to migrate?** v1.x lives on the [`v1.x` branch](https://github.com/modelcontextprotocol/python-sdk/tree/v1.x), 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.
2020
>
21-
> v2 is a major rework of the SDK, both to support the [2026-07-28 MCP specification release](https://blog.modelcontextprotocol.io/posts/2026-07-28-release-candidate/) and to fix long-standing architectural issues. See [What's new in v2](https://py.sdk.modelcontextprotocol.io/v2/whats-new/) for the tour of what changed, and the [migration guide](https://py.sdk.modelcontextprotocol.io/v2/migration/) for every breaking change. Stable v2 is targeted for 2026-07-27, alongside the spec release. Try the pre-releases and [tell us what breaks](https://github.com/modelcontextprotocol/python-sdk/issues/new?template=v2-feedback.yaml), or discuss in [#python-sdk-dev on the MCP Contributors Discord](https://discord.gg/6CSzBmMkjX).
21+
> Something rough, confusing, or broken? [Open an issue](https://github.com/modelcontextprotocol/python-sdk/issues/new?template=v2-feedback.yaml) or find us in [#python-sdk-dev on the MCP Contributors Discord](https://discord.gg/6CSzBmMkjX).
2222
2323
## Documentation
2424

25-
**The documentation lives at <https://py.sdk.modelcontextprotocol.io/v2/>.**
25+
**The documentation lives at <https://py.sdk.modelcontextprotocol.io/>.**
2626

27-
It has a [Get started guide](https://py.sdk.modelcontextprotocol.io/v2/get-started/), [What's new in v2](https://py.sdk.modelcontextprotocol.io/v2/whats-new/), the [API reference](https://py.sdk.modelcontextprotocol.io/v2/api/mcp/), and the [migration guide](https://py.sdk.modelcontextprotocol.io/v2/migration/).
27+
It has a [Get started guide](https://py.sdk.modelcontextprotocol.io/get-started/), [What's new in v2](https://py.sdk.modelcontextprotocol.io/whats-new/), the [API reference](https://py.sdk.modelcontextprotocol.io/api/mcp/), and the [migration guide](https://py.sdk.modelcontextprotocol.io/migration/).
2828

2929
## What is MCP?
3030

@@ -41,10 +41,10 @@ Python 3.10+.
4141
## Installation
4242

4343
```bash
44-
uv add "mcp[cli]==2.0.0b1" # or: pip install "mcp[cli]==2.0.0b1"
44+
uv add "mcp[cli]" # or: pip install "mcp[cli]"
4545
```
4646

47-
The pin matters while v2 is in pre-release: an unpinned install resolves to the latest stable v1.x, which this README does not describe. Check [PyPI](https://pypi.org/project/mcp/#history) for the newest pre-release, and use `uv run --with "mcp==2.0.0b1"` for one-off commands.
47+
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.
4848

4949
## A server in 15 lines
5050

@@ -82,7 +82,7 @@ Call `add` with `a=1`, `b=2` and you get `3` back.
8282

8383
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.
8484

85-
[Get started](https://py.sdk.modelcontextprotocol.io/v2/get-started/) takes it from here.
85+
[Get started](https://py.sdk.modelcontextprotocol.io/get-started/) takes it from here.
8686

8787
## A client in 10 lines
8888

@@ -122,7 +122,7 @@ This project is licensed under the MIT License. See the [LICENSE](https://github
122122
[python-badge]: https://img.shields.io/pypi/pyversions/mcp.svg
123123
[python-url]: https://www.python.org/downloads/
124124
[docs-badge]: https://img.shields.io/badge/docs-python--sdk-blue.svg
125-
[docs-url]: https://py.sdk.modelcontextprotocol.io/v2/
125+
[docs-url]: https://py.sdk.modelcontextprotocol.io/
126126
[protocol-badge]: https://img.shields.io/badge/protocol-modelcontextprotocol.io-blue.svg
127127
[protocol-url]: https://modelcontextprotocol.io
128128
[spec-badge]: https://img.shields.io/badge/spec-spec.modelcontextprotocol.io-blue.svg

0 commit comments

Comments
 (0)