You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Core raises the legacy MCP SDK ToolError from mcp.server.fastmcp.exceptions, even though the server runtime is FastMCP 3.x and hosted middleware handles fastmcp.exceptions.ToolError.
Those are different Python classes. As a result, a structured hosted API error can escape the Cloud middleware as a bare tool failure instead of being converted into the intended friendly MCP result.
Evidence
Core currently imports the legacy class in the shared HTTP helper:
src/basic_memory/mcp/tools/utils.py:33
several individual tools and project-context paths use the same import
Cloud's tenant API returns a structured 403 subscription_required response with a subscribe URL.
Core's HTTP helper catches httpx.HTTPStatusError and wraps it in the legacy SDK ToolError.
Cloud middleware catches the FastMCP runtime ToolError.
The class mismatch bypasses conversion, so tools such as recent_activity surface only Active subscription required instead of the actionable subscription result.
Cloud can temporarily recognize both classes, but Core should emit the exception type owned by its active FastMCP runtime.
Proposed fix
While Core remains on FastMCP 3.x, replace legacy mcp.server.fastmcp.exceptions.ToolError imports with fastmcp.exceptions.ToolError across the MCP tool/runtime surface.
Keep the original httpx.HTTPStatusError as the explicit cause so hosted middleware can inspect structured response details.
Add a focused regression test proving the shared HTTP helper raises the FastMCP runtime class and preserves the HTTP cause.
Audit tests and deferred imports that still name the legacy SDK class.
Acceptance criteria
Core MCP tools consistently raise the ToolError class expected by the active FastMCP runtime.
Shared HTTP helpers preserve httpx.HTTPStatusError as __cause__.
Hosted middleware can catch a Core tool error without a compatibility import for the legacy MCP SDK class.
Summary
Core raises the legacy MCP SDK
ToolErrorfrommcp.server.fastmcp.exceptions, even though the server runtime is FastMCP 3.x and hosted middleware handlesfastmcp.exceptions.ToolError.Those are different Python classes. As a result, a structured hosted API error can escape the Cloud middleware as a bare tool failure instead of being converted into the intended friendly MCP result.
Evidence
Core currently imports the legacy class in the shared HTTP helper:
src/basic_memory/mcp/tools/utils.py:33Under the currently locked dependencies:
The concrete hosted failure is:
403 subscription_requiredresponse with a subscribe URL.httpx.HTTPStatusErrorand wraps it in the legacy SDKToolError.ToolError.recent_activitysurface onlyActive subscription requiredinstead of the actionable subscription result.Cloud can temporarily recognize both classes, but Core should emit the exception type owned by its active FastMCP runtime.
Proposed fix
mcp.server.fastmcp.exceptions.ToolErrorimports withfastmcp.exceptions.ToolErroracross the MCP tool/runtime surface.httpx.HTTPStatusErroras the explicit cause so hosted middleware can inspect structured response details.Acceptance criteria
ToolErrorclass expected by the active FastMCP runtime.httpx.HTTPStatusErroras__cause__.Related