Skip to content

Add code pushup MCP package #1010

Open
Open

Description

@BioPhoton

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',
      },
    });
*/
}
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    📣 discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions