Repository navigation
Description
pyproject.toml declares mcp>=1.27.0 in the tools extra, so any unlocked
pip install "mellea[tools]" resolves mcp to 2.x, where the server API was renamed and
the model fields moved to snake_case. uv.lock pins 1.27.0, so every CI path except the
new Colab job installs 1.x and stays green. The Colab job caught this on its first run.
Worked out by hand against mcp 2.2.0; docs/examples/notebooks/mcp_example.ipynb is
currently pinned to mcp<2 as a stopgap, which this issue should remove.
Mechanical parts
- Server class:
mcp.server.fastmcp.FastMCP->mcp.server.mcpserver.MCPServer. The
decorator surface (tool,resource,run) is unchanged anduv run mcp devstill
works, so call sites need only the import and the constructor renamed. Note that
mcp.server.fastmcpstill exists in 2.x as a tombstone that raisesModuleNotFoundError
with a migration hint. - Field renames, camelCase -> snake_case (
isError,inputSchema,mimeType):
mellea/stdlib/tools/mcp.pylines 140, 305, 321, 329, 338;test/stdlib/tools/test_mcp.py
lines 41, 64, 206, 223, 241, 362. With just these 11 edits all 33 tests in
test/stdlib/tools/test_mcp.pypass under 2.2.0.
The part that needs a decision
_open_session's streamable-http branch in mellea/stdlib/tools/mcp.py:
:265unpacks a 3-tuple, but 2.x'sstreamable_http_clientyields(read_stream, write_stream):266passes anhttpx.AsyncClient, but the signature ishttp_client: httpx2.AsyncClient | None
mcp 2.x depends on httpx2>=2.5.0, a distribution separate from httpx (in a clean mcp-2
environment httpx is not installed at all). So the mcp module would run on httpx2 while
mellea/backends/ollama.py stays on httpx, leaving mellea with two HTTP stacks, and the
tools extra's httpx>=0.27 needs revisiting.
Test gap
The 33 unit tests mock the ClientSession, so the streamable-http transport never executes.
Only mypy caught both breakages above. Worth adding coverage that exercises the real
transport construction.
Also needs updating
docs/docs/integrations/mcp.md— 5 code spots, plus thepip install "mcp[cli]"
prerequisite on line 14docs/examples/mcp/mcp_example.py— lines 14 and 29, plus the install hint in its docstringdocs/examples/notebooks/mcp_example.ipynb— drop themcp<2stopgap- Leave
docs/versioned_docs/version-0.7.0/integrations/mcp.mdalone; it is a frozen
snapshot that correctly documents 1.x
Unrelated bug found nearby
docs/docs/integrations/mcp.md:9 credits jlowin/fastmcp,
but the code imports the official SDK's server, not that third-party project. Wrong
attribution today, independent of the version question.
Activity
pavani42 commentedon Nov 10, 2026
Hi, is this issue ready to be picked up? If yes, I'd be happy to take it. Could you please assign it to me? Thanks!
Ankur1911 commentedon Nov 20, 2026
@pavani42 are you still working on this? I have a branch that runs the MCP integration on both mcp 1.27 and 2.3 (stdio, HTTP and SSE; 42 MCP tests pass on each). Happy to open it as a PR, or to leave this to you and share the test cases instead — whichever you and the maintainers prefer.
pavani42 commentedon Nov 20, 2026
@Ankur1911 I didn't started on this, pls go ahead and open PR