Files
bensandler-stripe eb2bb0e37b Prevent MCP registration from launching the wrong npm package (#315)
* Prevent MCP registration from launching the wrong npm package

- Incur confuses the link-cli executable with its npm package, generating npx link-cli --mcp instead of @stripe/link-cli and potentially inheriting package references from project metadata.
- Set the default MCP command from the trusted package name and version embedded at build time.
- Add an isolated registration regression test and repair guidance for existing MCP registrations.
- Leave the separate unsafe skills suggestion path for the upstream Incur follow-up.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>

* Preserve package runners in MCP registration

- Hardcoded npx broke MCP registration in Bun- and pnpm-only environments.
- Mirror Incur runner precedence while retaining the scoped, versioned Link CLI package.
- Replace the subprocess regression test with compact npm, pnpm, Bun, and precedence coverage.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>

* Fix package runner lint

- Use a local resolved hints variable to avoid reassigning the function parameter.
- Preserve existing package-runner detection behavior and precedence.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>

* Preserve standalone MCP execution

- Register Node standalone builds with their current executable path.
- Keep the detected package runner and pinned scoped package for managed installs.
- Cover standalone registration and document the corrected behavior.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>

* Avoid a SEA runtime import in the CLI bundle

- Detect standalone execution by comparing the resolved entrypoint and executable paths.
- Avoid the node:sea import that the regular CLI bundle rewrites incorrectly.
- Preserve absolute executable registration with the focused standalone regression.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>

---------

Co-authored-by: codex <noreply@openai.com>
2026-09-11 10:49:42 -04:00

322 B

@stripe/link-cli
@stripe/link-cli
patch

Register the MCP server with its standalone executable when applicable, or the detected package runner and versioned @stripe/link-cli package. Existing MCP registrations are not updated automatically; rerun link-cli mcp add after upgrading to replace the generated link-cli entry.