Repository navigation
fix: resolve MCP registry test CI failure - #38
Merged
Merged
Conversation
Remove unnecessary patch() calls that failed with AttributeError when unittest.mock tried to resolve devops_mcp.registry before the submodule was loaded. register_agent_tools only uses the mcp/agent mocks passed in. Co-authored-by: Cursor <[email protected]>
mcp 2.0.0 on PyPI no longer provides mcp.server.fastmcp, which broke CI and the registry import. Pin to >=1.9.0,<2.0.0 and test register_agent_tools with mock mcp/agent instances directly. Co-authored-by: Cursor <[email protected]>
This was referenced Aug 5, 2026
OkiriGabriel
pushed a commit
that referenced
this pull request
Aug 17, 2026
The <2.0.0 cap landed in PR #38 but with no rationale in the file, so a future bump could silently re-remove it. mcp 2.0.0 removed mcp.server.fastmcp, which devops_mcp/registry.py and devops_mcp/server.py import; without the cap a fresh install resolves mcp 2.0.0 and tests/test_mcp.py::test_register_agent_tools_registers_all_tools fails at import (ModuleNotFoundError: No module named 'mcp.server.fastmcp'). Co-Authored-By: Kimi K3 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_mcp.py::test_register_agent_tools_registers_all_toolson CIpatch("devops_mcp.registry.*")calls that raisedAttributeError: module 'devops_mcp' has no attribute 'registry'register_agent_toolsdirectly and passes mockmcp/agent(which is all the function uses)Context
This failure was blocking PRs #35, #36, and #37 — all unrelated to MCP; they were failing on the same pre-existing main CI issue.
Test plan
pytest tests/test_mcp.py -v(passes whenmcpis installed, as in CI)Made with Cursor