mirror of
https://github.com/safishamsi/graphify.git
synced 2026-08-28 01:06:36 +00:00
fix(serve): cap the mcp extra below 2.0; AnyUrl fallback for the 2.x SDK
mcp 2.0 removed the low-level decorator API (Server.list_tools/call_tool/ list_resources/read_resource) that serve.py is built on, so an install that resolved the unpinned extra to 2.0.0 crashed at server startup (first at `from mcp.types import AnyUrl`, then at @server.list_tools()). Pin mcp>=1,<2 in the `mcp` and `all` extras; import AnyUrl with a pydantic fallback so that piece is already 2.x-ready. Verified with a full stdio handshake (initialize / tools/list / tools/call) against the installed graphify-mcp with mcp 1.29.0. Porting to the 2.x API is a separate work item. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
committed by
safishamsi
co-authored by
Claude Fable 5
parent
ecfcd160d5
commit
50008cdf36
+6
-1
@@ -1190,9 +1190,14 @@ def _build_server(graph_path: str):
|
||||
try:
|
||||
from mcp.server import Server
|
||||
from mcp import types
|
||||
from mcp.types import AnyUrl
|
||||
except ImportError as e:
|
||||
raise ImportError('mcp not installed. Run: pip install "graphifyy[mcp]"') from e
|
||||
try:
|
||||
from mcp.types import AnyUrl
|
||||
except ImportError:
|
||||
# mcp >= 2.0 dropped the AnyUrl re-export; it was always pydantic's
|
||||
# AnyUrl (pydantic is an mcp dependency, so this import cannot miss).
|
||||
from pydantic import AnyUrl
|
||||
|
||||
from graphify import paths as _paths
|
||||
|
||||
|
||||
Reference in New Issue
Block a user