@leeguoo/zentao-mcp 0.4.0 → 0.4.1
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 +13 -2
- package/package.json +1 -1
- package/src/index.js +28 -1
package/README.md
CHANGED
|
@@ -92,10 +92,11 @@ If you prefer to use environment variables instead of CLI args, you can configur
|
|
|
92
92
|
|
|
93
93
|
## Tools
|
|
94
94
|
|
|
95
|
-
The MCP server provides
|
|
95
|
+
The MCP server provides four tools that can be triggered by natural language in Cursor:
|
|
96
96
|
|
|
97
97
|
- **`zentao_products_list`** - List all products
|
|
98
98
|
- **`zentao_bugs_list`** - List bugs for a specific product
|
|
99
|
+
- **`zentao_bug_get`** - Get bug details by ID
|
|
99
100
|
- **`zentao_bugs_mine`** - List my bugs by assignment or creator (status filter supported)
|
|
100
101
|
|
|
101
102
|
### Usage Examples
|
|
@@ -105,6 +106,7 @@ After configuring the MCP server in Cursor, you can use natural language to inte
|
|
|
105
106
|
**English:**
|
|
106
107
|
- "Show me all products"
|
|
107
108
|
- "List bugs for product 1"
|
|
109
|
+
- "Show bug 123"
|
|
108
110
|
- "Show me bugs"
|
|
109
111
|
- "Show my bugs"
|
|
110
112
|
- "List bugs assigned to me"
|
|
@@ -113,6 +115,7 @@ After configuring the MCP server in Cursor, you can use natural language to inte
|
|
|
113
115
|
**Chinese (中文):**
|
|
114
116
|
- "看bug" / "查看bug" / "显示bug"
|
|
115
117
|
- "产品1的bug列表"
|
|
118
|
+
- "查看bug 123"
|
|
116
119
|
- "显示所有产品"
|
|
117
120
|
- "查看产品2的问题"
|
|
118
121
|
- "我的bug"
|
|
@@ -121,7 +124,8 @@ After configuring the MCP server in Cursor, you can use natural language to inte
|
|
|
121
124
|
The AI will automatically:
|
|
122
125
|
1. Use `zentao_products_list` to get product IDs when needed
|
|
123
126
|
2. Use `zentao_bugs_list` when you ask to see bugs
|
|
124
|
-
3. Use `
|
|
127
|
+
3. Use `zentao_bug_get` when you ask for bug details
|
|
128
|
+
4. Use `zentao_bugs_mine` when you ask for your own bugs
|
|
125
129
|
|
|
126
130
|
### Tool Parameters
|
|
127
131
|
|
|
@@ -142,6 +146,13 @@ The AI will automatically:
|
|
|
142
146
|
}
|
|
143
147
|
```
|
|
144
148
|
|
|
149
|
+
**zentao_bug_get:**
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"id": 123
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
145
156
|
**zentao_bugs_mine:**
|
|
146
157
|
```json
|
|
147
158
|
{
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -184,6 +184,18 @@ class ZentaoClient {
|
|
|
184
184
|
return normalizeResult(payload);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
async getBug({ id }) {
|
|
188
|
+
if (!id) throw new Error("id is required");
|
|
189
|
+
|
|
190
|
+
const payload = await this.request({
|
|
191
|
+
method: "GET",
|
|
192
|
+
path: `/api.php/v1/bugs/${id}`,
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
if (payload.error) return normalizeError(payload.error, payload);
|
|
196
|
+
return normalizeResult(payload);
|
|
197
|
+
}
|
|
198
|
+
|
|
187
199
|
async fetchAllBugsForProduct({ product, perPage, maxItems }) {
|
|
188
200
|
const bugs = [];
|
|
189
201
|
let page = 1;
|
|
@@ -343,7 +355,7 @@ function getClient() {
|
|
|
343
355
|
const server = new Server(
|
|
344
356
|
{
|
|
345
357
|
name: "zentao-mcp",
|
|
346
|
-
version: "0.4.
|
|
358
|
+
version: "0.4.1",
|
|
347
359
|
},
|
|
348
360
|
{
|
|
349
361
|
capabilities: {
|
|
@@ -379,6 +391,18 @@ const tools = [
|
|
|
379
391
|
additionalProperties: false,
|
|
380
392
|
},
|
|
381
393
|
},
|
|
394
|
+
{
|
|
395
|
+
name: "zentao_bug_get",
|
|
396
|
+
description: "Get bug details (获取Bug详情) by bug ID.",
|
|
397
|
+
inputSchema: {
|
|
398
|
+
type: "object",
|
|
399
|
+
properties: {
|
|
400
|
+
id: { type: "integer", description: "Bug ID (required)." },
|
|
401
|
+
},
|
|
402
|
+
required: ["id"],
|
|
403
|
+
additionalProperties: false,
|
|
404
|
+
},
|
|
405
|
+
},
|
|
382
406
|
{
|
|
383
407
|
name: "zentao_bugs_mine",
|
|
384
408
|
description: "List my bugs (我的Bug) by assignment or creator. Default scope is assigned. Use when user asks for 'my bugs', '我的bug', '分配给我', or personal bug list.",
|
|
@@ -423,6 +447,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
423
447
|
case "zentao_bugs_list":
|
|
424
448
|
result = await api.listBugs(args);
|
|
425
449
|
break;
|
|
450
|
+
case "zentao_bug_get":
|
|
451
|
+
result = await api.getBug(args);
|
|
452
|
+
break;
|
|
426
453
|
case "zentao_bugs_mine":
|
|
427
454
|
result = await api.bugsMine(args);
|
|
428
455
|
break;
|