Skip to content

Remove the lager-mcp console script and clean up the links it left on boxes - #254

Merged
danielrmerskine merged 1 commit into
mainfrom
de/drop-mcp-console-script
Aug 13, 2026
Merged

Remove the lager-mcp console script and clean up the links it left on boxes#254
danielrmerskine merged 1 commit into
mainfrom
de/drop-mcp-console-script

Conversation

@danielrmerskine

Copy link
Copy Markdown
Collaborator

Closes #242.

What was wrong

cli/setup.py declared lager-mcp=lager.mcp.server:main. lager lives under box/ and the
wheel's top level is cli and nothing else, so pip created the script and it died on first use.
Demonstrated against a wheel built from current main:

$ .../bin/lager-mcp
    from lager.mcp.server import main
ModuleNotFoundError: No module named 'lager'

pip does not validate entry-point targets at install time, which is why this shipped in every
release carrying the script and never failed a build. Installing the extra does not help either:
lager-cli[mcp] supplies the PyPI mcp SDK, not the lager package.

Why removal rather than a wrapper

The issue offered three options; the deciding fact is that the console script was never how this
server runs. The box starts it in-container as python3 -m lager.mcp
(box/lager/docker/start-services.sh:59) and serves it on port 8100, which is what
docs/source/reference/mcp/overview.mdx documents and what clients connect to. Shipping
box/lager/mcp/ into the wheel was the other option and is worse than it looks: main() needs
uvicorn and starlette, neither declared anywhere, and the control tools pull in the entire
Net stack.

So there is no working behavior to preserve — only a script that has never done anything but
raise.

The part that affects deployed boxes

lager install / lager update symlinked the script into ~/.local/bin
(cli/commands/utility/_host_cli.py). Boxes deployed from any ref carrying the entry point have
a ~/.local/bin/lager-mcp pointing at a script that cannot run, and simply not creating it going
forward would leave those boxes broken indefinitely. The install command now removes the link,
so they self-heal on the next deploy. Still best-effort (|| true) — a missing link must not fail
an install.

Regression guard

#242 asks that the smoke be added once resolved so it cannot regress. Since the resolution is
removal, the guard asserts absence: the wheel smoke fails if bin/lager-mcp reappears. That
is the honest form of the check here — re-adding a console script whose target the wheel does not
ship would otherwise sail through again.

Verified in both directions by running the guard's condition against two real wheels: it fires on
a wheel built from current main (script present) and passes on this branch's wheel.

Verified

  • Wheel built from this branch declares exactly one console script: ['lager']. bin/lager-mcp
    is absent; lager --version and --help work.
  • The same build from main produces bin/lager-mcp and the ModuleNotFoundError above — the
    before/after is a real observation, not an inference.
  • cli/tests/test_host_cli.py: 41 passed. The old
    test_lager_mcp_symlink_is_guarded_and_best_effort is rewritten to assert the removal line
    (rm -f, no ln -sfn, still || true) rather than the guarded symlink.
  • unit (cli): 1224 passed, 2 xfailed — unchanged, so test/COVERAGE.md needs no edit (a test
    was rewritten, not added).
  • packaging.yml parses as YAML and every embedded run block passes bash -n.

Left in place

The mcp extra in cli/setup.py stays — .github/workflows/unit-tests.yml installs and
exercises it, and it is independently useful. docs/source/release-notes/v0.3.27.mdx still
mentions running lager-mcp; historical release notes are a record of what was announced at the
time, and the CHANGELOG entry here supersedes it.

Note for whoever merges second

This adds a ## [Unreleased] CHANGELOG section, as do #249, #251 and #253. Whichever lands second
wants a trivial merge into one section. No other overlap — this touches setup.py,
_host_cli.py, its test, and packaging.yml, none of which the others change.

@danielrmerskine
danielrmerskine merged commit 52ca87c into main Aug 13, 2026
16 checks passed
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.

lager-mcp console script targets a module the wheel does not ship

1 participant