cli icon indicating copy to clipboard operation
cli copied to clipboard

Add code pushup MCP package

Open BioPhoton opened this issue 7 months ago • 0 comments

User story

As a developer that uses Cursor, Webstorm Junie, Copilot or other agent solutions for coding I want to use CodePushup as a validation tool in my AI flow.

Therefore I want to have the main CLI features as well as plugins directly wrapped in a MCP server and exposed as tools.

Acceptance criteria

mcp

  • init server
  • handle process arguments and configuration

mcp-server

  • maintains the server logic
  • wraps terminal commands as tool
  • wraps plugins as tool (no JSON config, AI can freely use the plugin)

Implementation details

export class AngularMcpServerWrapper {
    private readonly mcpServer: McpServer;

    constructor() {
        this.mcpServer = new McpServer(
            {
                name: 'CodePushup MCP',
                version: '0.0.0',
            }
        );

        this.mcpServer.server.registerCapabilities({
            tools: {},
        });

        this.mcpServer.server.setRequestHandler(
            ListToolsRequestSchema,
            async () => {
                return {
                    tools: [
{
  name: 'code-pushup_print-config',
  description: 'Print the resolved configuration',
  inputSchema: {
    type: 'object' as const,
    properties: {
      ...baseToolsSchema.inputSchema.properties,
      ...globalArgsSchema.inputSchema.properties,
    },
    required: [...(globalArgsSchema.inputSchema.required as string[])],
  },
  annotations: {
    title: 'Print Code PushUp Config',
    readOnlyHint: true,
    openWorldHint: true,
    idempotentHint: false,
  },
}
                    ],
                };
            }
        );
    };
/*
// tool logic
  const { stdout } = await executeProcess({
      command: 'npx',
      args: objectToCliArgs({
        _: ['@code-pushup/cli', 'print-config'],
        ...cliOptions,
      }),
      ...(cwd ? { cwd } : {}),
      env: {
        ...process.env,
        FORCE_COLOR: 'false',
      },
    });
*/
}
}

BioPhoton avatar May 22 '25 14:05 BioPhoton