Skip to content

fix: declare mcp as required dependency in setup.py - #86

Draft
nam20485 wants to merge 1 commit into
AI-Hypercomputer:mainfrom
nam20485:fix/missing-mcp-dependency
Draft

fix: declare mcp as required dependency in setup.py#86
nam20485 wants to merge 1 commit into
AI-Hypercomputer:mainfrom
nam20485:fix/missing-mcp-dependency

Conversation

@nam20485

@nam20485 nam20485 commented Aug 8, 2026

Copy link
Copy Markdown

Summary

The HITL agent fails to import with ModuleNotFoundError: No module named 'mcp' because the mcp package is never installed during setup. It is imported unconditionally by the agent code and transitively by google.adk, but it was never declared as a dependency.

Error

File ".../MaxKernel/hitl_agent/tools/filesystem_tools.py", line 5, in <module>
    from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
File ".../.venv/lib/python3.12/site-packages/google/adk/tools/mcp_tool/mcp_session_manager.py", line 59, in <module>
    from mcp import ClientSession
ModuleNotFoundError: No module named 'mcp'

Root cause

mcp is an optional extra of google-adk (mcp>=1.24,<2 ; extra == "mcp"), but the agent imports it unconditionally. It was not declared in:

  • setup.pyinstall_requires (was [])
  • No requirements.txt files exist

The prepare_hitl_agent.sh script runs pip install -e . (line 187), which uses setup.py — so mcp was never installed.

Fix

Add mcp>=1.24,<2 to install_requires in setup.py:

-  install_requires=[],
+  install_requires=[
+    "mcp>=1.24,<2",
+  ],

Note: mcp 2.0.0 has breaking API changes and is not compatible with google-adk. The <2 constraint matches what google-adk itself declares.

Testing

Verified that after pip install -e ., from mcp import ClientSession and from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams both succeed, and the agent loads without import errors.

@google-cla

google-cla Bot commented Aug 8, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates MaxKernel/setup.py to add mcp to the install_requires list. The reviewer recommends also adding google-adk to install_requires because it is imported in the codebase but currently missing from the declared dependencies.

Comment thread MaxKernel/setup.py
Comment on lines +11 to +13
install_requires=[
"mcp>=1.24,<2",
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The codebase directly imports from google.adk (e.g., in auto_agent/agent.py and hitl_agent/tools/filesystem_tools.py), but google-adk is not declared in install_requires. To ensure a clean installation works without missing dependencies, please add google-adk to the list of required packages.

  install_requires=[
    "google-adk",
    "mcp>=1.24,<2",
  ],

@nam20485
nam20485 marked this pull request as draft August 8, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant