Skip to content

docs: add a "What's new in v2" page#3054

Merged
maxisbey merged 4 commits into
mainfrom
docs-whats-new
Jul 2, 2026
Merged

docs: add a "What's new in v2" page#3054
maxisbey merged 4 commits into
mainfrom
docs-whats-new

Conversation

@maxisbey

@maxisbey maxisbey commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Add a single new page, What's new in v2 (docs/whats-new.md), that gives someone glancing at the v2 beta the high-level tour in two halves: what changed in the SDK between v1 and v2, and what the 2026-07-28 protocol revision changes as this SDK surfaces it. Every section is a few sentences plus a link to the page that owns the topic.

Motivation and Context

The docs have a complete Migration Guide (about 1,700 lines, exhaustive by design) and, since the restructure, a page per topic, but nothing that answers the first question an upgrader or evaluator has: what is new, and why should I care? The v2.0.0b1 release notes answer that well for one release; this page is the durable, ranked version of that story inside the docs, written for someone who builds MCP servers or clients, not for a spec reader.

The page's shape (mirroring the two-part structure the v2.0.0b1 release notes already use):

  • The SDK: v1 to v2: the FastMCP to MCPServer rename (and what did not change), the new first-class Client, the rebuilt low-level Server, the mcp-types split plus snake_case fields, transport configuration moving to run(), the behavior changes that arrive without an import error, and the removals.
  • The protocol: 2025-11-25 to 2026-07-28: no handshake and no session (and what that means for deployment, stated with its honest qualifiers), multi-round-trip requests replacing server-initiated requests (with the one "your tests hit this first" warning), the SEP-2577 deprecations plus the ping removal, subscriptions/listen, and a short list of the rest (routing headers, cache hints, error codes, auth hardening, extensions, OpenTelemetry).
  • Upgrading from v1?: the Migration Guide, the v1.x maintenance posture, and the v2 feedback template.

Two editorial rules were enforced throughout, because a page like this fails by overclaiming: nothing v1 already had is presented as v2 news, and every protocol fact carries its honest scope (stateless_http is a legacy-leg-only option and is not why 2026-07-28 traffic is sessionless; the client-side subscriptions/listen driver is not shipped yet; the tasks extension is not implemented yet).

Two behavior changes the page states had no entry in the Migration Guide, so this PR also adds them there (short sections, per the repository's own rule that behavior changes are documented in docs/migration.md): synchronous def handlers now run on a worker thread, and mcp dev / mcp install now pin the environment they spawn to the installed SDK version.

Also in this PR, so the page is discoverable: a nav entry (top level, right after the index), a link from the docs home page and the README, and the page's path added to the docs example linter's allowlist so its fenced code is ruff-checked in CI like every other page's.

How Has This Been Tested?

  • mkdocs build --strict is clean, and under strict mode a broken link, a broken anchor (including the eight migration.md#... deep links the page makes), a bad --8<-- include, and a page missing from the nav are each a build failure.
  • The docs test suites pass: 976 tests (from 973; the three new cases are the new page's fenced blocks, now linted by tests/test_examples.py). The page adds no new docs_src/ files: its two runnable examples are existing, already-tested files included from a second page.
  • ./scripts/test (coverage, branch mode, fail_under = 100) passes, and all pre-commit hooks pass.
  • Every factual claim on the page was checked against the code at both origin/v1.x and main (not against other docs), then independently re-checked, and the rendered site was exercised end to end: the page renders with both includes resolved, the nav and home-page links land on it, every migration.md anchor it links exists in the built HTML, and the llms.txt build hook picks it up.

Breaking Changes

None. Documentation only.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

  • The page deliberately carries almost no code of its own: one three-line rename fence and two --8<-- includes of existing tested examples. Everything else is prose that ends in a link to the page that owns the topic, so there is no second copy of any explanation to drift.
  • The page intentionally has no version pin: RELEASE.md keeps a list of the files that carry the release pin, and this page stays off it by linking Installation instead.
  • Nav placement (a top-level entry right after the home page) is an editorial call: the target reader is someone evaluating the beta, and the home page's banner now routes them here. Happy to move it next to the Migration Guide at the bottom instead if that grouping is preferred.

AI Disclaimer

Add docs/whats-new.md, a two-part tour for someone glancing at the v2
beta: the v1 -> v2 SDK changes (the MCPServer rename and what did not
change, the first-class Client, the rebuilt low-level Server, the
mcp-types split and snake_case fields, transport configuration moving to
run(), the behavior changes that arrive without an import error, and the
removals) and the 2025-11-25 -> 2026-07-28 protocol changes as this SDK
surfaces them (no handshake or session and what that means for
deployment, multi-round-trip requests replacing server-initiated
requests, the SEP-2577 deprecations and the ping removal,
subscriptions/listen, and the smaller items). Every section ends in a
link to the page that owns the topic; the only code is one rename fence
plus two existing, already tested docs_src includes.

Wire the page up: a top-level nav entry right after the index, links
from the docs home page and the README, and the page's path in the docs
example linter's allowlist so its fenced code is ruff-checked in CI.

Two behavior changes the page states had no entry in the migration
guide, so add them there too: sync def handlers now run on a worker
thread (Breaking Changes), and mcp dev / mcp install now pin the
spawned environment to the installed SDK version (Bug Fixes).
@maxisbey maxisbey marked this pull request as ready for review July 2, 2026 10:35
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📚 Documentation preview

Preview https://pr-3054.mcp-python-docs.pages.dev
Deployment https://1372614f.mcp-python-docs.pages.dev
Commit fc3ebfd
Triggered by @maxisbey
Updated 2026-07-02 13:56:28 UTC

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more

Re-trigger cubic

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found — but this adds a substantial new user-facing docs page with many specific claims about SDK/protocol behavior, plus an explicitly-open editorial call on nav placement, so it deserves a maintainer read.

Extended reasoning...

Overview

Docs-only PR: a new ~140-line docs/whats-new.md page, a nav entry in mkdocs.yml, links from README.md and docs/index.md, two new sections in docs/migration.md (sync handlers on worker threads; mcp dev/mcp install version pinning), and the new page added to the tests/test_examples.py docs-lint allowlist. No source code under src/ is touched.

Security risks

None. No executable code changes; the only test change adds a path to an existing allowlist so the page's fenced code is ruff-linted in CI.

Level of scrutiny

The change carries no runtime risk, but it is a prominent, front-of-nav page making dozens of concrete technical claims about v2 behavior (error codes, NoBackChannelError semantics, subscriptions/listen caveats, deployment guidance around request_state keys, SEP references). The claims I cross-checked against the migration guide and repo conventions are consistent, and the author reports mkdocs build --strict and the docs test suites pass, but full factual verification of every claim is exactly the kind of editorial review a maintainer should do for a page this visible. The PR description also explicitly leaves the nav placement decision open for maintainer preference.

Other factors

The two new migration-guide sections document behavior changes per the repository's own rule, which is appropriate scope for this PR. The page reuses existing tested docs_src/ examples rather than adding new ones, keeping drift risk low. No prior reviews or comments exist on this PR.

maxisbey added 3 commits July 2, 2026 13:45
Show the same one-tool server written for v1 and for v2 in the 'rebuilt,
not renamed' section, with code annotations carrying the contrasts: how
the request context is reached (ambient ContextVar vs the ctx argument),
return wrapping (bare lists vs full result models), argument validation
(enforced jsonschema in v1 vs advertised-only in v2), exception polarity
(isError=True text the model reads vs a sanitized -32603 protocol
error), and registration (decorators vs constructor arguments).

The v2 half is a tested file, docs_src/whats_new/tutorial001.py, driven
end to end by tests/docs_src/test_whats_new.py (schema advertised
verbatim; a call missing a required argument reaches the handler and
comes back as the sanitized protocol error). The v1 half cannot import
in CI, so it stays an inline fence with a comment recording its ground
truth: the exact code was run verbatim against a real mcp==1.28.1
install.
One call_tool handler serves every tool, so both halves of the
before/after now check the name, and the check doubles as the live
demo of the error-polarity contrast: v1 raises ValueError because the
message comes back as CallToolResult(isError=True) text the model
reads; v2 raises MCPError(INVALID_PARAMS, ...) because a bare
exception would be sanitized to -32603, and -32602 with this message
is the spec's own answer for an unknown tool. New test proves the
raised MCPError passes through with code and message intact.
Surface the Resolve dependency interface in the SDK half as the
preferred way to ask the client for input mid-call (era-portable:
live elicitation for legacy clients, multi-round-trip on 2026-07-28),
with a note that ctx.elicit() for legacy connections and hand-built
InputRequiredResult remain, each pointing at its owning page.
@maxisbey maxisbey merged commit e4d95e0 into main Jul 2, 2026
37 checks passed
@maxisbey maxisbey deleted the docs-whats-new branch July 2, 2026 14:01

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found in the code-facing parts of this PR — the new docs_src example and its tests follow the repo's patterns, and I verified the two new migration-guide claims (sync handlers via anyio.to_thread.run_sync, mcp dev/install pinning via mcp_requirement()) against the source. Deferring to a human since the bulk of this PR is a large editorial page whose factual claims and nav placement (which you explicitly flag as an open question) are a maintainer's call.

Extended reasoning...

Overview

This PR is documentation-only: a new ~210-line "What's new in v2" page (docs/whats-new.md), two new sections in docs/migration.md (sync handlers on a worker thread; mcp dev/install version pinning), links from README.md and docs/index.md, an mkdocs nav entry, one new tested example (docs_src/whats_new/tutorial001.py) with a matching test file, and an addition to the docs example linter's allowlist. No runtime library code is touched.

Security risks

None. No source code under src/ changes; the only executable additions are a docs example and its tests.

Level of scrutiny

The code-adjacent pieces are small and check out: the new example follows the low-level Server pattern documented in the migration guide, the tests use the in-memory Client pattern the repo prescribes, and I verified the two new migration-guide behavior claims against the source (anyio.to_thread.run_sync in the mcpserver handlers/resolvers, and mcp_requirement() pinning in src/mcp/cli/claude.py). The bulk of the PR, however, is a long editorial page making many behavioral and protocol claims; while the author describes a thorough verification process, a page of this scope and prominence (top-level nav, linked from the README banner) warrants a maintainer's editorial review rather than a bot approval.

Other factors

The author explicitly asks for maintainer input on nav placement (top-level entry vs. next to the Migration Guide), which is an open design question only a human can settle. No bugs were found by the automated review, and there are no outstanding reviewer comments. mkdocs strict mode and the docs test suites reportedly cover link/anchor/include integrity in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants