Skip to content

Port graphify/serve.py to the mcp 2.x API (currently capped at mcp<2) #2308

Closed

Description

@safishamsi

0.9.30 caps mcp>=1,<2 to unbreak fresh installs (#2277/#2279/#2291). This tracks the durable fix: adapting the MCP server to the mcp 2.0 API so the cap can be lifted.

What 2.0.0 changed that graphify/serve.py relies on:

  • mcp.types.AnyUrl re-export was dropped (serve.py imports it and constructs types.Resource(uri=AnyUrl(...))); 2.0 Resource.uri is a plain str and rejects a pydantic AnyUrl.
  • The Server decorator-registration API (@server.list_tools(), @server.call_tool(), @server.list_resources(), @server.read_resource()) was removed in favor of add_request_handler/add_notification_handler.

So this is a real port of the server registration + resource plumbing, not a one-liner. Options: migrate to the 2.x API (then widen the cap to allow 2.x), or add dual-major support. Include the CI improvement from #2291: a smoke test that does a real initialize + tools/list handshake against a fresh .[mcp] resolve, since graphify-mcp --help exits 0 and hides this class of breakage.

Activity

  1. safishamsi commented on Jul 30, 2026

    @safishamsi
    MemberAuthor

    Done in v0.9.31 (#2311, thanks @NiSHoW). serve.py is now dual-compatible with the mcp SDK 1.x and 2.x, and the mcp<2 cap from 0.9.30 is lifted to mcp>=1,<3. A fresh install resolves mcp 2.0.0 and the server imports/handshakes cleanly. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions