PR-Agent MCP Server

AI-Powered Pull Request Analysis via Model Context Protocol

JSON-RPC 2.0 Project Registry Auth Railway Hosted v3.0.0

Overview

This is a multi-tenant PR-Agent MCP server that uses the VISHKAR Project Registry for authentication. It provides AI-powered code review, PR description generation, security scanning, and more through the Model Context Protocol.

Authentication Bearer token (Project Registry API Key)
Protocol MCP 2024-11-05
Backend Qodo PR-Agent (Railway)
Tools Available 15 tools

Architecture

┌─────────────────┐ ┌──────────────────────┐ ┌─────────────────────┐ │ LLM Client │────▶│ PR-Agent MCP │────▶│ Project Registry │ │ (Claude Code) │ │ (This Server) │ │ (Auth/Config) │ └─────────────────┘ └──────────┬───────────┘ └─────────────────────┘ │ ▼ ┌──────────────────────┐ │ PR-Agent Backend │ │ (Python/Railway) │ └──────────────────────┘
Key Benefit: Your credentials are never hardcoded! They're fetched dynamically from Project Registry based on your API key — and only the token for the active provider is transmitted per request.

Available Tools

PR Analysis

pr_review Comprehensive code review with TODO scanning, performance analysis, and suggestions
pr_describe Generate or improve PR title and description based on code changes
pr_improve Suggest actionable code improvements with committable recommendations
pr_ask Ask specific questions about any pull request
pr_analyze Static code analysis on PR components with testing suggestions

Workflows

pr_complete_workflow End-to-end SDLC workflow: describe, review, analyze, improve
pr_review_branch Review code changes between branches without a PR
pr_resolve_feedback Automatically process and resolve PR review feedback threads

Security

codeql_security_scan Scan repository for vulnerabilities using GitHub CodeQL
remediate_security_findings Analyze and auto-remediate security findings
configure_codeql_rules Configure CodeQL scanning rules and preferences

API Usage

Endpoint

POST /mcp

Authentication

Authorization: Bearer YOUR_PROJECT_API_KEY
Important: Get your API key from the Project Registry. Your project must have at least one entry in configs.repositoriesConfig[] with a valid token for the platform you intend to use.

Example: Initialize

curl -X POST https://pr-agent-mcp-production.up.railway.app/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {}
    }
  }'

Example: List Tools

curl -X POST https://pr-agent-mcp-production.up.railway.app/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/list",
    "params": {}
  }'

Example: Review a PR

curl -X POST https://pr-agent-mcp-production.up.railway.app/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_PROJECT_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "pr_review",
      "arguments": {
        "pr_url": "https://github.com/owner/repo/pull/123"
      }
    }
  }'

Project Registry Configuration

Your project in Project Registry must have a configs.repositoriesConfig[] array. Each entry represents one repository connection. The server automatically selects the correct token based on the URL in your tool call.

GitHub

{
  "configs": {
    "repositoriesConfig": [
      {
        "name": "My GitHub Repo",
        "platform": "github",
        "githubOrg": "my-org",
        "githubRepo": "my-repo",
        "githubToken": "ghp_xxx",
        "isDefault": true
      }
    ],
    "prAgent": {
      "openaiApiKey": "sk-xxx",    // Optional - for GPT models
      "anthropicApiKey": "sk-xxx"  // Optional - for Claude models
    }
  }
}

Bitbucket Cloud

{
  "configs": {
    "repositoriesConfig": [
      {
        "name": "My Bitbucket Repo",
        "platform": "bitbucket_cloud",
        "bitbucketWorkspace": "my-workspace",
        "bitbucketRepo": "my-repo",
        "bitbucketAppPassword": "your-app-password"
      }
    ]
  }
}

Bitbucket Server (on-premise)

{
  "configs": {
    "repositoriesConfig": [
      {
        "name": "My Bitbucket Server Repo",
        "platform": "bitbucket_server",
        "bitbucketServerUrl": "https://bitbucket.example.com",
        "bitbucketServerProject": "MY_PROJECT",
        "bitbucketServerRepo": "my-repo",
        "bitbucketServerToken": "your-personal-access-token"
      }
    ]
  }
}

GitLab

{
  "configs": {
    "repositoriesConfig": [
      {
        "name": "My GitLab Repo",
        "platform": "gitlab",
        "gitlabProjectPath": "my-group/my-repo",
        "gitlabToken": "glpat-xxx"
      }
    ]
  }
}
Tip: You can add multiple entries to repositoriesConfig[] — one per repository or platform. The server matches the entry to the PR URL automatically. Set "isDefault": true on the entry you use most frequently as a fallback when no URL match is found.

Response Format

Success Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Review results in markdown format..."
      }
    ]
  }
}

Error Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32600,
    "message": "Unauthorized: Missing or invalid Authorization header"
  }
}

Related Services