fix: unify MCP --editor flag to use --as for consistency#256
Conversation
All other PRPM commands use --as for format/editor selection, but MCP installs required a separate --editor flag. This unifies the interface so --as works for MCP installs too, with --editor kept as a deprecated alias. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
🤖 My Senior Dev — Analysis Complete👤 For @khaliqgant📁 Expert in View your contributor analytics → 📊 4 files reviewed • 1 high risk • 2 need attention 🚨 High Risk:
🚀 Open Interactive Review →The full interface unlocks features not available in GitHub:
💬 Chat here: 📖 View all 12 personas & slash commandsYou can interact with me by mentioning In PR comments or on any line of code:
Slash commands:
AI Personas (mention to get their perspective):
For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews. |
| prpm install @org/my-mcp-server --as cursor | ||
| prpm install @org/my-mcp-server --as vscode --global |
There was a problem hiding this comment.
Suggestion: In the MCP servers guide, the "Install for a specific editor" examples now use --as to choose the editor, but the CLI still uses the --editor option for MCP editor selection and --as causes conversion of mcp packages, so these commands will not behave as documented. [possible bug]
Severity Level: Major ⚠️
- ❌ MCP installs using documented --as example fail with CLIError.
- ⚠️ Users following guide cannot install MCP servers per docs.
- ⚠️ Confusion between MCP editor selection and format conversion.| prpm install @org/my-mcp-server --as cursor | |
| prpm install @org/my-mcp-server --as vscode --global | |
| prpm install @org/my-mcp-server --editor cursor | |
| prpm install @org/my-mcp-server --editor vscode --global |
Steps of Reproduction ✅
1. Open the MCP servers guide at `public-documentation/guides/mcp-servers.mdx:136-143`
(Final File State) and follow the documented example under "Install for a specific
editor", which tells you to run `prpm install @org/my-mcp-server --as cursor`.
2. Run that command via the CLI, which is wired to the `install` subcommand created by
`createInstallCommand()` in `packages/cli/src/commands/install.ts:1926-2000`. The action
handler computes `convertTo = (options.format || options.as)` and passes both `as:
convertTo` and `editor: mcpEditor` into `handleInstall()` at lines 1946-1957 and
1987-2000.
3. Inside `handleInstall()` (same file, lines 264-285 and 483-509), for a typical MCP
server package (`pkg.format === 'mcp'`, subtype `server` or `tool`), `isMCPServerPackage`
is true, `options.as` is `'cursor'`, and `format` is set to `'cursor'`. Later, the
conversion block at lines 528-540 sees `options.as` defined and `format !== pkg.format`
(`'cursor'` vs `'mcp'`), so it enters the conversion path.
4. In the conversion path (lines 653-690), `sourceFormat` becomes `'mcp'`. The switch
statement lacks a `case 'mcp'`, so it falls through to the `default` branch at lines
688-690 and throws `new CLIError(\`Unsupported source format for conversion:
${pkg.format}\`)`, causing the install command to fail instead of installing the MCP
server, contradicting the documentation's implied behavior for `--as`.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** public-documentation/guides/mcp-servers.mdx
**Line:** 142:143
**Comment:**
*Possible Bug: In the MCP servers guide, the "Install for a specific editor" examples now use `--as` to choose the editor, but the CLI still uses the `--editor` option for MCP editor selection and `--as` causes conversion of `mcp` packages, so these commands will not behave as documented.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.|
|
||
| <Accordion title="Which editors are supported?"> | ||
| PRPM can install MCP server configs for Claude Code, Cursor, VS Code, Codex, Windsurf, Gemini, Kiro, OpenCode, Trae, Amp, and Zed. Use the `--editor` flag to target a specific editor. | ||
| PRPM can install MCP server configs for Claude Code, Cursor, VS Code, Codex, Windsurf, Gemini, Kiro, OpenCode, Trae, Amp, and Zed. Use the `--as` flag to target a specific editor (e.g., `--as cursor`). |
There was a problem hiding this comment.
Suggestion: The FAQ answer now tells users to "Use the --as flag to target a specific editor", but for MCP servers the CLI still relies on the --editor option and using only --as with mcp packages will attempt an unsupported format conversion and fail, so this guidance is incorrect. [possible bug]
Severity Level: Major ⚠️
- ❌ FAQ directs users to failing MCP install command.
- ⚠️ MCP server users face errors despite following documentation.
- ⚠️ Inconsistent guidance between CLI help and FAQ text.| PRPM can install MCP server configs for Claude Code, Cursor, VS Code, Codex, Windsurf, Gemini, Kiro, OpenCode, Trae, Amp, and Zed. Use the `--as` flag to target a specific editor (e.g., `--as cursor`). | |
| PRPM can install MCP server configs for Claude Code, Cursor, VS Code, Codex, Windsurf, Gemini, Kiro, OpenCode, Trae, Amp, and Zed. Use the `--editor` flag to target a specific editor (e.g., `--editor cursor`). |
Steps of Reproduction ✅
1. Read the FAQ in `public-documentation/guides/mcp-servers.mdx:187-189` (Final File
State). The "Which editors are supported?" answer explicitly instructs: "Use the `--as`
flag to target a specific editor (e.g., `--as cursor`)."
2. Following this guidance, run an MCP server install such as `prpm install
@org/my-mcp-server --as cursor`. This invokes the `install` command defined in
`packages/cli/src/commands/install.ts:1926-2000`, where the action handler derives
`convertTo = (options.format || options.as)` and passes `as: convertTo` and `editor:
mcpEditor` into `handleInstall()` (lines 1946-1957 and 1987-2000).
3. In `handleInstall()` (same file, lines 483-509), for an MCP package (`pkg.format ===
'mcp'`), `isMCPServerPackage` is true, `options.as` is `'cursor'`, and `format` is set to
`'cursor'`. The conversion block at lines 528-540 then sees `options.as` set and `format
!== pkg.format` and proceeds to perform format conversion.
4. The conversion logic (lines 653-690) computes `sourceFormat = 'mcp'`, but the switch
has no branch for `'mcp'`, so it hits the `default` clause at 688-690, throwing
`CLIError("Unsupported source format for conversion: mcp")`. As a result, using `--as`
exactly as the FAQ recommends causes MCP installs to fail, while using `--editor` (which
avoids setting `options.as`) allows the special MCP server path at lines 939-1001 to run
successfully.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** public-documentation/guides/mcp-servers.mdx
**Line:** 188:188
**Comment:**
*Possible Bug: The FAQ answer now tells users to "Use the `--as` flag to target a specific editor", but for MCP servers the CLI still relies on the `--editor` option and using only `--as` with `mcp` packages will attempt an unsupported format conversion and fail, so this guidance is incorrect.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/cli/src/commands/install.ts">
<violation number="1" location="packages/cli/src/commands/install.ts:1951">
P1: Allowing MCP editors through --as makes MCP server installs skip MCP-specific handling: options.as becomes the effective format (e.g., "codex"), so the MCP branch (`effectiveFormat === 'mcp'`) never runs. As a result, `prpm install <mcp> --as codex` will not merge MCP configs and may try an unsupported format conversion. Consider treating MCP editor values as editor-only and keeping the effective format as `mcp` for MCP packages.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
When --as is an MCP-only editor (codex, vscode, amp, etc.) but not a valid format, treat it as editor selection only and don't pass it as convertTo. This prevents MCP installs from hitting the unsupported format conversion path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
User description
Summary
--editorto--as, matching the convention used by all other PRPM commands--editoris kept as a deprecated alias for backward compatibility--asBefore/After
Test plan
prpm install <mcp-pkg> --as codexwrites to.codex/config.tomlprpm install <mcp-pkg> --editor claudestill works (backward compat)🤖 Generated with Claude Code
CodeAnt-AI Description
Unify MCP install flag: use --as for editor/format selection (keep --editor as deprecated alias)
What Changed
Impact
✅ Consistent CLI usage for installing MCP servers✅ Clearer installation docs and help text for MCP targets✅ Backward compatibility preserved for existing --editor users💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.