Enables comprehensive interaction with Phabricator for task management and code review workflows, including viewing and commenting on tasks, managing differential revisions, adding inline comments to code, and approving or requesting changes on code reviews.
Phabricator MCP Server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact intelligently with Phabricator for advanced task management and code review workflows.
โจ Features
๐ Personal Authentication
Per-User Authentication: Configure your personal Phabricator API token in your MCP client
User Attribution: Comments and reviews appear under YOUR name instead of a shared service account
Flexible Configuration: Supports both personal tokens and shared environment variables
Standard MCP Integration: Follows MCP ecosystem best practices for authentication
๐ฏ Core Task Management
Task Operations: View task details, read comments, add comments, subscribe users to tasks
Rich Formatting: Well-structured output with task metadata, status, priority, and full comment threads
๐ Advanced Code Review
Differential Management: View revisions, read comments, approve/reject code changes
Intelligent Review Feedback: Analyze comments with surrounding code context for actionable insights
Inline Comments: Add targeted feedback to specific lines in code reviews
Code Context Analysis: Correlate review comments with actual code changes and locations
๐ Server Architecture
HTTP/SSE Transport: FastMCP-based server for reliable production use (default on port 8932)
stdio Transport: Legacy support for direct MCP client integration
Comprehensive API: 11 specialized tools for complete Phabricator workflow automation
๐ง Smart Review Analysis
Comment-Code Correlation: Intelligently link review feedback to specific code locations
Contextual Code Display: Show surrounding code lines for better understanding
Action Item Generation: Categorize feedback into actionable to-do items
Priority Classification: Organize comments by Issues โ Suggestions โ Nits โ Other
๐ Available Tools
Task Management (3 tools)
get-task- Get comprehensive task details with commentsadd-task-comment- Add comments to taskssubscribe-to-task- Subscribe users to task notifications
Code Review (8 tools)
get-differential- Get basic differential revision detailsget-differential-detailed- Get comprehensive review with code changesget-review-feedback- : Get intelligent review analysis with code contextadd-differential-comment- Add general comments to reviewsadd-inline-comment- : Add targeted inline comments to specific code linesaccept-differential- Accept/approve differential revisionsrequest-changes-differential- Request changes with optional feedbacksubscribe-to-differential- Subscribe users to review notifications
๐ Prerequisites
Python 3.8+
Phabricator instance with API access
API token from Phabricator (Settings โ Conduit API Tokens)
โก Quick Start
Automated Setup (Recommended)
The server starts on http://localhost:8932 with automatic dependency management.
Manual Setup
โ๏ธ Configuration
Authentication Configuration
The server supports hybrid authentication with two modes that work seamlessly together:
Personal API Token (Recommended): Pass your personal token through MCP client configuration for user attribution
Environment Variable Fallback: Use a shared service account token via environment variables
๐ Getting Your API Token:
Go to your Phabricator instance โ Settings โ API Tokens
Create a new token with appropriate permissions
Copy the 32-character token for use in configuration
๐ Finding Your Phabricator URL:
Your Phabricator API URL should end with /api/ and typically looks like:
https://phabricator.example.com/api/https://phab.yourcompany.com/api/https://your-domain.phabricator.com/api/
If unsure, check your Phabricator instance's main page - the URL is usually [your-base-url]/api/
๐ MCP Client Configuration
HTTP/SSE Transport (Recommended)
The server automatically detects your environment configuration:
Claude Code CLI (Easiest):
Replace
api-xxxxxxxwith your actual API token andhttps://example.com/api/with your Phabricator instance URL
Manual Configuration:
stdio Transport
For Claude Desktop and direct MCP integration:
Multiple Authentication Options
The server supports multiple ways to authenticate:
Personal Token in Tools: Some tools accept an
api_tokenparameterEnvironment Variables: Set
PHABRICATOR_TOKENin MCP client configFallback Token: Create
.envfile in server directory
Priority Order: Personal token โ MCP environment โ Server .env file
Server Environment Variables (Fallback)
Create .env file in project root for fallback authentication:
๐ง Advanced Configuration
User Attribution
Personal tokens: Comments appear under YOUR name
Shared tokens: Comments appear under the service account name
Mixed usage: Different tools can use different tokens
Token Security
Tokens are passed securely through MCP protocol
No tokens stored on disk (except optional
.envfallback)Each client can use their own personal token
Troubleshooting Authentication
If you see authentication errors:
Check token validity: Test your token directly with Phabricator API
Verify configuration: Ensure
PHABRICATOR_TOKENis set correctlyCheck environment: Run server with debugging to see environment variables
Use personal token: Pass
api_tokenparameter directly to tools
Debugging Commands:
๐ป Usage
With Claude Desktop
Add to Claude Desktop configuration (claude_desktop_config.json):
With HTTP/SSE Transport
Programmatic Usage
Example: AI-Powered Code Review
๐งช Development & Testing
Install Development Dependencies
Run Tests
Code Quality
Testing Features
Tool Completeness: Validates all 11 tools are properly configured
Integration Testing: Tests all tools with realistic mock data
Error Handling: Validates graceful failure modes
Argument Validation: Ensures correct required/optional parameters
Mock Phabricator: No API calls needed for testing
๐ฏ Advanced Features
Intelligent Review Feedback Analysis
The get-review-feedback tool provides advanced analysis:
Smart Comment-Code Correlation
Keyword Extraction: Identifies variable names, function names in comments
Code Location Mapping: Links comments to specific files and line numbers
Context Enrichment: Shows surrounding code for better understanding
Priority Classification: Organizes feedback by importance
๐ค Contributing
We welcome contributions! Here's how to get started:
Development Guidelines
Follow existing code style (black + ruff)
Add tests for new features
Update documentation as needed
Ensure all quality checks pass
๐ License
MIT License - see LICENSE file for details.
๐ Links
Repository: https://github.com/YushengAuggie/phabricator-mcp-server
Model Context Protocol: https://modelcontextprotocol.io/
FastMCP: https://github.com/jlowin/fastmcp
Phabricator API: https://secure.phabricator.com/book/phabricator/article/conduit/