Skip to content

fix: add mcp case to source format conversion switch#262

Merged
khaliqgant merged 1 commit into
mainfrom
fix/mcp-format-conversion
Mar 20, 2026
Merged

fix: add mcp case to source format conversion switch#262
khaliqgant merged 1 commit into
mainfrom
fix/mcp-format-conversion

Conversation

@khaliqgant
Copy link
Copy Markdown
Collaborator

@khaliqgant khaliqgant commented Mar 20, 2026

User description

Summary

  • MCP packages failed when using --as flag (e.g. prpm install @agent-relay/relaycast-mcp-server --as codex) with error: "Unsupported source format for conversion: mcp"
  • Added missing case 'mcp': to the source format parsing switch, using fromMCPServer to convert MCP server JSON into canonical format
  • Also added fromMCPServer to the imports from @pr-pm/converters

Test plan

  • Run prpm install @agent-relay/relaycast-mcp-server --as codex and verify it installs successfully
  • Run prpm install @agent-relay/relaycast-mcp-server --as claude and verify conversion works
  • Verify existing MCP native installs (without --as) still work

🤖 Generated with Claude Code


CodeAnt-AI Description

Add MCP format conversion to enable --as installs

What Changed

  • MCP server packages can now be converted when installing with the --as option; previously they failed with "Unsupported source format for conversion: mcp"
  • The MCP conversion function is imported and used to parse MCP server JSON into the canonical package format during install

Impact

✅ Successful MCP installs using --as
✅ Converted MCP server packages available for target formats
✅ Fewer install failures for MCP sources

💡 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.

MCP packages (e.g. `prpm install @agent-relay/relaycast-mcp-server --as codex`)
failed with "Unsupported source format for conversion: mcp" because the
source format parsing switch had no case for 'mcp'. Added the missing case
using fromMCPServer to parse MCP JSON into canonical format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 20, 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 — Analysis Complete

👤 For @khaliqgant

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

View your contributor analytics →


📊 1 file reviewed • 1 high risk • 3 need attention

⚠️ Needs Attention:

  • packages/cli/src/commands/install.ts — Potentially introduces a new data handling process that may involve user-inputted JSON and has implications for security, error handling, and input validation.

📚 Relevant Past Discussions:

  • ⚠️ Unresolved discussions on install.ts — 10 unresolved comments on this file from past PRs

🚀 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:XS This PR changes 0-9 lines, ignoring generated files label Mar 20, 2026
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 20, 2026

Sequence Diagram

This PR fixes install conversion for MCP packages when using the as flag. The CLI now recognizes mcp as a valid source format, converts it into canonical form, and continues normal target format conversion.

sequenceDiagram
    participant User
    participant CLI
    participant PackageSource
    participant Converters

    User->>CLI: Install MCP package with as target
    CLI->>PackageSource: Fetch package source and metadata
    PackageSource-->>CLI: Return mcp source content
    CLI->>Converters: Convert mcp source to canonical package
    CLI->>Converters: Convert canonical package to target format
    CLI-->>User: Complete install successfully
Loading

Generated by CodeAnt AI

@khaliqgant khaliqgant merged commit b2daba5 into main Mar 20, 2026
11 checks passed
@khaliqgant khaliqgant deleted the fix/mcp-format-conversion branch March 20, 2026 09:56
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.

No issues found across 1 file

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 20, 2026

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Import contract
    Confirm that fromMCPServer is exported with the expected signature from @pr-pm/converters and that it expects a parsed object (not a raw string). If fromMCPServer expects a validated/typed object, the code should parse/validate input using the shared parser rather than a raw JSON.parse.

  • Parsing assumption
    The conversion branch for mcp calls JSON.parse(sourceContent) unconditionally. Validate that sourceContent is actually JSON text (single-file packages) and not another file type or already-parsed object. Consider using existing MCP JSON parsing utilities to provide better validation and clearer error messages for malformed MCP packages.

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Mar 20, 2026

CodeAnt AI finished reviewing your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant