Overview
The Linear integration allows Nectr to pull issue and task data from Linear during PR reviews. When a PR references a Linear issue (e.g., “Fixes ENG-123”), Nectr fetches the full issue context — title, description, status, assignee — and includes it in the AI review.This is an inbound MCP integration — Nectr acts as an MCP client connecting to a Linear MCP server.
How It Works
1
PR references Linear issue
Developer includes Linear issue ID in PR title or body:
2
Nectr extracts issue IDs
During PR review, Nectr parses the PR metadata to identify Linear issue references
3
MCP query to Linear
Nectr calls Linear MCP server via
MCPClientManager.get_linear_issues():4
Context included in review
Linear issue data is injected into the AI review prompt:
5
AI review considers issue context
Claude can now verify:
- Does the PR actually address the issue?
- Are there gaps between the issue requirements and implementation?
- Should the PR include additional work mentioned in the issue?
Setup
1. Deploy Linear MCP Server
You need a Linear MCP server running separately from Nectr. Options: Option A: Use official Linear MCP server2. Get Linear API Key
1
Go to Linear settings
Navigate to linear.app/settings/api
2
Create personal API key
Click “Create new key” and give it a name like “Nectr MCP”
3
Copy the key
Format:
lin_api_...3. Configure Nectr
Set environment variables in your Nectr backend:API Reference
MCPClientManager.get_linear_issues()
Pull issues from Linear MCP server matching a query.
Source: app/mcp/client.py:47
Signature:
team_id(str): Linear team identifier (e.g.,"ENG","DESIGN","INFRA")query(str): Free-text search query — typically issue IDs or keywords
[] if:
LINEAR_MCP_URLis not configured- Linear MCP server is unreachable
- MCP call times out (10-second timeout)
- No issues match the query
MCP Protocol Details
Nectr calls the Linear MCP server using JSON-RPC 2.0 over HTTP:Request Format
Response Format
MCPClientManager unwraps this format automatically:
Timeout and Error Handling
The Linear MCP client has a 10-second timeout to prevent slow external services from blocking PR reviews.Linear integration is best-effort. If the MCP server is down or slow, PR reviews continue without Linear context. This is by design — external context should enhance reviews, not block them.
Identifying Linear Issues in PRs
Nectr uses several strategies to identify Linear issue references:Pattern Matching
Branch Name Detection
Usage in PR Review Flow
Here’s how Linear context is pulled during a review:Example Review with Linear Context
Here’s how Linear context appears in an AI-generated review:Team ID Configuration
Currently, the team ID is passed directly toget_linear_issues(). You can make this configurable:
Per-Repository Team Mapping
Auto-Detection from Issue IDs
Troubleshooting
No Linear context appearing in reviews
1
Check environment variables
2
Test Linear MCP server directly
3
Check Nectr logs
4
Verify PR has Linear issue references
PR title or body must contain issue IDs like “ENG-123”.
Linear MCP server timing out
Authentication errors
- Check API key format: Should start with
lin_api_ - Verify key permissions: Must have read access to issues
- Check key expiration: Linear API keys don’t expire but can be revoked
Related Integrations
Sentry Integration
Pull production errors for changed files
Slack Integration
Include relevant team messages in review context
Related Files
app/mcp/client.py:47-get_linear_issues()implementationapp/mcp/client.py:118- Genericquery_mcp_server()methodapp/services/pr_review_service.py- How Linear context is used in reviewsapp/core/config.py:66-LINEAR_MCP_URLandLINEAR_API_KEYsettings