@youcloud/mantis-mcp 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,21 +2,35 @@
2
2
 
3
3
  内部研发团队使用的 MantisBT MCP 服务,通过 stdio 为 Coding Agent 提供缺陷查询、修复登记、附件上传和可恢复的工作流操作。
4
4
 
5
- 项目与问题反馈:[内部 GitLab](https://git.umlife.net/ai-tools/mantis-mcp)。npm 包:`@youcloud/mantis-mcp`;启动命令:`mantis-mcp`。
5
+ 项目与问题反馈:[内部 GitLab](https://git.umlife.net/ai-tools/mantis-mcp)。npm 包:[@youcloud/mantis-mcp](https://www.npmjs.com/package/@youcloud/mantis-mcp)。
6
6
 
7
- ## 安装
7
+ ## 开始使用
8
8
 
9
- 需要 Node.js `^22.12.0 || ^24.0.0 || >=26.0.0`,开发和 CI 使用 22.x。
9
+ 需要 Node.js ≥ 22(至少 22.12),并准备 MantisBT API 令牌(在“我的账号 → 个人资料 → API令牌”下创建)。
10
10
 
11
+ ### CodeX
11
12
  ```bash
12
- npm install --global @youcloud/mantis-mcp@1.0.1
13
+ codex mcp add mantis \
14
+ --env MANTIS_API_KEY="$MANTIS_API_KEY" \
15
+ -- npx -y @youcloud/mantis-mcp@latest
13
16
  ```
14
17
 
15
- 也可按客户端示例通过 `npx` 启动固定版本。安装需要下载生产依赖,无需自行编译 TypeScript。
18
+ ### Claude Code
19
+ ```bash
20
+ # Claude Code 不加 --scope user 时,默认仅在添加时所在的项目中生效
21
+ claude mcp add --scope user mantis \
22
+ --env MANTIS_API_KEY="$MANTIS_API_KEY" \
23
+ -- npx -y @youcloud/mantis-mcp@latest
24
+ ```
16
25
 
17
- ## 开始使用
26
+ ### 全局安装
27
+ ```bash
28
+ npm install -g @youcloud/mantis-mcp
29
+ ```
18
30
 
19
- 1. 在 Mantis 生成个人 API Key,通过 `MANTIS_API_KEY` 传入;默认连接内部 Mantis,不要把真实 Key 写入共享配置。
31
+ ### 自定义配置
32
+
33
+ 1. 在 Mantis 生成个人 API Key,通过 `MANTIS_API_KEY` 传入;默认连接内部 Mantis,详见[服务配置](docs/configuration.md)。
20
34
  2. 按[客户端接入](docs/clients.md)配置 Codex、Claude Code、Cursor 或 Trae。
21
35
  3. 调用 `get_project_context({})` 确认当前身份与可见项目,再按[调用手册](docs/cookbook.md)查询和处理缺陷。
22
36
 
@@ -24,16 +38,27 @@ npm install --global @youcloud/mantis-mcp@1.0.1
24
38
 
25
39
  修改已有对象前须读取最新 context,真实写入使用独立 `operation_id`。遇到 `partial_success/unknown` 时按原编号核查,不能直接重发。
26
40
 
41
+ ## 日常使用场景
42
+
43
+ - 目前分配给我的缺陷有哪些?
44
+ - 获取一下问题 #22474 的详细内容
45
+ - 问题 #22474 的状态是什么?
46
+ - 问题 #18133 是由于样式加载异常导致,已修复且自测通过,请把状态调整已修复
47
+ - 显示创意管家项目中所有未解决的问题
48
+ - ...
49
+
50
+
51
+
27
52
  ## 文档
28
53
 
29
54
  | 文档 | 内容 |
30
55
  |---|---|
31
- | [客户端接入](docs/clients.md) | 安装配置、凭据传入与连接排障 |
32
- | [服务配置](docs/configuration.md) | 环境变量、动作映射与部署边界 |
33
- | [调用手册](docs/cookbook.md) | 工具、常用场景及写入恢复 |
56
+ | [客户端接入](https://git.umlife.net/ai-tools/mantis-mcp/-/blob/main/docs/clients.md) | 安装配置、凭据传入与连接排障 |
57
+ | [服务配置](https://git.umlife.net/ai-tools/mantis-mcp/-/blob/main/docs/configuration.md) | 环境变量、动作映射与部署边界 |
58
+ | [调用手册](https://git.umlife.net/ai-tools/mantis-mcp/-/blob/main/docs/cookbook.md) | 工具、常用场景及写入恢复 |
34
59
  | [项目设计](https://git.umlife.net/ai-tools/mantis-mcp/-/blob/main/docs/design.md) | 架构、契约、状态持久化与安全边界 |
35
60
  | [开发指南](https://git.umlife.net/ai-tools/mantis-mcp/-/blob/main/CONTRIBUTING.md) | 本地开发、验证和文档维护 |
36
61
  | [发布流程](https://git.umlife.net/ai-tools/mantis-mcp/-/blob/main/docs/releasing.md) | GitLab 与 npm 发布检查 |
37
- | [更新记录](CHANGELOG.md) | 版本变化 |
62
+ | [更新记录](https://git.umlife.net/ai-tools/mantis-mcp/-/blob/main/CHANGELOG.md) | 版本变化 |
38
63
 
39
64
  采用 [MIT 许可证](LICENSE)。
package/docs/clients.md CHANGED
@@ -24,7 +24,7 @@
24
24
  ```toml
25
25
  [mcp_servers.mantis]
26
26
  command = "npx"
27
- args = ["-y", "@youcloud/mantis-mcp@1.0.1"]
27
+ args = ["-y", "@youcloud/mantis-mcp@latest"]
28
28
  env_vars = ["MANTIS_API_KEY"]
29
29
  startup_timeout_sec = 60
30
30
  tool_timeout_sec = 180
@@ -42,7 +42,7 @@ tool_timeout_sec = 180
42
42
  "mantis": {
43
43
  "type": "stdio",
44
44
  "command": "npx",
45
- "args": ["-y", "@youcloud/mantis-mcp@1.0.1"],
45
+ "args": ["-y", "@youcloud/mantis-mcp@latest"],
46
46
  "env": {
47
47
  "MANTIS_API_KEY": "${MANTIS_API_KEY}"
48
48
  }
@@ -63,7 +63,7 @@ tool_timeout_sec = 180
63
63
  "mantis": {
64
64
  "type": "stdio",
65
65
  "command": "npx",
66
- "args": ["-y", "@youcloud/mantis-mcp@1.0.1"],
66
+ "args": ["-y", "@youcloud/mantis-mcp@latest"],
67
67
  "env": {
68
68
  "MANTIS_API_KEY": "${env:MANTIS_API_KEY}"
69
69
  }
@@ -6,8 +6,8 @@
6
6
 
7
7
  | 变量 | 用途与默认值 |
8
8
  |---|---|
9
- | `MANTIS_BASE_URL` | 可选;未设置或为空白时默认 `https://mantis.umlife.net`。显式值须为完整 HTTP(S) 基地址,可含部署子路径或 `/api/rest/` 后缀,不含 `index.php`、用户凭据、查询参数或片段 |
10
9
  | `MANTIS_API_KEY` | 必填;当前使用者的个人 Key,权限由 Mantis 裁决 |
10
+ | `MANTIS_BASE_URL` | 可选;未设置或为空白时默认 `https://mantis.umlife.net`。显式值须为完整 HTTP(S) 基地址,可含部署子路径或 `/api/rest/` 后缀 |
11
11
  | `MANTIS_WORKFLOW_CONFIG` | 可选;工作流 JSON 路径,建议使用稳定的绝对路径;未设置时使用内置标准映射 |
12
12
  | `MANTIS_MCP_ENABLE_DESTRUCTIVE_TOOLS` | 默认 `false`;设为 `true` 后统一开放关闭、删除和版本管理,只接受 `true`/`false`(空值按关闭处理) |
13
13
  | `MANTIS_CACHE_DIR` | 账本与缓存根目录,默认 `~/.cache/mantis-mcp` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youcloud/mantis-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "面向研发工作流的 MantisBT MCP 服务,支持缺陷查询、修复登记、附件和可恢复操作",
5
5
  "license": "MIT",
6
6
  "homepage": "https://git.umlife.net/ai-tools/mantis-mcp",
@@ -36,6 +36,7 @@
36
36
  "scripts": {
37
37
  "prebuild": "node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"",
38
38
  "build": "tsc -p tsconfig.build.json",
39
+ "prepublishOnly": "npm run typecheck && npm test && npm run test:package && npm audit --audit-level=high",
39
40
  "prepack": "npm run build",
40
41
  "test:package": "node scripts/verify-package.mjs",
41
42
  "typecheck": "tsc --noEmit",