Skip to content

Update the v2 status banner and pin spawned environments to the running SDK version#2834

Merged
maxisbey merged 2 commits into
mainfrom
v2-readme-and-cli-pin
Jun 11, 2026
Merged

Update the v2 status banner and pin spawned environments to the running SDK version#2834
maxisbey merged 2 commits into
mainfrom
v2-readme-and-cli-pin

Conversation

@maxisbey

Copy link
Copy Markdown
Contributor

Two pre-alpha-release fixes in one PR, per maintainer discussion.

Motivation and Context

README banner: the front-page README.md still described v2 as "pre-alpha, in development". With 2.0.0a1 about to be published, it now states the alpha status, how to install it, the beta/stable target dates, the <2 upper-bound ask for dependent packages, and v1.x's maintenance-mode status. README.md is deliberately frozen on main (it documents v1), so the freeze CI check now honors an override-readme-freeze label for intentional updates like this one; accidental edits stay blocked.

CLI version pinning: mcp dev and mcp install build commands of the form uv run --with mcp ... / uv run --with mcp[cli] .... In a fresh environment an unpinned mcp requirement resolves to the latest stable release - never a pre-release - so a user who installed mcp[cli]==2.0.0a1 and ran mcp dev server.py (outside a uv project) or mcp install got a child environment with v1 in it, and their v2 server failed with ModuleNotFoundError. The mcp install case is the worst variant: the broken command is persisted into Claude Desktop's config. Both sites now pin the requirement to the running SDK version (mcp[cli]==<version>). Source builds carry dev/local version segments that are not on PyPI, so they fall back to the unpinned form.

How Has This Been Tested?

  • Reproduced the failure first: uv run --with mcp python -c "from mcp.server.mcpserver import MCPServer" resolves mcp 1.27.2 and fails the import.
  • New tests for the requirement helper cover all three version shapes (release -> pinned, .dev -> unpinned, +local -> unpinned), and the command-construction tests now mock the SDK version so they are deterministic across environments (the repo venv runs a dev build; CI may produce a different version).
  • tests/cli/ passes (26 tests), 100% branch coverage on src/mcp/cli/*, strict-no-cover clean, pyright and ruff clean.

Breaking Changes

None. Claude Desktop configs written by older versions keep their unpinned form until mcp install is re-run.

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

A companion PR updates the v1.x branch's README with the same v2 status information, since that branch's README is what PyPI renders for the stable line.

AI Disclaimer

…ng SDK version

- README.md banner: v2 is in alpha with pre-releases published to PyPI
  (previously said "pre-alpha, in development"), plus the beta/stable
  target dates, the <2 upper-bound ask for dependents, and v1.x's
  maintenance-mode status. The freeze check in shared.yml now honors an
  override-readme-freeze label so deliberate updates like this one can
  land while accidental edits stay blocked.
- mcp dev and mcp install spawn environments via `uv run --with mcp`,
  which resolves to the latest stable release rather than the version
  the user installed; pre-releases are never selected without an
  explicit pin, so with a v2 pre-release installed the spawned
  environment got v1 and the user's server failed to import. The
  requirement now pins the running version; source builds fall back to
  the unpinned form since dev/local versions are not published to PyPI.
@maxisbey maxisbey added the override-readme-freeze Deliberate edit to the frozen v1 README.md on main; skips the freeze CI check label Jun 11, 2026
Also pin down two test contracts on the new requirement helper: the
dev-version fallback preserves extras, and a user-supplied mcp[cli]
coexists with the pinned requirement rather than deduplicating into it.
@maxisbey maxisbey marked this pull request as ready for review June 11, 2026 08:38
Comment thread tests/cli/test_claude.py
import pytest

from mcp.cli.claude import get_uv_path, update_claude_config
from mcp.cli.claude import get_uv_path, mcp_requirement, update_claude_config

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.

Interesting we have a Claude test but guess it's pre-existing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeaaa it is definitely weird, will have to think whether we add all CLIs later or something

@maxisbey maxisbey merged commit 1e21814 into main Jun 11, 2026
33 checks passed
@maxisbey maxisbey deleted the v2-readme-and-cli-pin branch June 11, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

override-readme-freeze Deliberate edit to the frozen v1 README.md on main; skips the freeze CI check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants