GitHub MCP Server + Linear MCP Server

Intermediate45 minutes
Use Cases

Common Use Cases

  • Bug report syncing
  • Feature request tracking
  • Sprint planning integration
  • Status synchronization
Before You Begin

Prerequisites

  • GitHub repository access
  • Linear workspace with API key
  • Node.js 18+
Walkthrough

Step-by-Step Guide

1

Configure Both MCP Servers

Set up GitHub and Linear MCP Servers with appropriate API tokens.

2

Define Sync Rules

Map GitHub labels to Linear statuses and priorities.

3

Implement GitHub to Linear Sync

When a GitHub issue is created with specific labels, create a corresponding Linear issue.

async function syncToLinear(githubIssue) {
  const priority = mapPriority(githubIssue.labels);
  const linearIssue = await linear.createIssue({
    title: githubIssue.title,
    description: `${githubIssue.body}\n\n---\nSynced from: ${githubIssue.html_url}`,
    teamId: ENGINEERING_TEAM_ID,
    priority
  });
  await github.createComment({ issue_number: githubIssue.number, body: `Tracked in Linear: ${linearIssue.url}` });
}
4

Implement Status Sync

When a Linear issue changes status, update the corresponding GitHub issue labels.

5

Handle Edge Cases

Manage duplicate prevention, deleted issues, and comment syncing.

Examples

Code Examples

typescript
Priority Mapping
function mapPriority(labels) {
  if (labels.includes("P0")) return 1; // Urgent
  if (labels.includes("P1")) return 2; // High
  if (labels.includes("P2")) return 3; // Medium
  return 4; // Low
}
typescript
Bidirectional Sync
async function syncStatus(linearIssue) {
  const githubIssueNumber = extractGithubNumber(linearIssue.description);
  if (!githubIssueNumber) return;
  const labelMap = { "Done": "completed", "In Progress": "in-progress", "Backlog": "backlog" };
  await github.updateIssue({ issue_number: githubIssueNumber, labels: [labelMap[linearIssue.state.name]] });
}
Help

Troubleshooting

How do I prevent sync loops?+
What if someone edits in both places?+

Quick Info

DifficultyIntermediate
Time Estimate45 minutes
Tools
GitHub MCP ServerLinear MCP Server

Need Integration Help?

Our team can implement this integration for you.

Get in Touch
CortexAgent Customer Service

Want to skip the form?

Our team is available to help you get started with CortexAgent.

This chat may be recorded for quality assurance. You can view our Privacy Policy.

GitHub MCP Server + Linear MCP Server Integration - CortexAgent