Skip to main content
Glama
TastyHeadphones

jira-context-mcp

jira-context-mcp

jira-context-mcp 是一个面向生产环境的 MCP 服务器,用于从 Jira URL 获取结构化的 Jira 问题上下文。它专为 Codex 和 Claude Code 等编码智能体设计,以便它们能够快速理解问题的意图和实现背景。

该服务器的功能

  • 提供一个 MCP 工具:get_jira_issue_from_url

  • 验证输入的 URL 是否属于您的 JIRA_BASE_URL

  • 从多种 Jira URL 格式中提取 Jira 问题键 (issue key)

  • 调用 Jira Cloud REST API:

    • GET /rest/api/3/issue/{issueIdOrKey}?expand=names,renderedFields

  • 将 Jira 富文本(Atlassian 文档格式)转换为纯文本

  • 返回简洁、适合智能体阅读的结构化问题上下文

Related MCP server: JIRA MCP Server

支持的 Jira 问题类型

此服务器与问题类型无关。它适用于任何 Jira 问题类型,包括:

  • Bug

  • 功能请求 (Feature request)

  • 任务 (Task)

  • 故事 (Story)

  • 史诗 (Epic)

  • 需求 (Requirement)

  • 改进 (Improvement)

  • 支持工单 (Support ticket)

  • 自定义问题类型

所需环境变量

  • JIRA_EMAIL: Jira 账户邮箱

  • JIRA_API_TOKEN: Jira API 令牌

  • JIRA_BASE_URL: Jira Cloud 租户 URL(例如:https://your-domain.atlassian.net)

快速设置命令

Codex(无需全局安装)

codex mcp add jira \
  --env JIRA_EMAIL=you@example.com \
  --env JIRA_API_TOKEN=your-token \
  --env JIRA_BASE_URL=https://your-domain.atlassian.net \
  -- npx -y github:TastyHeadphones/jira-context-mcp

Claude Code(无需全局安装)

claude mcp add jira \
  -e JIRA_EMAIL=you@example.com \
  -e JIRA_API_TOKEN=your-token \
  -e JIRA_BASE_URL=https://your-domain.atlassian.net \
  -- npx -y github:TastyHeadphones/jira-context-mcp

可选:先全局安装

npm install -g github:TastyHeadphones/jira-context-mcp

然后使用本地二进制文件添加:

codex mcp add jira \
  --env JIRA_EMAIL=you@example.com \
  --env JIRA_API_TOKEN=your-token \
  --env JIRA_BASE_URL=https://your-domain.atlassian.net \
  -- jira-context-mcp
claude mcp add jira \
  -e JIRA_EMAIL=you@example.com \
  -e JIRA_API_TOKEN=your-token \
  -e JIRA_BASE_URL=https://your-domain.atlassian.net \
  -- jira-context-mcp

工具

get_jira_issue_from_url

输入:

{
  "url": "string"
}

支持的 URL 示例:

  • ${JIRA_BASE_URL}/browse/ABC-123

  • ${JIRA_BASE_URL}/jira/software/projects/ABC/boards/1/backlog?selectedIssue=ABC-123

  • 任何 JIRA_BASE_URL 下包含类似 ABC-123 问题键的 Jira URL

返回的结构化数据包括:

  • issueKey, issueUrl, summary

  • description(尽可能转换为纯文本)

  • issueType, status, statusCategory, priority

  • assignee, reporter

  • labels, components

  • fixVersions, affectedVersions

  • created, updated, dueDate

  • parent, epic

  • subtasks, linkedIssues

  • attachments(仅元数据)

  • comments(最近 10 条)

  • acceptanceCriteria(从描述/自定义字段中尽力提取)

  • customFields(非空、标准化、人类可读)

创建 Jira API 令牌

  1. 打开 Atlassian API 令牌设置。

  2. 点击 Create API token(创建 API 令牌)。

  3. 为令牌命名并复制它。

  4. 将该值用于 JIRA_API_TOKEN。

本地运行

  1. 安装依赖:

npm install
  1. 设置环境变量(例如通过 shell/会话中的 .env 文件)。

  2. 构建:

npm run build
  1. 启动:

npm start

开发模式:

npm run dev

MCP 配置示例

在您的 MCP 客户端配置中使用此服务器条目:

{
  "mcpServers": {
    "jira": {
      "command": "node",
      "args": ["/absolute/path/to/jira-context-mcp/dist/index.js"],
      "env": {
        "JIRA_EMAIL": "you@example.com",
        "JIRA_API_TOKEN": "your-token",
        "JIRA_BASE_URL": "https://your-domain.atlassian.net"
      }
    }
  }
}

Claude Code MCP 配置示例

在您的 Claude Code MCP 服务器配置文件中使用上述相同的 JSON 块。

Codex MCP 配置示例

在您的 Codex MCP 服务器配置文件中使用上述相同的 JSON 块。

工具调用示例

{
  "name": "get_jira_issue_from_url",
  "arguments": {
    "url": "https://your-domain.atlassian.net/browse/ABC-123"
  }
}

输出示例

{
  "issueKey": "ABC-123",
  "issueUrl": "https://your-domain.atlassian.net/browse/ABC-123",
  "summary": "Prevent duplicate webhook retries",
  "description": "As a platform engineer, I need retry deduplication ...",
  "acceptanceCriteria": "- Duplicate deliveries are ignored\n- Metrics include dropped duplicates",
  "issueType": "Story",
  "status": "In Progress",
  "statusCategory": "In Progress",
  "priority": "High",
  "assignee": {
    "accountId": "5b10ac8d82e05b22cc7d4ef5",
    "displayName": "Alex Example",
    "emailAddress": null,
    "active": true
  },
  "labels": ["webhook", "idempotency"],
  "components": ["API"],
  "fixVersions": ["2026.05"],
  "affectedVersions": ["2026.04"],
  "subtasks": [],
  "linkedIssues": [],
  "attachments": [],
  "comments": [],
  "customFields": []
}

安全说明

  • 请妥善保管 JIRA_API_TOKEN。切勿将其提交到源代码管理中。

  • 为与令牌关联的账户使用最小权限的 Jira 访问权限。

  • 此服务器仅获取问题数据和附件元数据;它不会下载附件文件。

  • URL 验证会拒绝您配置的 JIRA_BASE_URL 之外的 URL。

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    F
    maintenance
    A Model Context Protocol server that enables ChatGPT and other AI assistants to directly interact with JIRA issues, currently offering the ability to retrieve issue details.
    -
  • A
    license
    B
    quality
    D
    maintenance
    Enables fetching and viewing Jira issue details directly through Claude Desktop using secure API token authentication. Provides comprehensive issue information including status, assignee, priority, and descriptions in both human-readable and structured formats.
    10
    424 npm
    1
    MIT