npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cqsjjb/zentao-bug-fix

v1.0.2

Published

禅道Bug解析 MCP 工具 - 在 Cursor Chat 中解析和展示禅道Bug详情

Readme

禅道Bug解析 MCP 工具

这是一个基于 Model Context Protocol (MCP) 的禅道Bug详情解析工具,可以在 Cursor Chat 中直接调用,解析并展示禅道Bug的详细信息,包括图片。

功能特性

  • ✅ 解析禅道Bug页面的详细信息
  • ✅ 提取Bug标题、步骤、结果、期望等结构化内容
  • ✅ 自动提取并展示Bug中的图片
  • ✅ 解析基本信息表格数据
  • ✅ 支持自定义Cookie和超时设置

安装步骤

1. 安装包

npm install -g @cqsjjb/zentao-bug-fix

或者作为项目依赖安装:

npm install @cqsjjb/zentao-bug-fix

2. 配置 Cursor MCP 服务器

在 Cursor 中配置 MCP 服务器,有两种方式:

方式一:全局配置(推荐,适用于全局安装)

编辑 Cursor 的全局配置文件:~/.cursor/mcp.json(Windows: C:\Users\<用户名>\.cursor\mcp.json

如果使用全局安装,使用以下配置:

{
  "mcpServers": {
    "zentao-bug-fix": {
      "command": "node",
      "args": ["<全局node_modules路径>/@cqsjjb/zentao-bug-fix/mcp-server.js"],
      "env": {}
    }
  }
}

Windows 示例

{
  "mcpServers": {
    "zentao-bug-fix": {
      "command": "node",
      "args": ["C:\\Users\\<用户名>\\AppData\\Roaming\\npm\\node_modules\\@cqsjjb\\zentao-bug-fix\\mcp-server.js"],
      "env": {}
    }
  }
}

macOS/Linux 示例

{
  "mcpServers": {
    "zentao-bug-fix": {
      "command": "node",
      "args": ["/usr/local/lib/node_modules/@cqsjjb/zentao-bug-fix/mcp-server.js"],
      "env": {}
    }
  }
}

方式二:项目配置(适用于项目依赖安装)

在项目根目录创建 .cursor/mcp.json 文件:

{
  "mcpServers": {
    "zentao-bug-fix": {
      "command": "node",
      "args": ["./node_modules/@cqsjjb/zentao-bug-fix/mcp-server.js"],
      "env": {}
    }
  }
}

方式三:使用 npx(无需安装,推荐)

使用 npx 可以直接运行包,无需先安装。在 Cursor 的全局配置文件 ~/.cursor/mcp.json(Windows: C:\Users\<用户名>\.cursor\mcp.json)中添加:

{
  "mcpServers": {
    "zentao-bug-fix": {
      "command": "npx",
      "args": ["-y", "@cqsjjb/zentao-bug-fix"],
      "env": {}
    }
  }
}

优势

  • ✅ 无需手动安装包
  • ✅ 自动使用最新版本
  • -y 参数自动确认安装提示

提示:可以使用 npm list -g @cqsjjb/zentao-bug-fixnpm list @cqsjjb/zentao-bug-fix 查找实际安装路径。

3. 重启 Cursor

配置完成后,重启 Cursor IDE 以使配置生效。

使用方法

在 Cursor Chat 中,你可以直接使用以下命令:

使用zentao工具修复这个 http://192.168.1.252/zentao/bug-view-33360.html bug

或者:

获取这个bug的详情:http://192.168.1.252/zentao/bug-view-33360.html

工具会自动:

  1. 解析Bug URL
  2. 获取Bug页面内容
  3. 提取结构化信息(标题、步骤、结果、期望)
  4. 提取并展示所有相关图片
  5. 返回格式化的结果到聊天界面

工具参数

工具支持以下参数:

  • bugUrl (必需): 禅道Bug页面的完整URL
  • cookie (可选): 自定义Cookie字符串,用于身份验证
  • timeout (可选): 请求超时时间(毫秒),默认10000

返回数据格式

工具返回的数据包含以下结构:

{
  "pageTitle": {
    "Bug标题": "xxx",
    "Bug编号": "xxx"
  },
  "legendBasicInfo": {
    "所属产品": "xxx",
    "所属模块": "xxx",
    "Bug状态": "xxx"
  },
  "detail": {
    "title": "Bug详情",
    "content": {
      "steps": "步骤内容",
      "result": "结果内容",
      "expected": "期望内容",
      "images": [
        {
          "src": "图片URL",
          "alt": "图片描述"
        }
      ]
    }
  }
}

项目结构

zentao-bug-fix/
├── zentao-parser.js     # Bug解析核心函数
├── mcp-server.js        # MCP服务器实现
├── package.json         # 项目依赖
├── mcp.json.example     # MCP配置示例
└── README.md           # 本文件

开发说明

核心文件

  • zentao-parser.js: 包含 fetchBugDetail 函数,负责HTTP请求和HTML解析
  • mcp-server.js: MCP服务器实现,将 fetchBugDetail 封装为MCP工具

自定义Cookie

如果需要使用不同的Cookie,可以通过以下方式配置:

  1. 设置环境变量 ZENTAO_COOKIE
  2. 在调用工具时传入 cookie 参数
  3. 修改 zentao-parser.js 中的默认Cookie值

故障排除

工具未出现在 Cursor 中

  1. 检查 mcp.json 配置文件路径是否正确
  2. 确认 mcp-server.js 文件路径在配置中正确
  3. 重启 Cursor IDE
  4. 检查 Node.js 是否已安装并在 PATH 中

请求失败

  1. 检查网络连接
  2. 确认Bug URL是否正确
  3. 检查Cookie是否有效(如果使用默认Cookie)
  4. 查看错误信息中的详细提示

图片无法显示

  1. 确认图片URL是否可访问
  2. 检查网络连接
  3. 确认图片URL是否需要身份验证

许可证

MIT