Linear MCP Server

by emmett-deen
Verified

线性 MCP 服务器

Linear GraphQL API 的模型上下文协议 (MCP) 服务器实现,使 AI 助手能够与 Linear 项目管理系统进行交互。

特征

  • 通过 MCP 工具访问 Linear 的 GraphQL API
  • 通过线性 API 密钥进行身份验证
  • 检索和修改与用户、团队、项目和问题相关的数据
  • 创建、更新和评论问题
  • 添加和删除标签
  • 创建项目
  • 可用工具的综合文档

安装

通过 Smithery 安装(推荐)

要通过 Smithery 自动为 Claude Desktop 安装 Linear MCP 服务器:

npx -y @smithery/cli install @emmett.deen/linear-mcp-server --client claude

手动配置

安装后,将以下内容添加到您的 MCP 设置文件中:

{ "mcpServers": { "linear": { "command": "npx", "args": ["-y", "@emmett.deen/linear-mcp-server"], "env": { "LINEAR_API_KEY": "your_linear_api_key_here" } } } }

客户端特定的配置位置

  • Claude 桌面: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Claude VSCode 扩展: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  • GoMCP: ~/.config/gomcp/config.yaml

手动安装

  1. 克隆存储库
git clone https://github.com/yourusername/Linear-MCP-Server.git cd Linear-MCP-Server
  1. 安装依赖项
npm install
  1. 构建项目
npm run build
  1. 使用您的 Linear API 令牌创建一个.env文件
LINEAR_API_KEY=your_linear_api_key_here
  1. 启动服务器
npm start

可用工具

请参阅TOOLS.md以获取可用工具和计划功能的完整列表。

概述

Linear-MCP-Server 通过实现 MCP 协议,弥合了 Claude(AI 助手)和 Linear(项目管理工具)之间的差距。这使得 Claude 能够:

  • 从 Linear 检索问题、项目、团队和其他数据
  • 创建和更新问题
  • 更改问题状态
  • 将问题分配给团队成员
  • 添加评论
  • 创建项目和团队

为了简单起见,服务器使用 Linear 的 GraphQL API 并通过用户令牌(而非 OAuth)进行身份验证。

入门

先决条件

  • Node.js(v18+)
  • NPM 或 Yarn
  • 线性 API 令牌

安装

# Install globally npm install -g @emmett.deen/linear-mcp-server # Or clone and install locally git clone https://github.com/yourusername/Linear-MCP-Server.git cd Linear-MCP-Server npm install npm link # Makes the package available globally

运行服务器

使用您的 Linear API 令牌运行服务器:

linear-mcp-server --token YOUR_LINEAR_API_TOKEN

或者在您的环境中设置令牌并运行而不带参数:

export LINEAR_API_TOKEN=YOUR_LINEAR_API_TOKEN linear-mcp-server

与 Claude Desktop 一起使用

要将此 MCP 服务器与 Claude Desktop 一起使用:

  1. 在 Claude Desktop 中启用开发者模式(从菜单栏)
  2. 前往“设置”>“开发者选项”
  3. 点击“添加服务器”
  4. 使用以下设置进行配置:
    • 名称:线性MCP服务器
    • 类型:本地流程
    • 命令:linear-mcp-server
    • 参数:--token YOUR_LINEAR_API_TOKEN

或者,手动编辑配置文件:

{ "mcp": { "servers": [ { "name": "Linear MCP Server", "transport": { "type": "stdio", "command": "linear-mcp-server", "args": ["--token", "YOUR_LINEAR_API_TOKEN"] } } ] } }
  1. 保存配置
  2. 重新启动 Claude Desktop(完全退出并重新打开)
  3. 您现在应该可以看到 Linear MCP Server 可以作为 Claude 中的一个工具使用

克劳德提示示例

一旦连接到 Claude Desktop,您可以使用如下提示:

  • “显示我所有的 Linear 问题”
  • “在前端团队中创建一个名为‘修复登录错误’的新问题”
  • “将问题 FE-123 的状态更改为‘进行中’”
  • “将问题 BE-456 分配给 John Smith”
  • “向问题 UI-789 添加一条评论:‘这个问题需要在周五之前修复’”

发展

本地开发:

# Clone the repository git clone https://github.com/yourusername/Linear-MCP-Server.git cd Linear-MCP-Server # Install dependencies npm install # Run in development mode npm run dev -- --token YOUR_LINEAR_API_TOKEN

扩展服务器

要向服务器添加新工具:

  1. 按照TOOLS.md文档中的实现指南进行操作
  2. 确保遵循src/目录中已建立的代码结构
  3. 更新文档以反映您的更改

开发和贡献

设置开发环境

  1. 克隆存储库
git clone https://github.com/yourusername/Linear-MCP-Server.git cd Linear-MCP-Server
  1. 安装依赖项
npm install
  1. 以开发模式启动
npm run dev

发布到 npm

要将此包发布到 npm:

  1. 更新 package.json 中的版本
npm version patch # or minor, or major
  1. 构建项目
npm run build
  1. 确保你已经登录 npm
npm login
  1. 发布到 npm
npm publish --access public
  1. 对于 Smithery 注册,您需要与 Smithery 团队合作,将您的服务器列在他们的目录中。

执照

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

-
security - not tested
-
license - not tested
-
quality - not tested

模型上下文协议服务器实现,使 AI 助手能够与线性项目管理系统交互,从而允许他们创建、检索和修改与问题、项目、团队和用户相关的数据。

  1. Features
    1. Installation
      1. Installing via Smithery (Recommended)
      2. Manual Configuration
      3. Client-Specific Configuration Locations
      4. Manual Installation
    2. Available Tools
      1. Overview
        1. Getting Started
          1. Prerequisites
          2. Installation
          3. Running the Server
        2. Using with Claude Desktop
          1. Example Claude Prompts
            1. Development
              1. Extending the Server
            2. Developing and Contributing
              1. Setup Development Environment
              2. Publishing to npm
            3. License
              ID: dovgqzwp7b