fix: constrain mcp to <2 so the MCP server still starts - #148
Open
tradewithmeai wants to merge 1 commit into
Open
fix: constrain mcp to <2 so the MCP server still starts#148tradewithmeai wants to merge 1 commit into
tradewithmeai wants to merge 1 commit into
Conversation
mcp 2.0.0 was published on 2026-07-28 and removed the decorator-based
registration API. `pyproject.toml` required `mcp>=1.0` with no upper bound,
so every fresh resolve from that point installs 2.x and ContextEngineMCP
raises in __init__:
@self._server.list_tools()
AttributeError: 'Server' object has no attribute 'list_tools'
src/context_engine/integration/mcp_server.py:718
This is not a soft degradation — the server does not start, which is the
primary way the package is used with Claude Code, Cursor and the rest.
`main` CI went red the same day with no source change: the dependency moved
underneath it (success on 562e609 and da47cac 2026-07-13, failure on 675636d
2026-07-28).
Two call sites depend on the removed API — mcp_server.py:718 (list_tools)
and :863 (call_tool). mcp 2.0's Server exposes add_request_handler /
middleware / extensions and nothing matching *tool*, so this is a port, not
a rename.
That port is a design decision for the maintainers — whether to move to
add_request_handler, support both majors behind a shim, or require 2.x and
raise the floor — so this change only restores a working install. See elara-labs#147.
Verified on Windows / Python 3.13, clean venv, `pip install -e ".[dev,local]"`:
tests/test_real_life.py goes from 2 failed / 17 passed to 19 passed once mcp
resolves to 1.29.0 under the new constraint.
tradewithmeai
requested review from
fazleelahhee and
rajkumarsakthivel
as code owners
July 28, 2026 22:43
Author
|
Full-suite verification on the same machine (Windows 11, Python 3.13, clean venv,
Every one of the 33 errors was the same The 2 remaining failures are not related to this change — they reproduce identically on a clean
Both look like a Windows-only path in the liveness check rather than anything to do with mcp. Happy to raise that separately with a repro if it's useful — I didn't want to bundle it into a dependency fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #147.
What broke
mcp 2.0.0was published on 2026-07-28 and removed the decorator-based registration API.pyproject.tomlrequiredmcp>=1.0with no upper bound, so from that moment every fresh resolve installs 2.x andContextEngineMCPraises during construction:It fails in
__init__, so this isn't a degraded feature — the MCP server does not start, which is the primary way the package is used with Claude Code, Cursor and the other listed agents.mainCI went red the same day with no source change; the dependency moved underneath it:675636dda47cac562e609The change
One line, plus a comment saying why it is there and when to remove it:
"mcp>=1.0,<2",Why only a pin
Two call sites depend on the removed API —
mcp_server.py:718(list_tools) and:863(call_tool). mcp 2.0'sServerexposesadd_request_handler,middleware,extensionsand nothing matching*tool*at all, so this is a port rather than a rename.That port is a design decision that belongs to you — move to
add_request_handler, support both majors behind a shim, or require 2.x and raise the floor — so this PR only restores a working install and leaves the direction open. Happy to do the port as a follow-up if you tell me which way you want it.Verification
Windows / Python 3.13, clean venv,
pip install -e ".[dev,local]":tests/test_real_life.pyThe failures were all
AttributeErrorat the same line, in every test whose setup constructsContextEngineMCP.