Linear MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides tools for interacting with Linear's API to manage teams, issues, projects, and cycles, including searching issues, creating and updating issues, and retrieving team-related data.

线性 MCP 服务器

这是 Linear 的模型上下文协议 (MCP) 服务器,允许 Claude 与 Linear 的 API 交互来管理团队、问题、项目和周期。

特征

  • linear_get_teams :获取所有球队及其状态和标签
  • linear_search_issues :搜索过滤和分页问题
  • linear_get_cycles :获取团队的所有周期
  • linear_get_projects :获取所有项目
  • linear_create_issue :创建新问题
  • linear_update_issue :更新现有问题

快速入门

对于 Cline MCP Marketplace 用户:

  1. 通过 Cline MCP Marketplace安装服务器
  2. 在 MCP 配置文件中配置您的 Linear 凭据
  3. 通过测试与linear_search_issues的连接来验证安装

请参阅下面详细的安装验证部分。

安装

  1. 克隆此存储库
  2. 安装依赖项:
    npm install
  3. 构建服务器:
    npm run build

安装过程主要分为三个步骤:

  1. 设置:克隆并构建服务器(上述步骤)
  2. 配置:设置您的 Linear OAuth 令牌并配置 MCP 服务器
  3. 验证:测试连接以确保其正常工作

⚠️在您确认连接正常之前,您的安装尚未完成!

配置

服务器需要 Linear OAuth 令牌才能使用 Linear API 进行身份验证。您可以在 MCP 配置文件中设置此令牌。

获取线性 OAuth 令牌

  1. https://linear.app/settings/api/applications创建一个 Linear OAuth 应用程序
  2. 创建 OAuth 应用程序
  3. 将应用程序命名为 Cline MCP
  4. 将重定向 URI 设置为http://localhost:3000/callback
  5. 记下客户端 ID 和客户端密钥
  6. 创建并复制基于用户的开发者令牌

MCP 配置

将以下内容添加到您的 MCP 配置文件中:

{ "mcpServers": { "github.com/cpropster/linear-mcp-server": { "command": "node", "args": [ "/path/to/linear-mcp-server/build/index.js" ], "env": { "LINEAR_CLIENT_ID": "your-client-id", "LINEAR_CLIENT_SECRET": "your-client-secret", "LINEAR_REDIRECT_URI": "http://localhost:3000/callback", "LINEAR_REFRESH_TOKEN": "your-refresh-token" }, "disabled": false, "autoApprove": [] } } }

将占位符凭据替换为您的实际凭据。

验证安装

⚠️重要提示:在您验证 MCP 连接正常工作之前,您的安装尚未完成。

配置 MCP 服务器后,您必须测试连接以确保其正常工作:

  1. 重新加载 MCP 配置
  2. 使用linear_search_issues工具测试连接:
use_mcp_tool( server_name="github.com/cpropster/linear-mcp-server", tool_name="linear_search_issues", arguments={ "first": 5 } )

如果成功,您将看到如下响应:

{ "issues": { "nodes": [ { "id": "123abc", "title": "Example issue 1", "identifier": "TEAM-123", "description": "This is an example issue" // ... other issue data }, // ... more issues ] } }

如果连接正常,您将看到 Linear 帐户中的问题列表。如果发现错误,请检查您的配置和凭据。

常见问题:

  • args字段中的服务器路径不正确
  • 无效或过期的线性令牌
  • 缺少必需的环境变量
  • 服务器在配置中被禁用

用法

获取团队

使用linear_get_teams工具检索所有团队:

use_mcp_tool( server_name="github.com/cpropster/linear-mcp-server", tool_name="linear_get_teams", arguments={} )

搜索问题

使用linear_search_issues工具搜索问题:

use_mcp_tool( server_name="github.com/cpropster/linear-mcp-server", tool_name="linear_search_issues", arguments={ "query": "Optional search query", "teamIds": ["Optional team IDs"], "first": 10 // Number of issues to return (default: 50) } )

获取周期

使用linear_get_cycles工具检索团队的周期:

use_mcp_tool( server_name="github.com/cpropster/linear-mcp-server", tool_name="linear_get_cycles", arguments={ "teamId": "required-team-id" } )

获取项目

使用linear_get_projects工具检索项目:

use_mcp_tool( server_name="github.com/cpropster/linear-mcp-server", tool_name="linear_get_projects", arguments={ "teamId": "optional-team-id", "first": 10 // Number of projects to return (default: 50) } )

创建问题

使用linear_create_issue工具创建新问题:

use_mcp_tool( server_name="github.com/cpropster/linear-mcp-server", tool_name="linear_create_issue", arguments={ "teamId": "required-team-id", "title": "Required issue title", "description": "Optional issue description", "assigneeId": "optional-assignee-id", "stateId": "optional-state-id", "priority": 0, // Optional priority (0-4) "estimate": 1, // Optional estimate "cycleId": "optional-cycle-id", "projectId": "optional-project-id", "labelIds": ["optional-label-ids"] } )

更新问题

使用linear_update_issue工具更新现有问题:

use_mcp_tool( server_name="github.com/cpropster/linear-mcp-server", tool_name="linear_update_issue", arguments={ "issueId": "required-issue-id", "title": "Optional new title", "description": "Optional new description", "assigneeId": "optional-assignee-id", "stateId": "optional-state-id", "priority": 0, // Optional priority (0-4) "estimate": 1, // Optional estimate "cycleId": "optional-cycle-id", "projectId": "optional-project-id", "labelIds": ["optional-label-ids"] } )

调试

如果您在验证步骤中遇到问题,或者 MCP 连接停止工作,您可以使用以下调试技术:

  1. 检查 MCP 配置:确保您的 MCP 配置文件具有正确的服务器路径和凭据。
  2. 运行测试客户端:使用附带的测试客户端验证服务器是否可以连接到 Linear:
    node test-client.js
    这将运行一系列测试来验证服务器是否可以连接到 Linear 并检索数据。
  3. 检查线性 API 状态:验证线性 API 是否在status.linear.app上运行。
  4. 检查服务器日志:如果您手动运行服务器,请检查控制台输出中的错误消息。

发展

该服务器使用 TypeScript 和 Linear SDK 构建。主要实现位于src/index.ts中。

要对服务器进行更改:

  1. 编辑src/中的源代码
  2. 使用npm run build构建服务器
  3. 使用测试客户端测试您的更改
  4. 更新 MCP 配置以使用新版本

安全注意事项

此 MCP 服务器需要访问您的 Linear 帐户。为了确保您的数据安全:

  1. 切勿提交敏感令牌.env文件和任何包含令牌的文件都被排除在.gitignore之外
  2. 使用环境变量:在 MCP 配置中始终使用环境变量,而不是硬编码令牌
  3. 限制权限:创建线性 OAuth 应用程序时,仅授予所需的权限
  4. 定期轮换令牌:定期生成新令牌并更新您的配置

服务器使用官方的 Linear SDK,并通过 HTTPS 与 Linear 的 API 通信,确保您的数据安全传输。

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

模型上下文协议服务器允许 Claude 与 Linear 的 API 进行交互,以管理团队、问题、项目和周期。

  1. Features
    1. Quick Start
      1. Installation
        1. Configuration
          1. Getting a Linear OAuth Token
          2. MCP Configuration
          3. Verifying Installation
        2. Usage
          1. Getting Teams
          2. Searching Issues
          3. Getting Cycles
          4. Getting Projects
          5. Creating Issues
          6. Updating Issues
        3. Debugging
          1. Development
            1. Security Considerations
              1. License
                ID: wcsdmumony