Labsco
KoyoYeager logo

mcp-pystub

from KoyoYeager

Auto-detect stubbable packages for Python exe builds (PyInstaller/Nuitka) and generate minimal stub code to reduce executable size

🔥🔥🔥✓ VerifiedFreeQuick setup

⌁ labsco summary — our analysis, not the vendor's

What it is — An MCP server that auto-detects stubbable packages when building Python apps into executables (PyInstaller/Nuitka/cx_Freeze) and generates minimal stub code to shrink the binary.

What you get

  • analyze — parse the import graph to find safe-to-stub packages plus submodule hints for eliminating C-extensions
  • graph to visualize imports, check for deep per-package usage analysis
  • generate / generate_submodule to emit minimal stub code plus build instructions
  • Verdicts (stubbable / nofollow / required) from AST-only analysis — the README shows an asammdf exe cut 40% (431MB → 259MB) by stubbing asammdf.gui to drop PySide6

Requirements — none — runs out of the box (empty env, no keys); point it at your Python project.

Cost snapshot — free and MIT-licensed. No paid service.

Setup effort — self-host/run as an MCP server (Python).

Our take — A concrete, data-backed size-reducer for Python exe builds that finds stub candidates you'd otherwise hand-tune; caveat: stubbing is inherently risky — it relies on AST reachability analysis, so a package it marks "stubbable" but that's loaded dynamically could break at runtime (the tool provides backup/restore/verify steps for that reason).

Source: the project README — summarized 2026-07-08.