
Pystub
Ship a frozen Python .exe without import errors by auto-finding packages that need stubs and emitting minimal stub modules.
Overview
io.github.KoyoYeager/pystub is an MCP server for the Build phase that auto-detects Python packages needing stubs for exe builds and generates minimal stub code.
What is this MCP server?
- Scans the project for packages that commonly break frozen builds and flags stub candidates
- Generates minimal stub code so agents do not hand-roll empty modules package by package
- Published on PyPI as mcp-pystub with stdio transport for local Claude Code / Cursor wiring
- Targets Python desktop/CLI distributions rather than web-only deployments
- Version 0.1.1 in the official MCP server schema with GitHub source at KoyoYeager/mcp-pystub
- PyPI package identifier: mcp-pystub at version 0.1.1
- Transport: stdio
- Repository: github.com/KoyoYeager/mcp-pystub
What problem does it solve?
Frozen Python builds fail on hidden imports and you waste hours guessing which packages need empty stub modules.
Who is it for?
Solo builders shipping PyInstaller or similar frozen CLI/desktop apps who want agent-assisted stub fixes.
Skip if: Pure web/API projects deployed only via Docker or serverless with no frozen binary step.
What do I get? / Deliverables
Your agent gets a concrete stub list and generated stubs so the next exe build passes import checks faster.
- List of packages flagged as stub candidates for your exe build
- Generated minimal stub source files ready to commit or paste into the build
Recommended MCP Servers
Journey fit
Executable packaging is a late build concern when you move from dev venv to distributable binaries. Stub generation wires third-party imports into your packaging toolchain—the integration layer between PyInstaller/cx_Freeze and your dependency tree.
How it compares
MCP packaging helper for Python exe stubs—not a full build system or PyInstaller skill.
Common Questions / FAQ
Who is pystub for?
Indie Python developers packaging executables who use Claude Code or Cursor and hit import errors during freeze builds.
When should I use pystub?
When you are in the build phase and your frozen binary fails on optional or dynamic imports that need stub modules.
How do I add pystub to my agent?
Install the PyPI package mcp-pystub (0.1.1), add a stdio MCP server entry pointing at that binary, and run it from your project root so it can scan dependencies.