Skip to main content
Glama
ytxd-defects-mcp

ytxd-defects-mcp

by GZYY003348

银通缺陷系统 · magpie 插件

把北京银通先达内部管理系统(缺陷系统)接进 magpie,所有 agent 共用。查项目、缺陷、需求;改状态、记日志前要求显式传入 confirmed: true。

安装(同事)

magpie plugin add github:GZYY003348/ytxd-defects-mcp

私有仓库,需要先被加为协作者(仓库 Settings › Collaborators)。

装完到 magpie › 设置 › 插件 › ytxd-defects 填:

项

说明

账号

内部系统登录名(姓名)

密码

登录密码

填了账号密码就自动登录,token 缓存 12 小时、过期自动重登。地址默认内网 192.1.1.176,连不上自动切公网 82.156.0.139,不用改。

Related MCP server: COAGENTS MCP Server

工具

只读

工具

作用

list_projects

全部合同项目

list_workitems

查缺陷/需求/任务(type: 02 缺陷 03 需求 01 任务)

get_workitem

快速看一条

list_users

人员字典

list_statuses

状态/处理结果/严重程度码表

download_attachment

下载附件(返回 base64)

get_system_info

连接状态与数据概览

展示与写(写工具带确认)

工具

作用

show_workitem

展示标题、描述、附件和处理日志,并标明日志是否完整

add_workitem_log

追加日志:文字 + 图片 + 工时

update_workitem_status

改状态/处理结果(对应页面「修改状态」弹窗)

update_workitem

改标题、优先级、严重程度、期望时间和功能模块

写操作确认边界

三个写工具都有 confirmed 参数,默认 false:

  • 不传 → 不执行,返回"将要改什么"的预览

  • 传 true → 执行写入

confirmed 是显式调用约束,能防止工具在参数缺失时误写;它不能代替宿主的原生授权或用户确认机制。

工作流(写在 show_workitem 的描述里)

1. show_workitem(id)  → 原题呈现给你
2. 改代码
3. 一次性问:「需要我跑测试吗?」「需要我验证测试结果吗?」
   ├ 都要   → 跑测试 → 验证 → 这两步不再问
   ├ 只要测试 → 跑测试 → 再问「要验证吗?」
   ├ 只要验证 → 先回头确认「测试还跑吗?」→ 按答执行 → 再验证
   └ 都不要  → 直接进第 4 步
4. 问:「按什么状态关闭?」并给建议,由你定
5. 你确认 → update_workitem_status(confirmed: false) 拿预览 → 给你看 → confirmed: true 执行
6. 问:「要不要在日志里记一笔?」

这段只是给 Agent 的处理顺序提示;Agent 是否存在、是否已注册以及工具如何分发给 Agent,由 magpie 管理,MCP 不做检测或判定。

接口备忘(实测)

操作

接口

备注

登录

POST /signin_vue

username + userpwd;token 在响应顶层

列表

POST {模块}/{视图}/GetList

page/rows/listview + search*

详情

POST /Task/Task/View_PC

不含状态字段

编辑表单

GET /Task/Task/Edit_PC?id=

字段名小写 camelCase

保存

POST /Task/Task/Save

必须 multipart;只认 Edit_PC 里的字段

改状态

POST /Task/Task_Log/Save + taskstatus

就是页面「修改状态」弹窗;自动写日志

记日志

POST /Task/Task_Log/Save

要显式传 submittime/submitman

上传

POST /Common/UpFile

字段 files + isimage=true;返回 data[0].url,拼 /nbglxt/file

日志列表

POST /Task/Task_Log/GetList

忽略所有筛选参数,只能按 id 倒序翻页找

坑:

  • SubmitCheck 是审核流接口,对 Task 状态无效(返回 200 但什么都不做)

  • 不带 User-Agent 时登录失败只返回 code:500, msg:null,看不到原因

  • 内网地址要走 keep-alive Agent(agent: false 每请求新建 TCP,慢;系统代理由 NO_PROXY 兜底)

  • GetList 不支持按 id 过滤(searchid/id/searchtaskid 都被忽略),但 sort=id&order=asc/desc 生效——老单用升序首页直达,中间段按有序页区间二分查找

  • 新建/刚改状态的工作项进列表索引有 1~2s 延迟,listRow 对"比最新 id 还大"的目标会自动等待重试一次

性能与自愈(v2.2)

  • 401 自动重登:token 过期不再报错卡住——有账号密码时自动丢弃死缓存、重登、重试原请求;并发多个请求同时 401 只重登一次。

  • keep-alive:同 host 复用 TCP 连接。

  • 并发化:get_system_info 项目分布有界并发 8(实测 17s → 2s);show_workitem 详情/列表行/日志三路并发;list_statuses 四码表并发;日志翻页 3 页一批预取。

  • 日志完整性如实返回:扫描到空页才标记 complete=true;达到页数上限时返回 complete=false 和已扫描页数。日志按数值 id 排序。

  • listRow 精确查找:新单 desc 首页、老单 asc 首页、中间段按有序页区间二分;asc 业务行每次现取,避免返回 60 秒内的旧状态。

  • 上传统一走公共请求层:附件上传共享地址故障切换、401 自动重登、超时和业务错误处理;并发请求各自保留独立的切换序列,备用地址按 host + port 判断。

  • 写操作边界更明确:update_workitem 只允许公开文档列出的字段;状态已改但转交责任人失败时返回 partial=true,避免误报为整体未执行。

  • currentUser 进程内缓存:写操作反复取 userId 不再重复请求。

v2.1 实测(内网,工具层直调):show_workitem 近期 4.7s → 1.0s、老单 8.2s → 2.1s;get_system_info 17.2s → 2.0s;list_statuses 1.1s → 0.2s。整链路(建→展示→预览→改状态→带图日志→待验证→关闭→删除)经 magpie MCP 通道全部通过。

开发

npm test          # 离线单元测试,不接触内部系统
npm run test:e2e  # 端到端:建测试缺陷 → 完整流转 → 删除

e2e 会在内部系统建一条标题带 【MCP写接口验证-可删除】 的缺陷,跑完全部流程后删除。

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to join shared teams and run project work—expanding projects into features and tasks, claiming items, tracking priorities and dependencies, linking delivery versions to Git commits or artifact hashes, and recording validation gates with evidence—through 23 tools that use the same REST commands and permissions as the human dashboard. Tokens bind each agent to its own identity, so it cannot impersonate a PM, overwrite another member's claim, or approve its own delivery.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to read and report, and to carry human-authored updates into systems of record after human consent, while structurally preventing autonomous writes of commitments like owners, due dates, or statuses.
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables agents to read a project's kickoff card, acceptance criteria, AGENTS rules, handoff package, progress, Git trail, and next step, and to append validated, audited progress events with matching Git commits through short-lived scoped credentials.
      MIT