Skip to content

mcp: unconstrained 2.x dependency breaks the bundled vault_fs server #138

Closed

Description

@hossainzarif23

What happens

A fresh editable installation resolves the MCP Python SDK to 2.x because the orchestrator currently declares:

"mcp>=1.2"

The bundled tools/vault_fs_server.py still imports the MCP 1.x API:

from mcp.server.fastmcp import FastMCP

MCP 2.x removed that import path and renamed FastMCP to MCPServer. Consequently, the bundled vault server fails immediately after a clean installation.

Reproduce

From a fresh clone:

git clone https://github.com/blitzcrieg1/agentmetry.git
cd agentmetry\apps\orchestrator

python -m venv venv
venv\Scripts\Activate
python -m pip install --upgrade pip
pip install --no-cache-dir -e ".[dev]"

Confirm the dependency selected by pip:

pip show mcp

Result at the time of reproduction:

Name: mcp
Version: 2.1.1

Import the API used by the bundled server:

python -c "from mcp.server.fastmcp import FastMCP; print('FastMCP import OK')"

Result:

Traceback (most recent call last):
  ...
ModuleNotFoundError: No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP was renamed to MCPServer (from mcp.server.mcpserver import MCPServer) and other APIs changed

The same failure occurs through the repository's bundled server:

python tools\vault_fs_server.py

It exits immediately at:

from mcp.server.fastmcp import FastMCP

Application impact

When the orchestrator starts with the bundled vault_fs driver configured, the driver subprocess exits with this import error instead of mounting its tools.

The orchestrator log reports:

Driver vault_fs failed: unhandled errors in a TaskGroup (1 sub-exception)

In the observed setup, this also delayed application startup long enough for agentmetry start to exceed its 20-second health window and report that health did not respond, even though the API became available later. The direct and deterministic failure is that the bundled driver is incompatible with the dependency version selected by a fresh installation.

Control

Constraining MCP to the current 1.x line fixes the import without changing application source:

pip install --force-reinstall "mcp<2"

This installed MCP 1.29.1 in the reproduced environment. The original import then succeeded:

python -c "from mcp.server.fastmcp import FastMCP; print('FastMCP import OK')"

Result:

FastMCP import OK

After restarting the orchestrator, the bundled driver mounted successfully:

Driver vault_fs mounted: 3 tool(s)

Likely cause

The declared dependency range permits two incompatible major SDK generations:

"mcp>=1.2"

The bundled server is implemented against the MCP 1.x API, but there is no upper bound preventing pip from selecting MCP 2.x.

Possible resolutions

Two reasonable directions appear available:

  1. Constrain the existing implementation to the compatible SDK generation:

    "mcp>=1.2,<2"

    This is the smallest immediate fix.

  2. Migrate vault_fs_server.py and any other MCP integrations to the MCP 2.x API, then update the dependency constraint accordingly.

The preferred compatibility policy is left to the maintainer. But I think a migration to MCP 2.x API would be better.

Expected behavior

Every dependency version permitted by pyproject.toml should be compatible with the bundled MCP servers. After a fresh documented installation, tools/vault_fs_server.py should start without an SDK import error and the vault_fs driver should mount normally.

Done when

  • A fresh pip install -e ".[dev]" cannot resolve an MCP version incompatible with the bundled server.
  • tools/vault_fs_server.py starts without ModuleNotFoundError.
  • The orchestrator mounts the bundled vault_fs driver successfully.
  • CI includes a smoke test that imports or starts the bundled MCP server using dependencies selected from pyproject.toml, preventing a future incompatible major release from silently entering the supported range.

I would be happy to work on a focused fix once the preferred direction—pinning MCP 1.x or migrating the bundled server to MCP 2.x—is confirmed.

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