Skip to main content
Glama

mcp-linear

MCP 服务器,暴露 Linear 问题操作。独立运行——不依赖内置的 Claude Linear MCP。

问题通过其人类可读标识符(GOV-123)来引用。状态、团队、标签和指派者按名称给出;服务器将它们解析为 Linear UUID,并在名称不匹配时返回错误,列出有效选项。

工具

工具

描述

get_issue

按标识符获取问题

list_my_issues

分配给 API 密钥所有者的所有问题

search_issues

全文搜索,支持团队/状态/指派者筛选

create_issue

在团队中创建问题

update_issue

更新现有问题的字段

get_comments

获取问题的评论

add_comment

发表评论

list_teams

团队键和名称

list_states

团队的工作流状态

list_labels

团队标签及工作区标签(团队可选)

list_users

活跃用户

Related MCP server: Linear MCP Server

设置

python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
cp .env.example .env
# Edit .env — set LINEAR_API_KEY

获取 API 密钥:Linear → 设置 → 安全与访问 → 个人 API 密钥。写操作需要具有写权限的密钥。

添加到 Claude Code

{
  "mcpServers": {
    "linear": {
      "command": "/Users/piuschungath/Workspace/mcp-linear/.venv/bin/mcp-linear",
      "env": { "LINEAR_API_KEY": "lin_api_..." }
    }
  }
}

测试

.venv/bin/pytest

所有 HTTP 请求均使用 respx 进行模拟。无需 API 密钥,也无需网络访问。

与 mcp-pr-assistant 配合使用

这两个服务器无需相互导入即可组合:使用 get_issue 获取工单,将其字段传递给 create_pr_from_ticket,然后通过 add_comment 将 PR URL 回传。

Schema 验证

src/mcp_linear/queries.py 中的 GraphQL 字段名已于 2026-08-21 针对实时 Linear API 验证,方法是针对真实工作区运行工具的实际查询字符串(而非其副本)。

已验证正确:

  • Float! 问题编号比较器

  • 通过 team { labels } 获取团队范围的标签

  • 根 issueLabels 连接

  • viewer.assignedIssues(orderBy: updatedAt)

  • 三个变更发送的每个字段——IssueCreateInput、IssueUpdateInput 和 CommentCreateInput 均接受所使用的 teamId、title、description、stateId、assigneeId、priority、labelIds、issueId 和 body

发现并修复了一个差异:

  • 全文搜索。 issueSearch 拒绝其 query 参数,因为该参数已弃用。搜索现在使用 searchIssues(term: ...),它返回 IssueSearchPayload,其节点是 IssueSearchResult,而非 Issue——因此无法展开 IssueFields 片段。queries.py 声明了第二个片段 SearchFields,在该类型上具有相同的选择。内省确认 IssueSearchResult 携带 IssueFields 选择的每个字段。如果你更改了一个片段,请同时更改另一个。

有一件事尚未确认:

  • 工作区标签。 根 issueLabels 连接可以解析,但它是仅返回工作区范围的标签,还是也返回属于其他团队的团队范围标签,尚未确定。标签解析首先查询团队自身的标签,因此团队标签总是优先于同名的的工作区标签。

在 Linear schema 更改后重新验证:

LINEAR_API_KEY=lin_api_... .venv/bin/python scripts/probe_schema.py <team-key> <issue-number> <issue-uuid>

它需要一个团队键、该团队上的一个现有问题编号以及该问题的 UUID(并会以交互方式提示一次,要求输入其首次探测打印的团队 UUID)。该探测是只读的:变更通过内省其输入类型来检查,绝不会写入你的跟踪器。

备注

  • Linear 个人 API 密钥以 Authorization: <key> 形式发送,不带 Bearer 前缀。

  • Linear 将大多数失败报告为 HTTP 200,并带有顶层 errors 数组,因此客户端检查响应体而不是状态码。

  • 团队、状态、标签和用户元数据在服务器进程的整个生命周期内缓存。更改团队的工作流状态或标签后,请重启服务器。

Available Tools

11 tools
add_commentA

Post a comment on a Linear issue. Markdown is supported. identifier: human issue identifier, e.g. "GOV-123".

Inputs: body (required), identifier (required).

create_issueA

Create a Linear issue. Returns the created issue including its new identifier. team: team key or name, e.g. "GOV". assignee: user display name or email. See list_users. state: workflow state name, e.g. "Backlog". See list_states. priority: 0 none, 1 urgent, 2 high, 3 medium, 4 low. labels: label names on that team. See list_labels.

Inputs: team (required), title (required), state, labels, +3 more.

get_commentsA

Fetch the comments on a Linear issue, oldest first. identifier: human issue identifier, e.g. "GOV-123".

Inputs: identifier (required). Returns: result

get_issueA

Fetch a Linear issue by its human identifier, e.g. "GOV-123". Returns title, description, state, assignee, team, priority, labels, URL, and the git branch name Linear suggests for the issue.

Inputs: identifier (required).

list_labelsA

List the issue labels that can be applied to an issue, as {name}. team: optional team key or full team name. With a team, returns that team's own labels followed by the workspace-wide labels; without one, the workspace-wide labels only. Names are what create_issue and update_issue accept for labels.

Inputs: team. Returns: result

list_my_issuesA

List issues assigned to the owner of the configured API key, most recently updated first. state: optional state-name filter, e.g. "In Progress". Case-insensitive. The filter is applied after the fetch, so passing one makes the server over-fetch (four times limit, at least 50 issues) and then cut the result back to limit. It is therefore best-effort within that window: a matching issue further down the list than the window reaches is not returned. Raise limit if you suspect one is missing. limit: maximum number of issues returned.

Inputs: limit, state. Returns: result

list_statesA

List the workflow states for a team, in workflow order, as {name, type}. These names are what create_issue and update_issue accept for state. team: team key or full team name.

Inputs: team (required). Returns: result

list_teamsA

List Linear teams as {key, name}. Team keys are the prefix of issue identifiers, e.g. the GOV in GOV-123.

Inputs: no named parameters. Returns: result

list_usersA

List active Linear users as {name, email}. name is the display name that create_issue and update_issue accept for assignee. query: optional case-insensitive substring filter over name and email.

Inputs: query. Returns: result

search_issuesA

Full-text search over Linear issues, with optional filters. team: team key or full team name, e.g. "GOV" or "Governance". state: workflow state name, e.g. "In Progress". Resolved against the team's workflow when team is given; without a team there is no workflow to resolve against, so the value is sent as written and must match the state name Linear stores. assignee: user display name, full name, or email. See list_users. Names are resolved the same way create_issue resolves them: a name that does not match returns an error listing the valid options, not an empty result.

Inputs: query (required), team, limit, state, +1 more. Returns: result

update_issueA

Update fields on an existing Linear issue. Only the fields you pass are changed. identifier: human issue identifier, e.g. "GOV-123". state, assignee, labels: names, resolved against the issue's own team. priority: 0 none, 1 urgent, 2 high, 3 medium, 4 low. Passing labels replaces the issue's labels entirely.

Inputs: identifier (required), state, title, labels, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct resource or action: list_* clearly separates teams, states, labels, users, and my issues, while get_issue, search_issues, and list_my_issues offer different retrieval modes. Comments, creation, and updates are also cleanly separated with no overlapping responsibilities.

    Naming Consistency5/5

    The tools consistently follow a verb_noun snake_case pattern: list_teams, list_states, get_issue, create_issue, update_issue, add_comment, and so on. list_my_issues is a minor variation but still predictable and fits the overall naming logic.

    Tool Count5/5

    With 11 tools, the server is well-scoped for a Linear issue-management integration. It provides reference lookups, issue operations, and comments without redundant or unnecessary tools.

    Completeness4/5

    The core issue lifecycle is covered: create, get, update, search, list-my-issues, and comments, plus supporting lookups for teams, states, labels, and users. Obvious gaps like deleting/archiving issues or listing all issues in a team are minor and can often be worked around with search_issues.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers