Skip to content

fix(mcp): resolve absolute synthpanel launcher for mcp install (#539)#541

Merged
the-data-viking merged 1 commit into
mainfrom
fix/mcp-install-resolve-command
Jun 3, 2026
Merged

fix(mcp): resolve absolute synthpanel launcher for mcp install (#539)#541
the-data-viking merged 1 commit into
mainfrom
fix/mcp-install-resolve-command

Conversation

@claude-dataviking

Copy link
Copy Markdown
Contributor

Summary

synthpanel mcp install registered a bare command: "synthpanel" whenever shutil.which("synthpanel") returned None — which is exactly the case when the install is run from a venv whose bin dir is not on PATH. The MCP host then can't launch the unqualified literal and the server silently fails to start.

resolve_command now resolves a robust absolute path before the literal fallback:

  1. explicit --command (verbatim)
  2. shutil.which("synthpanel")realpath
  3. the running console script (realpath(sys.argv[0])) when it names a synthpanel launcher — the venv-installed entry point even when its bin is off PATH
  4. a synthpanel launcher beside sys.executable — canonical venv layout. The literal sys.executable dir is checked first because a venv's python is a symlink whose realpath points at the base interpreter (and would miss the venv's own console script); the realpath'd dir is the fallback for non-venv layouts.
  5. literal "synthpanel" only as a last resort

Verified manually: with PATH stripped and a non-synthpanel argv[0], resolution now yields the absolute venv path <venv>/bin/synthpanel instead of the literal.

Also updates the --command help text in parser.py.

Tests

Added to tests/test_mcp_install.py::TestHelpers:

Gates

  • ruff check . / ruff format --check .: pass
  • pytest tests/test_mcp_install.py tests/mcp: 84 passed, 1 skipped

Closes #539

🤖 Generated with Claude Code

`synthpanel mcp install` wrote `command: "synthpanel"` whenever
`shutil.which("synthpanel")` returned None — which happens when the
install is run from a venv whose bin dir is not on PATH. The MCP host
then can't launch the bare literal and the server silently fails to
start.

resolve_command now resolves a robust absolute path before the literal
fallback:
1. explicit --command (verbatim)
2. shutil.which("synthpanel") -> realpath
3. the running console script (realpath of argv[0]) when it names a
   synthpanel launcher
4. a synthpanel launcher beside sys.executable (checking the literal
   interpreter dir first, since a venv's python is a symlink whose
   realpath points at the base interpreter and would miss the venv's
   console script), then beside the realpath'd interpreter
5. literal "synthpanel" only as a last resort

Updates the --command help text and adds unit tests covering the
venv/not-on-PATH resolution, the which path, the interpreter-adjacent
path, and the final literal fallback.

Closes #539

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying synthpanel with  Cloudflare Pages  Cloudflare Pages

Latest commit: e3a7b8d
Status: ✅  Deploy successful!
Preview URL: https://51285905.synthpanel.pages.dev
Branch Preview URL: https://fix-mcp-install-resolve-comm.synthpanel.pages.dev

View logs

@claude-dataviking claude-dataviking added the semver:skip Skip version bump on merge label Jun 3, 2026
@the-data-viking the-data-viking merged commit 0c0cef9 into main Jun 3, 2026
19 checks passed
@the-data-viking the-data-viking deleted the fix/mcp-install-resolve-command branch June 3, 2026 23:12
the-data-viking added a commit that referenced this pull request Jun 3, 2026
Cuts the patch release containing the four bug fixes merged today (#540 cost
hint, #541 mcp-install path, #542 dry-run vision guard, #543 report synthesize
hint) plus the attachments docs (#535).

Pre-bumps __version__.py and re-renders the version artifacts (render_site.py,
render_site_markdown.py, render_server_card.py) so auto-tag.yml hits its
"nothing to commit" path and only tags v1.5.6 — its direct version-bump push
to main is currently rejected by branch protection (GH013), which is why
applying semver:patch to a regular fix PR (#543) failed to release. Filing
that pipeline issue separately.

Co-authored-by: Wesley Johnson <wesley@dataviking.tech>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:skip Skip version bump on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp install writes bare 'command: synthpanel' from a venv (PATH-fragile); resolve absolute path

2 participants