What is MCP?
The Model Context Protocol (MCP) is an open standard for connecting AI applications to external data sources and tools. Nectr implements MCP in two directions:Nectr as MCP Server
External agents (Claude Desktop, Linear, Slack bots) can query Nectr’s review data, verdicts, and metrics.
Nectr as MCP Client
Nectr pulls live context from Linear (issues), Sentry (errors), and Slack (messages) during PR reviews.
Nectr as MCP Server (Outbound)
Nectr exposes its internal review data as an MCP server so external agents can access:- Recent PR reviews with AI verdicts
- Contributor statistics from the Neo4j knowledge graph
- Per-PR verdict lookup
- Repository health scores
Transport Protocol
Nectr’s MCP server uses Server-Sent Events (SSE) over HTTP:- SSE Stream:
GET /mcp/sse— Server-to-client event stream - JSON-RPC:
POST /mcp/messages— Client-to-server message ingestion
The MCP server is mounted directly in
app/main.py as an ASGI sub-application because FastAPI’s include_router() cannot handle ASGI apps.Capabilities
The MCP server exposes:- 4 Tools — Callable functions for querying Nectr data
- 1 Resource — Streaming reviews as serialized JSON
Server Name
The MCP server identifies itself as"Nectr" during capability exchange.
Endpoints
SSE event stream for server-to-client events. Used by MCP clients to receive tool results and server notifications.
JSON-RPC 2.0 message endpoint for client-to-server tool invocations and queries.
Connecting External Clients
Claude Desktop
Add Nectr to your Claude Desktop MCP configuration:- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Custom MCP Clients
Use any MCP-compatible client library to connect:Implementation Details
FastMCP Framework
Nectr uses the FastMCP framework for building the MCP server:Database Access
All MCP tools query Nectr’s PostgreSQL database using async SQLAlchemy:- WorkflowRun table — Stores PR review results
- Neo4j graph — Contributor statistics
- Graceful degradation if database is unreachable
Error Handling
All tools implement defensive error handling:- Try to query the database/graph
- On exception, log a warning and return empty list/dict
- Never crash — external agents always get a valid response
This design ensures that external MCP clients can always connect to Nectr, even if some internal services (Neo4j, Mem0) are temporarily unavailable.
Authentication
Use Cases
Linear Integration
Query recent PR reviews when a developer mentions a PR in a Linear issue:Slack Bot
Post daily repository health summaries to a Slack channel:Claude Desktop
Ask Claude about your team’s recent code reviews:Custom Dashboards
Build a custom analytics dashboard that pulls live data from Nectr:Source Code
The MCP server implementation is located at:Next Steps
MCP Tools
Explore the 4 callable tools exposed by Nectr’s MCP server
MCP Resources
Learn about streaming resources for bulk data access