litellm - ✅(Solved) Fix [Bug]: mcp tool registry recurring package installs [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25486Fetched 2026-04-11 06:13:59
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×2cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #25491: fix recurring package installs for stdio mcp servers

Description (problem / solution / changelog)

Relevant issues

fixes #25486

flow: install only pinned npm packages for mcp servers to ensure safety, cache tools and prevent re-downloading packages everytime a subprocess from being spawned

<img width="896" height="252" alt="Capture d’écran, le 2026-04-10 à 08 28 21" src="https://github.com/user-attachments/assets/4a7690d6-2e98-4c95-9bdc-f27aa447b7ff" /> <img width="896" height="287" alt="Capture d’écran, le 2026-04-10 à 08 34 59" src="https://github.com/user-attachments/assets/edf468e1-e654-4d49-9e99-ee7660d33f87" />

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

<!-- Select the type of Pull Request --> <!-- Keep only the necessary ones -->

🆕 New Feature 🐛 Bug Fix 🧹 Refactoring 📖 Documentation 🚄 Infrastructure ✅ Test

Changes

Changed files

  • litellm/proxy/_experimental/mcp_server/mcp_server_manager.py (modified, +153/-1)
  • tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py (modified, +164/-2)
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

any stdio mcp server (specifically npm) keeps downloading every time it fetches tools from that server. two major concerns:

  • security issue: not safe to install a package multiple times only pin to safe versions
  • high latency - everything stops working until this package is installed

Steps to Reproduce

  1. add a playwright stdio mcp server from the UI
  2. fetch tools
  3. use it in playground or even just switch tabs and observe console logs

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.83.3

Twitter / LinkedIn details

No response

extent analysis

TL;DR

Implement a caching mechanism or version pinning for the stdio mcp server to prevent repeated downloads of the same package.

Guidance

  • Investigate the package installation process to identify why the package is being re-downloaded every time tools are fetched from the server.
  • Consider implementing version pinning to ensure that only safe and specific versions of the package are installed.
  • Review the console logs to understand the sequence of events leading to the repeated package downloads.
  • Evaluate the feasibility of implementing a caching layer to store frequently accessed packages and reduce the latency associated with repeated downloads.

Example

No specific code example can be provided without more information about the implementation details of the stdio mcp server and the package installation process.

Notes

The exact solution may depend on the specific requirements and constraints of the LiteLLM application and the stdio mcp server.

Recommendation

Apply a workaround, such as implementing a caching mechanism or version pinning, to mitigate the security and latency concerns associated with repeated package downloads.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Bug]: mcp tool registry recurring package installs [1 pull requests, 1 participants]