pr-agent-mcp
Integrates with Git repositories to enable PR-Agent features such as code review, changelog updates, and label generation based on pull request content.
Provides automatic PR review via webhooks that trigger review, describe, and improve actions when a pull request is opened in a Gitea repository.
Uses OpenAI credentials to power PR-Agent's code review and analysis capabilities, including reviewing PRs, generating descriptions, suggesting improvements, and answering questions about pull requests.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pr-agent-mcpreview the latest PR in my repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
English | 中文
PR-Agent MCP Server
A MCP (Model Context Protocol) server that exposes pr-agent CLI commands as MCP tools, with optional Gitea webhook integration for automatic PR review. Supports both SSE and StreamableHTTP transports, and can run locally or in Docker.
Features
MCP Tools: Expose pr-agent commands (
review,describe,improve,ask,reflect,update_changelog,generate_labels) as MCP tools.Transports: SSE (
/sse) and StreamableHTTP (/mcp), selectable via--transport sse|streamable-http|both.Gitea Webhook: Automatically trigger review, describe, and improve actions when a new PR is opened in Gitea.
HMAC Signature Verification: Optional webhook signature validation for security.
Config Injection: Automatically loads credentials from
~/.secrets.tomland injects them into the pr-agent subprocess environment.
Project Structure
pr-agent-mcp/
├── server.py # Main MCP server and webhook handler
├── run.ps1 # PowerShell startup script (local run)
├── requirements.txt # Python dependencies
├── Dockerfile # Multi-stage Docker image definition
├── docker-compose.yml # Docker Compose service definition
├── push.ps1 # Build & push image to registry
├── .dockerignore # Exclude files from Docker build context
├── buggy_samples.py # Intentional bug samples for pr-agent testing
├── test.http # HTTP test requests (VS Code REST Client / similar)
├── README.md
├── README.zh-CN.md
└── .gitignorePrerequisites
Docker with Docker Compose (recommended) or Python 3.11+ (uses
tomllib)Gitea instance (for webhook integration, optional)
~/.secrets.tomlwith your provider credentials (see below)
Configure credentials
Create ~/.secrets.toml in your user home directory with your provider and LLM credentials:
[gitea]
url = "http://your-gitea-instance:3000"
token = "your-gitea-personal-access-token"
[openai]
key = "sk-your-openai-api-key"
SECRETS_TOML_PATHenvironment variable overrides the default location (~/.secrets.toml). This is used by the Docker image to locate the bind-mounted file.
Docker Deployment (recommended)
1. Build and start locally
docker compose up -d --buildThis will:
Build the image (multi-stage: installs
pr-agentandmcpdependencies into a venv, installsgitat runtime).Mount your home directory read-only into the container at
/host-homeso it can read~/.secrets.toml.Map host port
9000to container port9000.Start the server with both SSE and StreamableHTTP transports.
The container mounts
${USERPROFILE}(the whole home directory) instead of the single.secrets.tomlfile. Mounting a non-existent host file makes Docker create a directory instead, causingIsADirectoryError— mounting the parent directory avoids this pitfall.
2. Push image to a private registry
# Build + tag + push to the default registry (10.10.11.194:1000/pr-agent-mcp:latest)
.\push.ps1
# Push to another registry / with a version tag / skip rebuild
.\push.ps1 -Registry "192.168.1.100:5000" -Tag "v1.0.0" -NoBuild3. Run on another machine (e.g. a test server)
Copy docker-compose.yml to the target machine and change build: . to image: 10.10.11.194:1000/pr-agent-mcp:latest, then:
docker pull 10.10.11.194:1000/pr-agent-mcp:latest
docker compose up -dOr run directly without a compose file:
docker run -d \
--name pr-agent-mcp \
-p 9000:9000 \
-v $env:USERPROFILE:/host-home:ro \
-e SECRETS_TOML_PATH=/host-home/.secrets.toml \
--restart unless-stopped \
10.10.11.194:1000/pr-agent-mcp:latestManage the container
# View logs
docker compose logs -f
# Stop & remove
docker compose down
# Restart
docker compose restartLocal Run (without Docker)
1. Install dependencies
python -m venv mcp_env
mcp_env\Scripts\activate
pip install -r requirements.txt
requirements.txtonly containsmcp(the MCP framework). pr-agent is NOT a Python dependency of this server — it is called as a subprocess via the path configured inserver.py(or thePR_AGENT_EXEenvironment variable). Make sure pr-agent is already installed somewhere on the machine.
2. (Optional) Configure webhook secret
Set WEBHOOK_SECRET in server.py to the same secret configured in your Gitea webhook settings. Leave it empty to disable signature verification (not recommended for production).
3. Start the server
.\run.ps1Or directly:
python server.py
python server.py --transport sse # SSE only
python server.py --transport streamable-http # StreamableHTTP onlyEndpoints
Endpoint | Method | Description |
| GET | MCP SSE connection endpoint for AI clients |
| POST | MCP StreamableHTTP endpoint |
| POST | MCP message transport (SSE mode) |
| POST | Gitea webhook receiver for auto PR review |
MCP Tools
Tool | Description |
| Review a PR: summary and specific suggestions |
| Generate or update PR title and description |
| Suggest code improvements as PR comments |
| Ask a question about the PR |
| Ask the PR author questions about the PR |
| Update the changelog based on PR contents |
| Generate labels for the PR |
Gitea Webhook Setup
In your Gitea repository, go to Settings → Webhooks → Add Webhook.
Set the target URL to
http://<your-server>:9000/webhook.Set the HTTP method to
POSTand content type toapplication/json.Optionally set a secret (must match
WEBHOOK_SECRETinserver.py).Select the Pull Request event with the Opened action.
When a PR is opened, the server will automatically run review, describe, and improve actions and post results as PR comments.
Testing
Use the included test.http file with VS Code REST Client or a similar HTTP client to manually test the webhook endpoint.
buggy_samples.py contains intentional bugs across multiple categories (security, logic, concurrency, error handling) for testing pr-agent's code review detection capabilities.
License
Private — internal use only.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Package intelligence MCP for AI agents — 22 tools, 19 ecosystems, AGPL SDK, free.
Repo intel for AI coding agents: overview, PRs, contributors, hot files, CI, deps. Remote MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kkmeteor/pr-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server