Skip to content

Add mcp to the llm extra for litellm 1.108.2 - #2

Closed
matthewmcneely wants to merge 1 commit into
hydra-db:mainfrom
matthewmcneely:fix/llm-extra-mcp
Closed

matthewmcneely wants to merge 1 commit into
hydra-db:mainfrom
matthewmcneely:fix/llm-extra-mcp

Conversation

@matthewmcneely

@matthewmcneely matthewmcneely commented Nov 6, 2026 •

Copy link
Copy Markdown

This PR adds mcp>=2.2 to the llm extra so pip install "selfgraph[llm]" works with litellm 1.108.2.

litellm's plain completion path in 1.108.2 imports mcp, but litellm only declares it under its proxy and mcp extras. Without it, every insert.text through DefaultExtractor fails with ModuleNotFoundError: No module named 'mcp' before a request goes out.

The floor is >=2.2 rather than the >=1.2 used by dev and all. litellm itself asks for mcp>=2.2.0,<3, and mcp 1.2 doesn't import against current pydantic anyway. selfgraph.mcp.server still imports fine on mcp 2.3, and the all extra resolves to the higher floor.

Testing

Fresh Python 3.12 venvs, both resolving litellm==1.108.2:

Install import litellm.responses.mcp.chat_completions_handler
selfgraph[llm] from main ModuleNotFoundError: No module named 'mcp'
selfgraph[llm] from this branch ok (mcp 2.3.0)

Also ran LLM extraction end to end against Anthropic with mcp installed. ruff check and ruff format --check pass.

Closes #1


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

This is PR 1 of 3 you may keep open at a time.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

This PR has no linked approved issue. Open an issue, get it discussed and /approved by a maintainer, then link it here with Closes #N. Closing for now; reopen once linked. (Fastest help: the #pr-discussion channel on Discord.)

Maintainers: reopen this PR to override the gate (it gets the gate-override label).

@github-actions github-actions Bot closed this Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

This PR has no linked approved issue. Open an issue, get it discussed and /approved by a maintainer, then link it here with Closes #N. Closing for now; reopen once linked. (Fastest help: the #pr-discussion channel on Discord.)

Maintainers: reopen this PR to override the gate (it gets the gate-override label).

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The dependency change appears safe to merge.

Summary

Adds mcp>=2.2 to the llm extra to address the reported missing import with litellm 1.108.2.

  • The LLM extra installs mcp for Litellm's completion path.

Reviews (1) · Last reviewed commit: "Add mcp to the llm extra for litellm 1.1..." · Reviewed by Greptile

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.

litellm 1.108.2 breaks the [llm] extra: ModuleNotFoundError: No module named 'mcp'

1 participant