Skip to content

feat: Add MCP Server Integration for LLM-agnostic PR Analysis #28

@ipanov-ritech

Description

@ipanov-ritech

Summary

Add a production-ready MCP (Model Context Protocol) server integration that mirrors the CLI workflow exactly, enabling PR Agent to work with any MCP-compatible tool (Claude Code, Cursor, Windsurf, Cline, etc.).

Motivation

The MCP server allows PR Agent to be used with any LLM-powered tool that supports the Model Context Protocol, without requiring users to configure AI provider API keys. The calling tool's LLM performs the analysis, making PR Agent truly LLM-agnostic.

Implementation Details

New Files

  • src/mcp/server.ts - Main MCP server implementation
  • src/mcp/index.ts - Module exports
  • src/mcp/README.md - MCP-specific documentation
  • server.json - MCP Registry configuration
  • smithery.json - Smithery marketplace configuration
  • docs/MCP-SERVER.md - Comprehensive documentation

Features

  • Two MCP Tools:
    • analyze - Mirrors pr-agent analyze CLI command exactly
    • dashboard - Starts web dashboard for analysis history
  • Same Configuration - Uses .pragent.config.json like CLI
  • Full Feature Parity - Jira peer review, arch-docs, risk detection, complexity scoring
  • Database Storage - Saves to pr-agent.db for dashboard
  • Publishing Ready - Configured for npm, MCP Registry, and Smithery

Publishing Configuration

  • npm package: @techdebtgpt/pr-agent
  • MCP Registry name: io.github.techdebtgpt/pr-agent
  • Smithery: Ready for deployment

Testing

Tested with:

  • Claude Code MCP integration
  • PR analysis on external repositories
  • Dashboard functionality

Checklist

  • MCP server mirrors CLI workflow
  • Documentation updated
  • Publishing configuration added
  • Security best practices followed
  • gitignore updated for db files

Assignee

@ipanov-ritech

Related

This implements MCP server support as discussed in the project roadmap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions