Skip to content

graphify-mcp fails on fresh installation with ImportError: cannot import name 'AnyUrl' from mcp.types #2279

Closed

Description

@ekosanto2008

Environment

  • OS: Windows 11
  • Python: 3.13.5
  • Graphify: 0.9.29
  • Installed using:
    uv tool install "graphifyy[mcp]"

Steps to reproduce

  1. Install Graphify:
uv tool install "graphifyy[mcp]"
  1. Build a graph:
graphify extract . --code-only
  1. Run the MCP server:
graphify-mcp D:\apps\ims\graphify-out\graph.json

Expected behavior

The MCP server should start and wait for client connections.

Actual behavior

The server immediately exits with the following error:

Traceback (most recent call last):
  File "...graphify\serve.py", line 1116, in _build_server
    from mcp.types import AnyUrl
ImportError: cannot import name 'AnyUrl' from 'mcp.types'

...

ImportError: mcp not installed. Run: pip install "graphifyy[mcp]"

Additional information

The installation completed successfully:

  • graphify 0.9.29
  • mcp 2.0.0
  • mcp-types 2.0.0

The CLI (graphify) works correctly.
graphify extract also works correctly.

The problem only occurs when starting the MCP server (graphify-mcp or python -m graphify.serve).

It looks like Graphify imports AnyUrl from mcp.types, but this symbol is not available in the installed mcp package.

I can reproduce this without Antigravity.

The following command also fails:

graphify-mcp D:\apps\ims\graphify-out\graph.json

It immediately throws:

ImportError: cannot import name 'AnyUrl' from 'mcp.types'

So this appears to be an issue in the MCP server itself rather than the Antigravity integration.

I investigated the issue further.

graphify.serve imports:

from mcp.types import AnyUrl

This is located at:

graphify/serve.py:1116

However, the installed package:

C:\Users\<username>\AppData\Roaming\uv\tools\graphifyy\Lib\site-packages\mcp\types\__init__.py

does not export AnyUrl.

Running:

Select-String -Path "...graphify\serve.py" -Pattern "AnyUrl"

returns several usages.

Running:

Select-String -Path "...mcp\types\__init__.py" -Pattern "AnyUrl"

returns no results.

So it appears Graphify expects AnyUrl from mcp.types, but the version of mcp installed by:

uv tool install "graphifyy[mcp]"

does not provide it.

Activity

  1. smartweb-dev commented on Jul 29, 2026

    @smartweb-dev

    I can confirm this issue on another Windows machine.

    Environment

    • Windows 11
    • Python 3.12
    • Graphify 0.9.29

    Installed using:

    python -m uv tool install "graphifyy[mcp,gemini,sql]"

    Result

    Everything except MCP works correctly:

    • ✅ graphify extract
    • ✅ graphify update
    • ✅ graphify hook install
    • ✅ graphify cursor install
    • ✅ DeepSeek backend
    • ✅ graph.json generated
    • ✅ GRAPH_REPORT.md generated

    The MCP server fails immediately with:

    ImportError: cannot import name 'AnyUrl' from 'mcp.types'
    

    Cursor MCP also fails with the same traceback.

    My installation contains:

    • mcp 2.0.0
    • mcp_types 2.0.0

    Looks like another confirmation that Graphify 0.9.29 is incompatible with MCP 2.0.0.

  2. Diwas2055 commented on Jul 29, 2026

    @Diwas2055

    I was able to reproduce the issue on a fresh installation. The root cause appears to be an incompatibility between the current graphify-mcp release and newer versions of the mcp SDK. Specifically, graphify-mcp imports AnyUrl from mcp.types, but that symbol is no longer available in the latest mcp versions, resulting in:

    ImportError: cannot import name 'AnyUrl' from 'mcp.types'

    As a temporary workaround, the following steps resolve the issue:

    # Remove any existing installation
    uv tool uninstall graphify
    
    # Install graphify with MCP support
    pip3 install --break-system-packages "graphify[mcp]"
    
    # Pin the MCP SDK to a compatible version
    pip3 install --break-system-packages --upgrade "mcp==1.29.0"
    

    After downgrading to mcp==1.29.0, graphify-mcp starts and works as expected.

    It would be helpful to either:

    update graphify-mcp to support the latest mcp SDK, or
    pin the compatible mcp version in the package dependencies until compatibility is restored.

  3. smartweb-dev commented on Jul 29, 2026

    @smartweb-dev

    Thanks! My installation uses uv tool install "graphifyy[mcp,gemini,sql]" rather than a global pip install. Is there a recommended way to pin mcp==1.29.0 inside the uv tool environment, or is reinstalling via pip currently the only supported workaround?

  4. safishamsi commented on Jul 29, 2026

    @safishamsi
    Member

    Fixed in v0.9.30 (same root as #2277): mcp is capped below 2.0, resolving to 1.29.0, so graphify-mcp starts on a fresh install again. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.30

  5. added a commit that references this issue on Jul 29, 2026
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