What is MCP?
The Model Context Protocol is an open standard for AI agents to pull structured data from external tools. Instead of hard-coding REST API calls for every service, Nectr uses MCP to connect with Linear, Sentry, Slack, and other tools via a single protocol.MCP was created by Anthropic and is designed for LLM-native workflows. Learn more at modelcontextprotocol.io.
MCP in Nectr: Two Modes
Nectr uses MCP in both directions:1. Inbound: Nectr as MCP Client
During a PR review, Nectr calls external MCP servers to pull live context:- Linear → Linked issues and task descriptions
- Sentry → Production errors for files in the PR diff
- Slack → Relevant channel messages
app/mcp/client.py (MCPClientManager)
2. Outbound: Nectr as MCP Server
Nectr exposes its own review data via MCP so external agents can query:- Recent PR reviews and verdicts
- Contributor stats from the knowledge graph
- Repository health scores
app/mcp/server.py (FastMCP)
Inbound MCP Client
Nectr’s AI reviewer usesMCPClientManager to fetch context from external MCP servers during the review workflow.
Supported Integrations
Linear
Pull issues by team and search query
Sentry
Get errors filtered by project and filename
Slack
Fetch channel messages (roadmap)
How It Works
-
Configure MCP server URL in
.env: -
Nectr calls the MCP server during review:
-
Graceful degradation — if the MCP server is not configured or fails:
Transport: HTTP + JSON-RPC 2.0
Nectr sends MCP tool calls as JSON-RPC 2.0 requests over HTTP:content array and parses JSON strings.
Outbound MCP Server
Nectr exposes its own review database via MCP so external tools (Linear bots, Claude Desktop, Slack apps) can query PR verdicts, contributor stats, and repo health.Available Tools
Nectr’s MCP server exposes 4 tools:get_recent_reviews
Fetch recent PR reviews with verdicts and summaries
get_contributor_stats
Get top contributors with PR-touch counts
get_pr_verdict
Retrieve AI verdict for a specific PR
get_repo_health
Calculate repository health score (0-100)
Transport: SSE (Server-Sent Events)
Nectr’s MCP server is mounted at/mcp using FastMCP with SSE transport:
Example: Query Recent Reviews
Configuration
Inbound (Client) Setup
Set environment variables for each external MCP server:.env
Outbound (Server) Setup
No configuration needed — the MCP server is automatically mounted at/mcp when Nectr starts. See MCP Server Setup for details.
Benefits of MCP
Single Protocol for All Tools
Single Protocol for All Tools
Instead of writing custom REST API clients for Linear, Sentry, Slack, etc., Nectr uses one
query_mcp_server method with tool name + arguments.Graceful Degradation
Graceful Degradation
If an MCP server is offline or not configured, Nectr continues the review without that context. No crashes, no complex error handling.
Extensible
Extensible
Add new integrations by deploying a new MCP server and setting
*_MCP_URL. No changes to Nectr’s core review logic.Agent-Native
Agent-Native
MCP is designed for LLM workflows. External agents (Claude Desktop, Custom GPTs) can call Nectr’s MCP server directly.
Next Steps
Setup Linear
Connect Linear issues to PR reviews
Setup Sentry
Surface production errors during reviews
Run MCP Server
Expose Nectr’s data via MCP
MCP Tools Reference
Browse all available MCP tools