-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Add comprehensive MCP installation support across all formats #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit implements full bidirectional MCP (Model Context Protocol)
server conversion and installation support for Claude, Gemini, and Kiro formats.
## New Features
### Kiro ↔ Claude/Gemini MCP Conversion
- Add kiroToClaudeMCP() - Convert Kiro MCP servers to Claude format
- Add claudeToKiroMCP() - Convert Claude MCP servers to Kiro format
- Add kiroToGeminiMCP() - Convert Kiro MCP servers to Gemini format
- Add geminiToKiroMCP() - Convert Gemini MCP servers to Kiro format
- Add KiroMCPServerConfig interface with timeout field support
- Handle Kiro's unique timeout field with appropriate warnings
### Environment Variable Translation
- Add translateEnvVar() - Translate env var syntax between formats
- Add translateMCPServerEnv() - Translate all env vars in MCP config
- Support Gemini ↔ Claude variable syntax conversion
- ${extensionPath} ↔ ${CLAUDE_EXTENSIONS_PATH}
- ${home} ↔ ${HOME}
- %APPDATA% → ${home}
- Automatic translation with user warnings
### Gemini MCP Installation Support
- Add mergeGeminiMCPServers() - Merge MCP servers into Gemini extensions
- Add removeGeminiMCPServers() - Remove MCP servers from Gemini extensions
- Mirror Claude's safety features (never overwrite existing configs)
- Conflict detection and warnings
## Test Coverage
- Add 13 new test cases for Kiro conversion functions
- Add tests for environment variable translation
- All 732 converter tests passing ✅
- 85-95% lossless conversion rate maintained
## Impact
- Full bidirectional MCP conversion: Claude ↔ Gemini ↔ Kiro
- Production-ready MCP installation for all 3 supported formats
- Enhanced user experience with automatic env var translation
- Safe installation/uninstall with conflict detection
🤖 Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
|
CodeAnt AI is reviewing your PR. |
🤖 My Senior Dev — Analysis Complete👤 For @khaliqgant📁 Expert in View your contributor analytics → 📊 5 files reviewed • 1 high risk • 5 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. |
Greptile OverviewGreptile SummaryThis PR successfully implements bidirectional MCP server conversion across Claude, Gemini, and Kiro formats, enabling users to install packages with MCP servers across all three platforms. The implementation adds 4 new conversion functions, environment variable translation, and Gemini-specific installation logic with 100% test coverage. Key Additions:
Issues Found:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant CLI
participant Converter
participant MCPUtil
participant FileSystem
Note over User,FileSystem: Installing Kiro Package with MCP in Claude Environment
User->>CLI: prpm install kiro-package
CLI->>Converter: fromKiro(package)
Converter->>Converter: Extract mcpServers from Kiro config
Converter->>Converter: kiroToClaudeMCP(servers)
Converter-->>CLI: TransformResult{servers, warnings}
Note over Converter: Warns if timeout field present
CLI->>MCPUtil: mergeMCPServers(servers)
MCPUtil->>FileSystem: readMCPConfig(.mcp.json)
FileSystem-->>MCPUtil: existing config
MCPUtil->>MCPUtil: Check for conflicts
MCPUtil->>FileSystem: writeMCPConfig(merged)
MCPUtil-->>CLI: MCPMergeResult{added, skipped}
CLI-->>User: Installation complete
Note over User,FileSystem: Installing Gemini Extension with MCP
User->>CLI: prpm install gemini-extension
CLI->>Converter: fromGeminiPlugin(package)
Converter->>Converter: Extract mcpServers
Converter->>Converter: translateMCPServerEnv(config, direction)
Note over Converter: Translates ${extensionPath} → ${CLAUDE_EXTENSIONS_PATH}
Converter-->>CLI: servers with translations
CLI->>MCPUtil: mergeGeminiMCPServers(path, servers)
MCPUtil->>FileSystem: readFileSync(gemini-extension.json)
FileSystem-->>MCPUtil: extension config
MCPUtil->>MCPUtil: Merge without overwriting
MCPUtil->>FileSystem: writeFileSync(updated)
MCPUtil-->>CLI: MCPMergeResult
CLI-->>User: Extension installed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 2 comments
packages/cli/src/core/mcp.ts
Outdated
| } | ||
|
|
||
| // Read existing extension config | ||
| let config: any = { mcpServers: {} }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Violates TypeScript type safety rule (.cursor/rules/typescript-type-specialist.mdc). Replace any with MCPConfig.
| let config: any = { mcpServers: {} }; | |
| let config: MCPConfig = { mcpServers: {} }; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/cli/src/core/mcp.ts
Line: 296:296
Comment:
**syntax:** Violates TypeScript type safety rule (.cursor/rules/typescript-type-specialist.mdc). Replace `any` with `MCPConfig`.
```suggestion
let config: MCPConfig = { mcpServers: {} };
```
How can I resolve this? If you propose a fix, please make it concise.| const ENV_VAR_MAPPINGS: Record<string, Record<string, string>> = { | ||
| 'gemini-to-claude': { | ||
| '${extensionPath}': '${CLAUDE_EXTENSIONS_PATH}', | ||
| '${home}': '${HOME}', | ||
| }, | ||
| 'claude-to-gemini': { | ||
| '${CLAUDE_EXTENSIONS_PATH}': '${extensionPath}', | ||
| '${HOME}': '${home}', | ||
| '%APPDATA%': '${home}', | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The ENV_VAR_MAPPINGS only defines mappings for gemini-to-claude and claude-to-gemini, but translateEnvVar() accepts 6 direction types including kiro-to-claude, claude-to-kiro, gemini-to-kiro, and kiro-to-gemini. When Kiro directions are used, mappings will be undefined and no translation occurs, which silently fails.
Either add the missing Kiro mappings or document that Kiro directions don't support automatic translation.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/converters/src/cross-converters/mcp-transformer.ts
Line: 416:426
Comment:
**logic:** The `ENV_VAR_MAPPINGS` only defines mappings for `gemini-to-claude` and `claude-to-gemini`, but `translateEnvVar()` accepts 6 direction types including `kiro-to-claude`, `claude-to-kiro`, `gemini-to-kiro`, and `kiro-to-gemini`. When Kiro directions are used, `mappings` will be undefined and no translation occurs, which silently fails.
Either add the missing Kiro mappings or document that Kiro directions don't support automatic translation.
How can I resolve this? If you propose a fix, please make it concise.
Nitpicks 🔍
|
| servers[name].env = { ...config.env }; | ||
| } | ||
|
|
||
| if (config.disabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: In the Kiro→Claude conversion, checking the disabled flag with a simple truthy check means an explicit disabled: false on a Kiro server is dropped (not copied), causing loss of configuration information and potentially breaking round‑trip expectations. [logic error]
Severity Level: Minor
| if (config.disabled) { | |
| if (config.disabled !== undefined) { |
Why it matters? ⭐
Verified in the PR file: the Kiro->Claude converter uses if (config.disabled) (lines 252-254). That truthy check will skip explicit disabled: false values and therefore lose configuration when round-tripping. Changing to config.disabled !== undefined preserves explicit false while still omitting entirely absent fields — this fixes a real logic bug rather than a cosmetic change.
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** packages/converters/src/cross-converters/mcp-transformer.ts
**Line:** 252:252
**Comment:**
*Logic Error: In the Kiro→Claude conversion, checking the disabled flag with a simple truthy check means an explicit `disabled: false` on a Kiro server is dropped (not copied), causing loss of configuration information and potentially breaking round‑trip expectations.
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.| servers[name].env = { ...config.env }; | ||
| } | ||
|
|
||
| if (config.disabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: In the Claude→Kiro conversion, using a truthy check for the disabled flag causes disabled: false values to be omitted from the resulting Kiro config, which can lead to subtle configuration loss and inconsistent behavior after conversion. [logic error]
Severity Level: Minor
| if (config.disabled) { | |
| if (config.disabled !== undefined) { |
Why it matters? ⭐
Verified in the PR file: the Claude->Kiro converter uses if (config.disabled) (lines 298-300). This will omit disabled: false from the output and is a functional loss. Replacing with an undefined-check preserves explicit booleans and fixes a correctness regression.
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** packages/converters/src/cross-converters/mcp-transformer.ts
**Line:** 298:298
**Comment:**
*Logic Error: In the Claude→Kiro conversion, using a truthy check for the disabled flag causes `disabled: false` values to be omitted from the resulting Kiro config, which can lead to subtle configuration loss and inconsistent behavior after conversion.
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.| servers[name].env = { ...config.env }; | ||
| } | ||
|
|
||
| if (config.disabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: In the Kiro→Gemini conversion, the disabled status is only copied when truthy, so an explicit disabled: false on a Kiro server is removed in the Gemini result, breaking lossless conversion and potentially changing downstream behavior that distinguishes between absent and false. [logic error]
Severity Level: Minor
| if (config.disabled) { | |
| if (config.disabled !== undefined) { |
Why it matters? ⭐
Verified in the PR file: the Kiro->Gemini converter uses if (config.disabled) (lines 339-341). That loses explicit false values. Switching to !== undefined preserves intended semantics and improves lossless conversion guarantees.
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** packages/converters/src/cross-converters/mcp-transformer.ts
**Line:** 339:339
**Comment:**
*Logic Error: In the Kiro→Gemini conversion, the disabled status is only copied when truthy, so an explicit `disabled: false` on a Kiro server is removed in the Gemini result, breaking lossless conversion and potentially changing downstream behavior that distinguishes between absent and false.
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.| } | ||
| } | ||
|
|
||
| if (config.disabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: In the Gemini→Kiro conversion, copying the disabled flag only when truthy means disabled: false on Gemini servers is not preserved in the Kiro config, which undermines accurate configuration transfer and round‑tripping. [logic error]
Severity Level: Minor
| if (config.disabled) { | |
| if (config.disabled !== undefined) { |
Why it matters? ⭐
Verified in the PR file: the Gemini->Kiro converter uses if (config.disabled) (lines 398-400). That will drop explicit disabled: false. Using config.disabled !== undefined preserves false and maintains more accurate, lossless conversions.
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** packages/converters/src/cross-converters/mcp-transformer.ts
**Line:** 398:398
**Comment:**
*Logic Error: In the Gemini→Kiro conversion, copying the disabled flag only when truthy means `disabled: false` on Gemini servers is not preserved in the Kiro config, which undermines accurate configuration transfer and round‑tripping.
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. |
|
CodeAnt AI is running Incremental review Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
There was a problem hiding this 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 8 files
User description
Overview
This PR implements full bidirectional MCP (Model Context Protocol) server conversion and installation support for all supported formats: Claude, Gemini, and Kiro.
What Changed
🔄 New Kiro ↔ Claude/Gemini MCP Conversion
Added 4 new conversion functions in
packages/converters/src/cross-converters/mcp-transformer.ts:kiroToClaudeMCP()- Convert Kiro MCP servers to Claude formatclaudeToKiroMCP()- Convert Claude MCP servers to Kiro formatkiroToGeminiMCP()- Convert Kiro MCP servers to Gemini formatgeminiToKiroMCP()- Convert Gemini MCP servers to Kiro formatKey Features:
timeoutfield with appropriate warnings🌍 Environment Variable Translation
Added automatic environment variable translation system:
translateEnvVar()- Translate env var syntax between formatstranslateMCPServerEnv()- Translate all env vars in an MCP configSupported Translations:
${extensionPath}→${CLAUDE_EXTENSIONS_PATH},${home}→${HOME}${HOME}→${home},%APPDATA%→${home}💎 Gemini MCP Installation Support
Added Gemini-specific MCP installation logic in
packages/cli/src/core/mcp.ts:mergeGeminiMCPServers()- Safely merge MCP servers into Gemini extension filesremoveGeminiMCPServers()- Remove MCP servers from Gemini extensionsSafety Features:
Test Coverage
✅ All 732 converter tests passing
Added 13 new comprehensive test cases:
translateMCPServerEnv()testsMCP Support Matrix (After This PR)
Full Conversion Graph
What This Enables
Users can now:
Files Changed
packages/converters/src/cross-converters/mcp-transformer.ts(+281 lines)packages/cli/src/core/mcp.ts(+131 lines)packages/converters/src/__tests__/cross-converters/mcp-transformer.test.ts(+203 lines)packages/converters/src/index.ts(+19 lines)Breaking Changes
None - this is purely additive functionality.
Additional Notes
🤖 Generated with Claude Code
via Happy
CodeAnt-AI Description
Add Kiro MCP support and Gemini extension install/uninstall with automatic env var translation
What Changed
Impact
✅ Safer Gemini extension installs (no overwrites)✅ Cross-format MCP portability between Claude, Gemini, and Kiro✅ Clearer conversion warnings when env vars or Kiro timeouts need manual review💡 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.