Skip to content

Adds support for attaching a git repository to an existing MCP proxy component - #1456

Open
chamodperera wants to merge 5 commits into
wso2:mainfrom
chamodperera:main
Open

chamodperera wants to merge 5 commits into
wso2:mainfrom
chamodperera:main

Conversation

@chamodperera

Copy link
Copy Markdown

Purpose

Enables attaching a git repository to an MCP proxy component created from an existing API (MCPProxyFromExistingAPI subType). Previously, once such a component was created in the Devant console, there was no way to connect a source repository to it from the VS Code extension.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

@coderabbitai

coderabbitai Bot commented May 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Rate limit exceeded

@chamodperera has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 35 minutes and 48 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ccc9be1d-18a5-470d-849d-faa46475c2e8

📥 Commits

Reviewing files that changed from the base of the PR and between a0da8dc and f6795f0.

📒 Files selected for processing (5)
  • wi/wi-core/src/types/cloud.types.ts
  • wi/wi-extension/src/cloud/choreo-cli-rpc/client.ts
  • wi/wi-extension/src/cloud/cmds/create-component-cmd.ts
  • wi/wi-extension/src/cloud/stores/context-store.ts
  • wi/wi-webviews/src/views/componentFormView/ComponentFormView.tsx
📝 Walkthrough

Walkthrough

This PR adds end-to-end support for attaching Git repositories to MCP proxy components created from existing API components. The change extends the cloud form context type with an isMCPProxyFromExistingAPI flag, adds an RPC client method to invoke repository attachment, detects MCP proxy components in the workspace state store, and dispatches them to a new handler that performs RPC attachment, clears local storage, updates context.yaml, and refreshes application state. The component form UI now includes a conditional "Deploy to new deployment track" checkbox visible only in MCP proxy mode, which is included in the submission payload.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description includes only the Purpose section with substantive content; the remaining required sections (Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, Learning) are incomplete placeholders. Complete the remaining sections of the description template with specific details: Goals explaining the solution, Approach describing implementation details, User stories, Release notes, Documentation links, and details for Automation tests and Security checks.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main feature: adding support for attaching a git repository to MCP proxy components, which aligns directly with the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
wi/wi-extension/src/cloud/cmds/create-component-cmd.ts (1)

267-273: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Check MCP subtype before generic prebuilt handling.

On Line 267, prebuilt handling returns early before the MCP subtype branch on Line 271. If an MCP proxy component is also flagged as prebuilt, the new attach path is skipped.

Suggested fix
  if (workspaceCompId) {
    const component = dataCacheStore.getState().getComponents(org.handle, project.handler)?.find(comp => comp.metadata?.id === workspaceCompId);
+   if (component?.spec?.subType === ChoreoComponentSubType.MCPProxyFromExistingAPI) {
+     return await handleMCPProxyRepositoryAttach(workspaceCompId, component, org, project, createParams[0], workspaceFsPath, gitRoot!);
+   }
    if (component?.metadata?.isPrebuilt) {
      // if its pre-built integration, we need to update the existing component with new repo details instead of creating a new component.
      return await handlePrebuiltComponentUpdate(workspaceCompId, component, org, project, createParams[0], workspaceFsPath, gitRoot!);
    }
-   if (component?.spec?.subType === ChoreoComponentSubType.MCPProxyFromExistingAPI) {
-     return await handleMCPProxyRepositoryAttach(workspaceCompId, component, org, project, createParams[0], workspaceFsPath, gitRoot!);
-   }
  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wi/wi-extension/src/cloud/cmds/create-component-cmd.ts` around lines 267 -
273, The current early return for prebuilt components
(component?.metadata?.isPrebuilt) short-circuits the MCP-specific attach logic
(component?.spec?.subType === ChoreoComponentSubType.MCPProxyFromExistingAPI) so
if a component is both prebuilt and MCPProxyFromExistingAPI we never call
handleMCPProxyRepositoryAttach; reorder or refine the checks so the MCP subtype
is evaluated first (i.e., check component?.spec?.subType ===
ChoreoComponentSubType.MCPProxyFromExistingAPI before the isPrebuilt branch) or
add an explicit MCP check inside the prebuilt branch and delegate to
handleMCPProxyRepositoryAttach when appropriate, ensuring
handleMCPProxyRepositoryAttach(workspaceCompId, component, org, project,
createParams[0], workspaceFsPath, gitRoot!) is invoked for MCP proxies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wi/wi-extension/src/cloud/cmds/create-component-cmd.ts`:
- Around line 522-535: The code uses optional chaining on
ext.clients.rpcClient?.attachMCPProxyRepository which can silently skip making
the RPC call and let execution proceed; change this to require the RPC client
explicitly by checking ext.clients.rpcClient (or throwing) before calling
attachMCPProxyRepository, and call
ext.clients.rpcClient.attachMCPProxyRepository(...) directly so failures are
explicit — update the create-component logic around attachMCPProxyRepository to
throw or return an error if ext.clients.rpcClient is missing, ensuring the
success path is only reached after a real RPC call.

---

Outside diff comments:
In `@wi/wi-extension/src/cloud/cmds/create-component-cmd.ts`:
- Around line 267-273: The current early return for prebuilt components
(component?.metadata?.isPrebuilt) short-circuits the MCP-specific attach logic
(component?.spec?.subType === ChoreoComponentSubType.MCPProxyFromExistingAPI) so
if a component is both prebuilt and MCPProxyFromExistingAPI we never call
handleMCPProxyRepositoryAttach; reorder or refine the checks so the MCP subtype
is evaluated first (i.e., check component?.spec?.subType ===
ChoreoComponentSubType.MCPProxyFromExistingAPI before the isPrebuilt branch) or
add an explicit MCP check inside the prebuilt branch and delegate to
handleMCPProxyRepositoryAttach when appropriate, ensuring
handleMCPProxyRepositoryAttach(workspaceCompId, component, org, project,
createParams[0], workspaceFsPath, gitRoot!) is invoked for MCP proxies.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3bdf2416-6b7a-403d-9085-03d21a7bb8af

📥 Commits

Reviewing files that changed from the base of the PR and between 645c3a9 and a0da8dc.

📒 Files selected for processing (5)
  • wi/wi-core/src/types/cloud.types.ts
  • wi/wi-extension/src/cloud/choreo-cli-rpc/client.ts
  • wi/wi-extension/src/cloud/cmds/create-component-cmd.ts
  • wi/wi-extension/src/cloud/stores/context-store.ts
  • wi/wi-webviews/src/views/componentFormView/ComponentFormView.tsx

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant