fix(packaging): define MCP optional dependency - #619
Closed
alooshxl wants to merge 1 commit into
Closed
Conversation
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.
Closes #608.
Problem
When MCP is missing,
create_server()points users at an extra that the package does not define:[project.optional-dependencies]onmaindeclaresbrowser,cookies,all, anddev— there is nomcpextra. Following the printed command therefore reinstalls Agent Reach without the MCP dependency, and the next run prints the same message:Change
pyproject.toml: addmcp = ["mcp[cli]>=1.0"], reusing the exact requirement already listed in theallextra.tests/test_mcp_server.py: add two regressions — one asserting the[project.optional-dependencies]block declares that extra, one asserting that withHAS_MCPfalsecreate_server()exits with status 1 and namesagent-reach[mcp]on stderr.The metadata test reads
pyproject.tomlas UTF-8 text instead of parsing TOML, following the existing precedent intests/test_youtube_channel.py, so it needs no TOML parser on Python 3.10. The missing-dependency test patchesHAS_MCPand does not require MCP to be uninstalled from the test environment.Verification
Run on this branch (Windows, Python 3.14.5, pytest 9.1.1, ruff 0.16.3, mypy 2.3.0):
python -m pytest tests/test_mcp_server.py -vpython -m ruff check agent_reach testspython -m mypy agent_reachgit diff --checkpython -m pytest tests/ -vpython -m pip install --dry-run ".[mcp]"mcp-2.0.0(warns about an unknown extra onmain)The metadata test was confirmed to fail before the
pyproject.tomledit and to pass after it. MCP is not installed in the environment these tests ran in, so the missing-dependency path is exercised for real.The 4 failures are pre-existing in this local environment and unrelated to this change: the symlink security tests in
tests/test_channels.pyandtests/test_reddit_channel.pyraiseOSError: [WinError 1314] A required privilege is not held by the clientbecause this Windows account cannot create symlinks. They fail identically onmainbefore this change (baseline: 4 failed, 554 passed, 28 skipped), and #616 addresses them separately.Scope
agent_reach/integrations/mcp_server.py, its tool contract, or its install message.allextra is unchanged.