Skip to content

Cap the delegate extra below mcp 2.0 - #88

Merged
Jason-Vaughan merged 1 commit into
mainfrom
fix/cap-mcp-below-2
Aug 1, 2026
Merged

Cap the delegate extra below mcp 2.0#88
Jason-Vaughan merged 1 commit into
mainfrom
fix/cap-mcp-below-2

Conversation

@Jason-Vaughan

Copy link
Copy Markdown
Owner

Fixes #87.

What

  • pyproject.toml: delegate = ["mcp >= 1.0"]["mcp >= 1.0, < 2"], with a comment explaining what lifting the cap would require.
  • New tests/test_packaging.py asserting the mcp requirement carries an upper bound.
  • CHANGELOG under ### Fixed (patch tier).

Why

mcp 2.0.0 landed 2026-07-28, renaming FastMCP to MCPServer and removing the mcp.server.fastmcp path tanglebrain/mcp_server.py imports. With no upper bound, any fresh resolve pulled 2.0.0 and failed at import — 13 errors on every Python version, on every branch, regardless of its diff. main looked green only because its last CI run predated the release.

This is shipped, not just CI: PyPI's v0.20.0 carries mcp >= 1.0, so pip install "tanglebrain[delegate]" currently produces a delegate server that cannot import. The cap needs a patch release to reach users.

The test exists because a dependency constraint is exercised by no runtime code path. Nothing catches a bad one until an install resolves differently, which here was months after the constraint was written.

Test plan

  • Full suite green locally: 495 tests, 17 skipped (494 before, +1 new).
  • Verified the new test actually fails — temporarily reverted the constraint to mcp >= 1.0, confirmed FAILED (failures=1), restored.
  • Confirmed the local env (mcp 1.27.2) imports mcp.server.fastmcp fine — the code is correct, only the constraint was wrong.
  • CI green on 3.10 / 3.11 / 3.12 (the actual regression signal — this PR is what proves the fix).

Not in scope

Migrating to the 2.x API. The migration itself looks small (swap the import, rename the class; decorators unchanged), but moving the floor to mcp >= 2 drops 1.x users — a compatibility decision that deserves its own issue and test pass, not a ride-along on a hotfix.

mcp 2.0.0 (2026-07-28) renamed FastMCP to MCPServer and removed the
`mcp.server.fastmcp` import path that tanglebrain/mcp_server.py uses. The
extra's open-ended `mcp >= 1.0` therefore resolved to an SDK this code cannot
import: `pip install "tanglebrain[delegate]"` shipped a broken delegate server
in v0.20.0, and CI went red on every branch regardless of its diff.

Constrain to `mcp >= 1.0, < 2` and add tests/test_packaging.py to hold the
upper bound. A dependency constraint is exercised by no runtime code path, so
nothing catches a bad one until an install resolves differently — verified the
new test fails against the uncapped constraint and passes with it.

Migrating to the 2.x API is deliberately not done here: it moves the floor to
`mcp >= 2` and drops 1.x users.

Fixes #87
@cursor

cursor Bot commented Aug 1, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Jason-Vaughan
Jason-Vaughan merged commit 0612df6 into main Aug 1, 2026
3 checks passed
@Jason-Vaughan
Jason-Vaughan deleted the fix/cap-mcp-below-2 branch August 1, 2026 18:58
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.

[bug] mcp 2.0.0 breaks the delegate extra — unbounded 'mcp >= 1.0' pin

1 participant