Skip to content

fix: unify MCP --editor flag to use --as for consistency#256

Merged
khaliqgant merged 2 commits into
mainfrom
fix-mcp-alias
Feb 19, 2026
Merged

fix: unify MCP --editor flag to use --as for consistency#256
khaliqgant merged 2 commits into
mainfrom
fix-mcp-alias

Conversation

@khaliqgant
Copy link
Copy Markdown
Collaborator

@khaliqgant khaliqgant commented Feb 19, 2026

User description

Summary

  • Unifies the MCP install flag from --editor to --as, matching the convention used by all other PRPM commands
  • --editor is kept as a deprecated alias for backward compatibility
  • Updates all documentation and error messages to reference --as

Before/After

# Before (inconsistent)
prpm install @org/my-rule --as claude
prpm install @org/my-mcp-server --editor claude

# After (consistent)
prpm install @org/my-rule --as claude
prpm install @org/my-mcp-server --as claude

Test plan

  • All 31 install-file-locations tests pass
  • All 10 install tests pass
  • TypeScript compiles cleanly (pre-commit hook)
  • Manual: prpm install <mcp-pkg> --as codex writes to .codex/config.toml
  • Manual: prpm install <mcp-pkg> --editor claude still 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

  • prpm install accepts --as to target MCP server editor (e.g., prpm install @org/my-mcp-server --as codex); --editor still works as a deprecated alias
  • CLI now validates editor names passed via --as and provides examples referencing --as for MCP installs
  • Documentation and CLI help updated to show --as for MCP server installs and global install examples
  • Tests updated to expect MCP installs to write editor config when --as is provided (test descriptions changed accordingly)

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

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
Copy link
Copy Markdown

codeant-ai Bot commented Feb 19, 2026

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 ·
Reddit ·
LinkedIn

@my-senior-dev-pr-review
Copy link
Copy Markdown

my-senior-dev-pr-review Bot commented Feb 19, 2026

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

📁 Expert in packages/ (205 edits) • ⚡ 7th PR this month

View your contributor analytics →


📊 4 files reviewed • 1 high risk • 2 need attention

🚨 High Risk:

  • packages/cli/src/commands/install.ts — Critical bug in error messaging related to deprecated flag could mislead users.

⚠️ Needs Attention:

  • packages/cli/src/commands/install.ts — Important logic changes related to command option handling may introduce new failure paths and confusion.

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Feb 19, 2026
Comment on lines +142 to +143
prpm install @org/my-mcp-server --as cursor
prpm install @org/my-mcp-server --as vscode --global
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Suggested change
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`).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Suggested change
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
Copy link
Copy Markdown

codeant-ai Bot commented Feb 19, 2026

CodeAnt AI finished reviewing your PR.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/cli/src/commands/install.ts Outdated
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>
@khaliqgant khaliqgant merged commit 5b54cd0 into main Feb 19, 2026
12 checks passed
@khaliqgant khaliqgant deleted the fix-mcp-alias branch February 19, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant