Phabricator MCP Server

Phabricator MCP Server

Enables interaction with Phabricator via MCP tools for task/revision management and RAG-based semantic search over indexed tasks and revisions.

Category
访问服务器

README

Phabricator MCP Server

Standalone MCP server for Phabricator, kept outside the devel repo so hg stays clean.

Setup

  1. Copy env file and fill credentials:

    cp .env.example .env
    # Edit .env with your Phabricator API token
    
  2. Install deps (already done in venv):

    python3 -m venv venv
    ./venv/bin/pip install mcp requests python-dotenv
    

Run

./run.sh

Or manually:

source venv/bin/activate
python3 server.py

Tools exposed

Phabricator API

  • search_tasks – query tasks by status / priority / assigned / text
  • get_task – fetch a single task by ID with full description, media, and comments
  • get_task_comments – fetch only comments / transactions for a task
  • create_task – create a new maniphest task
  • edit_task – update an existing task or add a comment
  • search_revisions – search differential revisions
  • get_revision – fetch a revision by ID
  • get_revision_diff – fetch raw diff for a revision
  • get_unbreak_tasks – list open unbreak tasks
  • get_projects – search Phab projects
  • get_project_members – list members of a project
  • search_users – search Phab users
  • get_file_info – get metadata for a file / image by PHID
  • query_phids – resolve arbitrary PHIDs to objects
  • ping – health-check connectivity

RAG (Semantic Search)

  • phab_search_rag – semantic search over indexed tasks and revisions
  • phab_ask – natural-language Q&A with source attribution

RAG Architecture

Phabricator API                    ChromaDB Vector Store
     │                                      ▲
     ▼                                      │
┌─────────────┐    ┌─────────────┐    ┌──────────┐
│  Extractor  │───▶│   Chunker   │───▶│ Indexer  │
│  (Conduit)  │    │ (tiktoken)  │    │(metadata)│
└─────────────┘    └─────────────┘    └──────────┘
                                            ▲
┌─────────────┐    ┌─────────────┐          │
│ Diff Parser │───▶│  Embedder   │──────────┘
│(files/hunks)│    │(OpenAI 3-sm)│
└─────────────┘    └─────────────┘

Query Flow:
┌──────────┐    ┌──────────┐    ┌─────────┐    ┌──────────┐
│  User    │───▶│ Embedder │───▶│  Search │───▶│  LLM     │
│  Query   │    │ (OpenAI) │    │(ChromaDB)│    │(Anthropic│
└──────────┘    └──────────┘    └─────────┘    │ Claude)  │
                                                └──────────┘

Tech Stack

  • Embeddings: OpenAI text-embedding-3-small (1536 dims)
  • Vector DB: ChromaDB with cosine similarity + metadata filtering
  • LLM: Anthropic Claude Haiku for RAG synthesis
  • Chunking: tiktoken-based with 512-token chunks, 50-token overlap
  • Diff Metadata: Files changed, hunk context lines (function/class names)

RAG Setup

  1. Add API keys to .env:

    OPENAI_API_KEY=sk-...          # Required for embeddings
    ANTHROPIC_API_KEY=sk-ant-...   # Required for RAG Q&A
    
  2. Run the full index (one-time):

    source venv/bin/activate
    python scripts/full_index.py
    
    • ~47K tasks + ~38K revisions = ~116M tokens
    • Cost: ~$2.32 (OpenAI embeddings)
    • Time: ~16 hours (fast mode) or ~30 hours (full mode)
  3. Fast mode (recommended for first run):

    python scripts/full_index.py --skip-comments --skip-diffs
    
    • Indexes titles, descriptions, summaries only
    • ~4–6x faster than full mode
    • Resume capability: re-run without flags later to enrich with comments/diffs
  4. Test a subset first:

    python scripts/full_index.py --task-limit 10 --rev-limit 10
    

Incremental Sync

After the initial index, run incremental sync to pick up new and modified tasks/revisions:

python scripts/incremental_sync.py

This fetches only objects modified since the last sync (stored in last_sync.json) and updates the vector store. Use --dry-run to preview what would be synced without making changes.

Cron setup (daily sync)

# Add to crontab (crontab -e)
# Replace /path/to/mcp-phab with your project directory
0 2 * * * cd /path/to/mcp-phab && venv/bin/python scripts/incremental_sync.py >> /tmp/phab_sync.log 2>&1

RAG Usage

Via MCP Tools

phab_search_rag(query="find bugs about email signups", limit=5)
phab_ask(query="What caused the AttributeError in matching filters?")

Via CLI (direct Python)

python -c "
from rag.embedder import Embedder
from rag.indexer import Indexer
emb = Embedder()
idx = Indexer()
results = idx.search(emb.embed(['email signup bugs'])[0], limit=3)
for r in results:
    print(r['metadata']['source_uri'], r['metadata']['title'])
"

Claude Desktop config

Add to your Claude Desktop MCP settings (~/.config/claude/mcp-config.json or similar). Replace /path/to/mcp-phab with your actual project directory and fill in your credentials:

{
  "mcpServers": {
    "phab": {
      "command": "/path/to/mcp-phab/venv/bin/python3",
      "args": ["/path/to/mcp-phab/server.py"],
      "env": {
        "PHABRICATOR_URL": "https://phabricator.example.com",
        "PHABRICATOR_API_TOKEN": "your-api-token-here",
        "TRANSPORT": "stdio"
      }
    }
  }
}

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选