Linear
Official Linear MCP server integration with OAuth authentication. Provides issue management, project tracking, and ensures work completeness. Zero configuration - OAuth handles authentication automatically.
Installation
First, install the Han CLI tool:
npm install -g @thebushidocollective/hanThen install the plugin:
han plugin install sensei-linearOverview
MCP server for Linear integration with automatic acceptance criteria validation. Connects Claude Code directly to your Linear workspace for seamless issue management and quality enforcement.
What This Sensei Provides
MCP Server: Linear
This sensei connects Claude Code to Linear and provides complete issue lifecycle management with built-in validation to ensure work meets acceptance criteria before marking issues complete.
Key Capabilities:
- Issue Management: Create, read, update, and manage Linear issues
- Project & Team Access: Work across projects and teams
- Acceptance Criteria Validation: Automatic validation on Stop hook
- Workflow States: Update issue states and track progress
- Labels & Priorities: Organize with labels and set priorities
- Comments & Updates: Add comments and update issue fields
- Cycle Management: View and manage sprint/cycle issues
- Relationships: Link related issues and manage dependencies
Automatic Validation
When you stop a Claude Code session, this sensei automatically:
- Scans the conversation for any Linear issue identifiers (e.g., ENG-123, PROD-456)
- Reminds you to validate that work meets acceptance criteria
- Prompts Claude to fetch issue details and verify completeness
- Prevents incomplete work from being marked as done
This ensures you never forget to validate your work against issue requirements.
Available MCP Tools
Once installed, Claude Code gains access to these Linear MCP tools:
linear_get_issue: Get full details of a specific issuelinear_search_issues: Search for issues with filterslinear_create_issue: Create new Linear issueslinear_update_issue: Update issue fieldslinear_update_issue_state: Change issue workflow statelinear_add_comment: Add comments to issueslinear_get_user: Get user informationlinear_get_team: Get team detailslinear_get_project: Get project informationlinear_list_projects: List all projectslinear_list_cycles: List active cycles/sprints
Installation
Prerequisites
- Linear Workspace: You need access to a Linear workspace
- API Key: Generate a Linear API key
- Node.js: For running the MCP server (comes with Claude Code)
Getting an API Key
- Go to https://linear.app/settings/api
- Click "Create new API key"
- Give it a name (e.g., "Claude Code MCP")
- Copy the API key immediately (it won't be shown again)
- Save it securely
Via Han Marketplace
npx @thebushidocollective/han install
Or install manually:
claude plugin marketplace add thebushidocollective/han
claude plugin install sensei-linear@han
Configuration
Set required environment variable:
export LINEAR_API_KEY="lin_api_xxxxxxxxxxxxxxxxxxxxxxxx"
Add to your shell profile (~/.zshrc or ~/.bashrc) for persistence:
echo 'export LINEAR_API_KEY="lin_api_xxxxxxxxxxxxxxxxxxxxxxxx"' >> ~/.zshrc
source ~/.zshrc
Verify Installation
Test the MCP server connection:
# Should connect without errors
LINEAR_API_KEY="your-key" npx -y @modelcontextprotocol/server-linear
Manual Installation
If not using Han, add to your Claude Code settings (~/.claude/settings.json):
{
"mcpServers": {
"linear": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-linear"],
"env": {
"LINEAR_API_KEY": "lin_api_xxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}
Usage
Example 1: Start Working on an Issue
User: I need to work on ENG-123
Claude: Let me get the details of that issue.
[Uses linear_get_issue to fetch issue]
Here's ENG-123:
Title: Add user authentication
Status: To Do
Assignee: Unassigned
Priority: High
Description:
Implement JWT-based authentication for the API.
Acceptance Criteria:
- User can log in with email/password
- Invalid credentials return proper error
- JWT token expires after 7 days
- Refresh token mechanism implemented
Would you like me to update this to "In Progress" and assign it to you?
Example 2: Search for Your Issues
User: Show me all my open issues
Claude: [Uses linear_search_issues with assignee filter]
You have 4 open issues:
| ID | Title | Status | Priority |
|---------|-------------------------|-------------|----------|
| ENG-123 | Add authentication | In Progress | High |
| ENG-124 | Fix login redirect | To Do | Medium |
| ENG-125 | Update user profile | In Progress | Low |
| ENG-126 | Add password reset | To Do | High |
Which one would you like to work on?
Example 3: Validate Acceptance Criteria
User: I've finished the authentication work for ENG-123
Claude: Let me validate the acceptance criteria.
[Uses linear_get_issue to fetch current state]
Checking ENG-123 acceptance criteria:
â
User can log in with email/password - IMPLEMENTED
â
Invalid credentials return proper error - IMPLEMENTED
â
JWT token expires after 7 days - IMPLEMENTED
â
Refresh token mechanism implemented - IMPLEMENTED
All acceptance criteria are met! Would you like me to:
1. Add a comment documenting completion
2. Update status to "Done"
3. Create a pull request linking this issue
Example 4: Create a New Issue
User: Create a bug issue for the login page not redirecting properly
Claude: I'll create a bug issue for you.
[Uses linear_create_issue]
Created ENG-127: Login page not redirecting properly
Team: Engineering
Priority: High
Assignee: You
Status: Backlog
View: https://linear.app/your-workspace/issue/ENG-127
Would you like to start working on this now?
Example 5: Stop Hook Validation
When you stop Claude Code after working on issues:
[Stop Hook Executes]
Found Linear issues: ENG-123, ENG-124
â ïž VALIDATION REQUIRED
Before stopping, please validate:
- Fetch ENG-123 details and review acceptance criteria
- Confirm all criteria are met
- Fetch ENG-124 details and review acceptance criteria
- Confirm all criteria are met
[Claude automatically asks:]
Let me validate these issues before we stop...
[Uses MCP tools to verify completion]
Tool Reference
linear_get_issue
Purpose: Get comprehensive details of a specific Linear issue
Parameters:
issueId(required): The issue ID or identifier (e.g., "ENG-123")
Returns: Full issue object including title, description, status, assignee, comments, etc.
Example:
{
"issueId": "ENG-123"
}
linear_search_issues
Purpose: Search for issues with various filters
Parameters:
teamId(optional): Filter by team IDassigneeId(optional): Filter by assigneestateId(optional): Filter by workflow statepriority(optional): Filter by priority (0-4)labelIds(optional): Filter by label IDsprojectId(optional): Filter by project
Returns: Array of matching issues
Example:
{
"assigneeId": "current-user-id",
"stateId": "in-progress-state-id"
}
linear_create_issue
Purpose: Create a new Linear issue
Parameters:
title(required): Issue titleteamId(required): Team IDdescription(optional): Issue description (supports markdown)assigneeId(optional): Assignee user IDpriority(optional): Priority (0-4, where 0=None, 1=Urgent, 2=High, 3=Medium, 4=Low)stateId(optional): Initial state IDlabelIds(optional): Array of label IDsprojectId(optional): Project ID
Returns: Created issue details
Example:
{
"title": "Add user authentication",
"teamId": "team-id-here",
"description": "Implement JWT-based authentication",
"priority": 2
}
linear_update_issue
Purpose: Update issue fields
Parameters:
issueId(required): The issue IDtitle(optional): New titledescription(optional): New descriptionassigneeId(optional): New assigneepriority(optional): New prioritylabelIds(optional): New label IDs
Returns: Update confirmation
Example:
{
"issueId": "ENG-123",
"assigneeId": "user-id",
"priority": 1
}
linear_update_issue_state
Purpose: Change issue workflow state
Parameters:
issueId(required): The issue IDstateId(required): Target state ID
Returns: State change confirmation
Example:
{
"issueId": "ENG-123",
"stateId": "done-state-id"
}
linear_add_comment
Purpose: Add a comment to an issue
Parameters:
issueId(required): The issue IDbody(required): Comment text (supports markdown)
Returns: Comment confirmation
Example:
{
"issueId": "ENG-123",
"body": "Completed implementation. Ready for review."
}
linear_get_team
Purpose: Get team information
Parameters:
teamId(required): The team ID or key (e.g., "ENG")
Returns: Team details including states, labels, members
Example:
{
"teamId": "ENG"
}
linear_list_projects
Purpose: List all accessible projects
Parameters: None
Returns: Array of projects
Example:
{}
linear_list_cycles
Purpose: List active cycles/sprints
Parameters:
teamId(optional): Filter by team
Returns: Array of cycles
Example:
{
"teamId": "ENG"
}
Common Workflows
Starting Work
- Search for issues assigned to you
- Get issue details with acceptance criteria
- Update state to "In Progress"
- Start implementation
Completing Work
- Review acceptance criteria
- Validate all criteria are met
- Add completion comment
- Update state to "Done"
Daily Standup
- List issues you worked on yesterday (updated recently)
- List issues currently in progress
- Check for any blockers
Security Considerations
API Key Security:
- Never commit API keys to version control
- Store keys in environment variables only
- Use separate keys for different environments
- Rotate keys regularly
- Revoke unused keys immediately
Permissions:
- MCP server inherits your Linear permissions
- Claude can only perform actions you're authorized to do
- Review actions before Claude executes them
- Be cautious with bulk operations
Data Privacy:
- Issue data is transmitted to Claude for processing
- Sensitive information in issues will be visible to Claude
- Consider using separate workspaces for sensitive projects
Limitations
- Rate Limits: Linear has API rate limits (typically 2000 requests/hour)
- Bulk Operations: Large bulk operations may timeout
- Custom Fields: Support depends on MCP server implementation
- Attachments: File upload/download may have size limits
- Advanced Queries: Complex filtering might require multiple API calls
- Permissions: You can only access issues your Linear account has permission to view
Troubleshooting
Issue: Connection Errors
Solution:
-
Verify environment variable is set:
echo $LINEAR_API_KEY -
Test API access directly:
curl -H "Authorization: $LINEAR_API_KEY" \ https://api.linear.app/graphql \ -d '{"query":"{ viewer { id name } }"}' -
Ensure API key starts with
lin_api_
Issue: Authentication Failed
Solution:
- Regenerate API key at https://linear.app/settings/api
- Ensure no extra spaces or quotes around the key
- Try wrapping key in single quotes in shell config
- Verify key has necessary permissions
Issue: No Issues Found
Solution:
- Verify team ID/key is correct (case-sensitive)
- Check your Linear permissions for the workspace
- Simplify search filters to test
- Use Linear's web UI to verify issue exists
Issue: State Transition Failed
Solution:
- Get available states using
linear_get_team - Check exact state ID (not name)
- Verify issue is in correct state for transition
- Check if transition requires specific fields
Issue: Stop Hook Not Working
Solution:
- Ensure hooks are enabled in plugin settings
- Check that issue IDs are in conversation (format: ABC-123)
- Verify Node.js is available in PATH
- Check Claude Code logs for hook execution errors
Related Plugins
- sensei-jira: For teams using Jira instead of Linear
- bushido:proof-of-work: Requires concrete evidence of task completion
- bushido:test-driven-development: Ensures tests exist for acceptance criteria
Best Practices
DO
â Always read issue acceptance criteria before starting work â Update issue state as you progress through work â Add meaningful comments at key milestones â Validate all acceptance criteria before marking Done â Use clear, descriptive issue titles â Link related issues to maintain context â Keep issue descriptions clear and updated â Set appropriate priorities
DON'T
â Skip reading acceptance criteria â Mark issues Done without validation â Leave issues in wrong state â Create duplicate issues without searching first â Update issues without adding context in comments â Use vague or unclear issue titles â Ignore the Stop hook validation reminders â Forget to assign issues when starting work
Contributing
See CONTRIBUTING.md for guidelines.
License
MIT License - See LICENSE for details.
Links
Built with â€ïž by The Bushido Collective
MCP Servers
linear
Commands
/comment
Add a comment to a Linear issue
/complete
Mark a Linear issue as complete after validating acceptance criteria
/create
Create a new Linear issue interactively
/issue
Get detailed information about a specific Linear issue
/my-issues
Show all Linear issues assigned to you
/search
Search for Linear issues
/start
Start work on a Linear issue (transition to In Progress)
/validate
Validate acceptance criteria for a Linear issue without changing status
Hooks
Stop
Runs when the main Claude Code agent has finished responding.
node