Skip to content

feat(cli): add mcp server command#2282

Merged
a-ganguly merged 3 commits into
masterfrom
mcp
Jul 3, 2025
Merged

feat(cli): add mcp server command#2282
a-ganguly merged 3 commits into
masterfrom
mcp

Conversation

@akshatdubeysf
Copy link
Copy Markdown
Contributor

@akshatdubeysf akshatdubeysf commented Jun 13, 2025

Description

  • added a command to start an mcp server based on @sourceloop/cli
  • improved description of some of the options
  • added error throw condition in case the commands are run through mcp.
  • added relevant test

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

Copilot AI review requested due to automatic review settings June 13, 2025 08:56
@akshatdubeysf akshatdubeysf requested a review from a team as a code owner June 13, 2025 08:56

This comment was marked as outdated.

@akshatdubeysf akshatdubeysf force-pushed the mcp branch 2 times, most recently from 76d7614 to 1761f14 Compare June 13, 2025 09:14
@rohit-sourcefuse rohit-sourcefuse requested a review from Copilot June 13, 2025 09:25

This comment was marked as outdated.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new MCP server command and extends the Sourceloop CLI functionality.

  • Added an MCP server adapter and corresponding command implementations (update, scaffold, microservice, extension, cdk, mcp).
  • Updated tests and documentation to support the new commands with MCP flags and descriptions.

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/cli/src/utilities/mcp-adapter.ts New MCP adapter that overrides prompt to throw an error for unexpected prompt calls
packages/cli/src/types.ts Type definitions now include MCP-specific flags and command properties
packages/cli/src/commands/* Multiple command files updated to add MCP descriptions, flags, and MCP-run implementations
packages/cli/src/command-base.ts, generators Adjustments to support MCP responses and exit handling changes
packages/cli/src/tests/* New tests added for MCP functionality and adjustments to existing test suites
packages/cli/README.md Documentation updated to include the new MCP command usage
packages/cli/package.json Dependency updates to support new functionality
Comments suppressed due to low confidence (1)

packages/cli/src/tests/commands/mcp.test.ts:49

  • The test description implies that an error should be thrown for an invalid payload, but the assertion expects a successful response. Please update the test description or adjust the assertion so that it accurately reflects the intended behavior.
it('should call throw error for registered command if invalid payload is provided', async () => {

@akshatdubeysf akshatdubeysf force-pushed the mcp branch 4 times, most recently from c747385 to a6d94dd Compare June 13, 2025 14:22
Copy link
Copy Markdown
Contributor

@a-ganguly a-ganguly left a comment

Choose a reason for hiding this comment

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

Approved

@a-ganguly a-ganguly requested a review from samarpan-b June 25, 2025 06:51
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jul 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
2 New Critical Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@a-ganguly a-ganguly merged commit 17c1238 into master Jul 3, 2025
7 of 8 checks passed
@a-ganguly a-ganguly deleted the mcp branch July 3, 2025 14:26
@@ -0,0 +1 @@
{"root":["./src/app-generator.ts","./src/base-generator.ts","./src/command-base.ts","./src/enum.ts","./src/extension-generator.ts","./src/index.ts","./src/types.ts","./src/update-generator.ts","./src/utils.ts","./src/__tests__/commands/extension.test.ts","./src/__tests__/commands/mcp.test.ts","./src/__tests__/commands/microservice.test.ts","./src/__tests__/commands/scaffold.test.ts","./src/__tests__/commands/update.test.ts","./src/__tests__/helper/command-test.helper.ts","./src/__tests__/suite/extension.ts","./src/__tests__/suite/mcp.ts","./src/__tests__/suite/microservice-options.ts","./src/__tests__/suite/microservice-prompts.ts","./src/__tests__/suite/scaffold.ts","./src/__tests__/suite/update.ts","./src/commands/cdk.ts","./src/commands/extension.ts","./src/commands/mcp.ts","./src/commands/microservice.ts","./src/commands/scaffold.ts","./src/commands/update.ts","./src/generators/backstage-integration/index.ts","./src/generators/cdk/index.ts","./src/generators/extension/index.ts","./src/generators/microservice/index.ts","./src/generators/scaffold/index.ts","./src/generators/update/index.ts","./src/generators/update/types/types.ts","./src/types/app.d.ts","./src/types/base.d.ts","./src/types/extension.d.ts","./src/types/project.d.ts","./src/types/update.d.ts","./src/utilities/command-adapter.ts","./src/utilities/index.ts","./src/utilities/yeoman-runner.ts"],"errors":true,"version":"5.8.3"} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this file should not have been merged @a-ganguly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok.. Removing it..

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.

5 participants