What is MCP?
The Model Context Protocol (MCP) is a standard for connecting AI applications with external data sources. Nectr implements MCP bidirectionally:Nectr as MCP Server
External agents (Claude Desktop, Linear, custom tools) can query Nectr’s review data, contributor stats, and repo health metrics
Nectr as MCP Client
Nectr pulls live context from Linear (issues), Sentry (errors), and Slack (messages) during PR reviews
Architecture
Nectr as MCP Server (Outbound)
Nectr exposes its review data as an MCP server using FastMCP with SSE (Server-Sent Events) transport.Endpoints
Available Tools
get_recent_reviews
Get recent PR reviews for a repository with verdicts and summaries.
Parameters:
repo(string, required): Full repository name (e.g.nectr-ai/nectr)limit(integer, optional): Max reviews to return (default 10, capped at 50)
get_contributor_stats
Get top contributors for a repository with PR-touch counts from Neo4j knowledge graph.
Parameters:
repo(string, required): Full repository name
get_pr_verdict
Get Nectr’s AI verdict for a specific pull request.
Parameters:
repo(string, required): Full repository namepr_number(integer, required): GitHub PR number
get_repo_health
Get overall repository health metrics with 0-100 score.
Parameters:
repo(string, required): Full repository name
Available Resources
Resources provide read-only access to data streams.nectr://repos/{repo}/reviews
Recent reviews for a repository serialized as JSON.
URI Pattern: nectr://repos/<owner>/<repo>/reviews
Example:
Connecting Claude Desktop
Add Nectr as an MCP server in Claude Desktop’s config:1
Open Claude Desktop config
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
2
Add Nectr MCP server
3
Restart Claude Desktop
Claude will now have access to Nectr’s tools during conversations
You can now ask Claude questions like “What’s the health score for nectr-ai/nectr?” or “Show me recent PR reviews for my repo” and it will call Nectr’s MCP tools.
Nectr as MCP Client (Inbound)
During PR review, Nectr pulls live context from external MCP servers to ground reviews in what’s actually happening.Supported Integrations
Client Architecture
Generic MCP Query Method
The client implements a generic JSON-RPC 2.0 method for calling any MCP server:Timeout and Error Handling
Usage in PR Review Flow
Here’s how MCP context is pulled during a review:Environment Variables
Required for MCP Server (Outbound)
No additional env vars required — FastMCP server is always available.Required for MCP Client (Inbound)
All integrations are optional. If not configured, that source is silently skipped.Testing MCP Tools
Test MCP Server (Outbound)
Usecurl to call Nectr’s MCP tools:
Test MCP Client (Inbound)
Create a simple test MCP server:Graceful Degradation
All MCP integrations follow a graceful degradation pattern:1
Check if configured
2
Attempt connection with timeout
3
Return empty list on failure
- PR reviews never fail due to unavailable MCP servers
- Missing context is logged but doesn’t block the review
- You can enable/disable integrations without code changes
Related Files
app/mcp/server.py:1- FastMCP server implementation (outbound)app/mcp/client.py:35- MCPClientManager (inbound)app/mcp/router.py:1- MCP endpoint documentationapp/services/pr_review_service.py:1- How MCP context is used in reviewsapp/core/config.py:65- MCP environment variables