Linear MCP Server

by scoutos
Verified

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 searching, reading, updating, and commenting on issues in Linear's issue tracking system.

线性 MCP 服务器

用于线性积分的 MCP 服务器的 Node.js 实现。

关于

该 MCP(模型上下文协议)服务器为 AI 模型与线性问题跟踪功能交互提供了标准化接口。

主要特点

  • 使用官方 MCP SDK 实现 Linear 的标准 MCP 协议
  • 支持搜索问题、阅读详情、更新和评论

入门

先决条件

  • Node.js (v18 或更高版本)
  • 线性 API 密钥

安装

  1. 克隆存储库
  2. 安装依赖项
npm install
  1. 使用您的 Linear API 密钥在根目录中创建一个.env文件
LINEAR_API_KEY=your_linear_api_key_here

运行服务器

启动服务器:

npm start

对于使用文件监视进行开发:

just dev

对于使用调试日志进行开发:

just debug

或者手动设置环境变量:

LOG_LEVEL=DEBUG NODE_ENV=development node src/index.js

日志将被写入logs/mcp-linear.log文件以避免干扰 STDIO 传输。

与 MCP Inspector 一起使用

服务器以 stdio 模式运行,这意味着您可以使用 MCP Inspector 连接到它。

  1. 在一个终端中启动服务器:
npm start
  1. 访问基于 Web 的检查器: https://inspector.modelcontextprotocol.ai
  2. 选择“stdio”作为传输类型
  3. 输入以下命令:
node /path/to/mcp-linear/src/index.js
  1. 单击“连接”以连接到您正在运行的服务器

与 Claude Desktop 一起使用

将以下内容添加到您的 Claude Desktop 配置文件中(通常位于~/.config/Claude Desktop/claude_desktop_config.json ):

{ "mcp": { "servers": [ { "name": "Linear", "command": "node /path/to/mcp-linear/src/index.js", "env": { "LINEAR_API_KEY": "your_linear_api_key_here" } } ] } }

与游标一起使用

对于光标,将以下内容添加到您的设置中:

{ "ai.mcp.servers": [ { "name": "Linear", "command": "node /path/to/mcp-linear/src/index.js", "env": { "LINEAR_API_KEY": "your_linear_api_key_here" } } ] }

测试您的集成

要验证您的设置:

  1. 在 Claude Desktop 或 Cursor 设置中配置 MCP 服务器
  2. 重启你的应用程序
  3. 询问:“搜索包含‘bug’的线性问题”
  4. 助手应该检测并使用 Linear MCP 服务器来检索结果

项目结构

/ ├── src/ # Source code │ ├── effects/ # Effects implementation │ │ ├── linear/ # Linear API effects │ │ │ └── types/ # Linear type definitions │ │ └── logging/ # Logging effects for safe logging with STDIO │ ├── tools/ # MCP tools implementation │ │ ├── types/ # Tool type definitions │ │ └── utils/ # Tool utility functions │ ├── utils/ # Utility modules │ │ └── config/ # Configuration utilities │ └── index.js # Main entry point ├── docs/ # Documentation │ └── llm_context/ # Documentation for LLMs ├── logs/ # Log files (created at runtime) └── package.json # Project configuration

可用工具

MCP 服务器公开以下工具:

  • list_issues - 列出线性问题(也称为票证)以及各种过滤选项(受让人、状态等)
  • get_issue - 通过 ID 获取有关特定线性问题的详细信息
  • list_members - 列出线性团队成员,并可选择按姓名进行过滤
  • list_projects - 列出线性项目,并可选择按团队、名称和存档状态进行筛选
  • get_project - 获取有关特定 Linear 项目的详细信息,包括问题、成员等
  • list_teams - 列出线性团队及其成员、项目和问题的详细信息
  • add_comment - 为特定的 Linear 问题添加评论
  • create_issue - 使用可自定义的标题、描述、优先级和受让人在 Linear 中创建新问题

为了向后兼容,还提供以下工具别名:

  • list_tickets - list_issues的别名
  • get_ticket - get_issue的别名

故障排除

如果您遇到 Linear MCP 服务器问题:

  1. 检查你的 Linear API 密钥:确保你在 .env 文件或环境变量中设置了有效的 Linear API 密钥。Linear API 密钥应以“lin api ”开头。
  2. 启用调试日志记录a. 启动 MCP 服务器时:
    just debug # or LOG_LEVEL=DEBUG NODE_ENV=development node src/index.js
    b. 在您的客户端配置中(Claude Desktop、Cursor 等):
    "env": { "LINEAR_API_KEY": "your_linear_api_key_here", "LOG_LEVEL": "DEBUG" }
    c.直接调用工具时,添加debug参数:
    { "debug": true }
  3. 检查日志文件:检查logs/mcp-linear.log文件中的日志以获取详细的错误信息。
  4. 验证线性 API 访问权限:确保您的线性 API 密钥具有适当的权限,并且您可以直接访问线性 API。

建筑学

该应用程序遵循基于效果的架构:

  • 效果:副作用操作被隔离在effects目录中:
    • linear :使用官方 Linear SDK 提供对 Linear API 的访问
    • logging :安全日志记录,不会干扰 STDIO 传输
  • 工具:使用效果作为副作用的 MCP 工具实现:
    • 每个工具都遵循使用 Zod 进行输入验证的一致模式
    • 工具通过服务器通过 MCP 协议公开
    • 每个工具都可以通过线性效果访问 Linear 客户端
  • Utils :用于配置和常用功能的实用程序模块

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Deno 实现使 AI 模型能够与 Linear 问题跟踪功能进行交互,支持搜索问题、阅读详细信息、更新和评论。

  1. About
    1. Key Features
  2. Getting Started
    1. Prerequisites
    2. Installation
    3. Running the Server
    4. Using with MCP Inspector
    5. Usage with Claude Desktop
    6. Usage with Cursor
    7. Testing Your Integration
  3. Project Structure
    1. Available Tools
      1. Troubleshooting
        1. Architecture
          1. Contributing
            1. License
              ID: 728qtm68bf