Skip to content

[BUG] Unbounded mcp[cli] pin resolves to mcp 2.0.0, which removed mcp.server.fastmcp — devops_mcp.registry fails at import #34

Closed

Description

@Nitjsefnie

Bug Description

requirements.txt:15 pins mcp[cli]>=1.9.0 with no upper bound. mcp 2.0.0 went to PyPI on
2026-07-28 and removed mcp.server.fastmcp, which devops_mcp/registry.py:10 imports:

from mcp.server.fastmcp import FastMCP

So a fresh install now resolves mcp 2.0.0 and devops_mcp.registry fails at import. That takes down
the MCP server itself, not only the test that happens to catch it.

pyproject.toml does not constrain mcp either.

This is already failing on main and it is not caused by anything in flight. CI's last run on
main (29958346236) was green on 2026-07-22, six days before mcp 2.0.0 existed — the green badge
predates the breakage. CI's test job installs exactly -r requirements.txt with no lockfile and no
cached pin, and has no continue-on-error, so the next run should go red on all three matrix
Pythons.

Steps to Reproduce

On an unmodified checkout of main (1736350), in a clean virtualenv:

  1. pip install -r requirements.txt
  2. pip show mcp → Version: 2.0.0
  3. TESTING=true python -c "import devops_mcp.registry"
  4. TESTING=true pytest tests/test_mcp.py -v

Expected Behavior

A fresh install of the pinned requirements produces a working import of devops_mcp.registry, and the
suite is green on a clean checkout.

Actual Behavior

Step 3, the direct import:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import devops_mcp.registry
  File "devops_mcp/registry.py", line 10, in <module>
    from mcp.server.fastmcp import FastMCP
ModuleNotFoundError: No module named 'mcp.server.fastmcp'

Step 4, the test — note it reports a different exception, which is worth knowing so the output
matches when you run it:

E           AttributeError: module 'devops_mcp' has no attribute 'registry'
/usr/local/lib/python3.13/pkgutil.py:528: AttributeError

tests/test_mcp.py:19 patches devops_mcp.registry.FastMCP, and mock.patch resolves that through
pkgutil.resolve_name, which swallows the ImportError (except ImportError: break) and falls back
to getattr. Same root cause, different surface.

The module really is gone in 2.0 — mcp/server/ now contains __init__.py, __main__.py,
_otel.py, apps.py, auth, caching.py, connection.py, context.py, elicitation.py,
extension.py, lowlevel, mcpserver, models.py and others, with no fastmcp.

Environment

  • OS: Debian 13 (x86_64)
  • Python Version: 3.13.14 — reproduced there; the failure is a removed dependency module rather
    than anything version-specific, so it should reproduce identically on the 3.10/3.11/3.12 CI matrix
  • Agent Version/Commit: main @ 1736350

Found while working #29. It is a separate problem from that one — #29 is a conflict between
requirements.txt and requirements-dev.txt, this is an unbounded pin inside requirements.txt
itself, and they share no file, line or fix.

Happy to send a PR if you want it, though the choice between capping the pin (mcp[cli]>=1.9.0,<2)
and migrating the import to whatever 2.0 replaced FastMCP with is yours — the cap is the smaller
change, the migration is the one that keeps you current.

Activity

  1. Nitjsefnie commented on Aug 5, 2026

    @Nitjsefnie
    ContributorAuthor

    Closing — the defect is fixed upstream: #38 capped mcp[cli]>=1.9.0,<2.0.0 (verified locally: mcp 2.0.0 + the unbounded pin reproduces the mcp.server.fastmcp ModuleNotFoundError; the capped pin resolves 1.29.0 and the test passes). #44 adds the rationale comment above the pin so a future bump does not silently remove the cap.

  2. added 2 commits that reference this issue on Aug 17, 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