@leeguoo/zentao-mcp 0.3.1 → 0.3.2
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 +2 -1
- package/package.json +1 -1
- package/src/index.js +19 -1
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ The MCP server provides four tools that can be triggered by natural language in
|
|
|
97
97
|
- **`zentao_products_list`** - List all products
|
|
98
98
|
- **`zentao_bugs_list`** - List bugs for a specific product
|
|
99
99
|
- **`zentao_bugs_stats`** - Get bug statistics across products
|
|
100
|
-
- **`zentao_bugs_mine`** - List my bugs by assignment or creator
|
|
100
|
+
- **`zentao_bugs_mine`** - List my bugs by assignment or creator (status filter supported)
|
|
101
101
|
|
|
102
102
|
### Usage Examples
|
|
103
103
|
|
|
@@ -157,6 +157,7 @@ The AI will automatically:
|
|
|
157
157
|
**zentao_bugs_mine:**
|
|
158
158
|
```json
|
|
159
159
|
{
|
|
160
|
+
"status": "active",
|
|
160
161
|
"scope": "assigned",
|
|
161
162
|
"includeZero": false,
|
|
162
163
|
"includeDetails": true,
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -259,6 +259,7 @@ class ZentaoClient {
|
|
|
259
259
|
async bugsMine({
|
|
260
260
|
account,
|
|
261
261
|
scope,
|
|
262
|
+
status,
|
|
262
263
|
productIds,
|
|
263
264
|
includeZero,
|
|
264
265
|
perPage,
|
|
@@ -267,6 +268,14 @@ class ZentaoClient {
|
|
|
267
268
|
}) {
|
|
268
269
|
const matchAccount = normalizeAccountValue(account || this.account);
|
|
269
270
|
const targetScope = (scope || "assigned").toLowerCase();
|
|
271
|
+
const rawStatus = status ?? "active";
|
|
272
|
+
const statusList = Array.isArray(rawStatus)
|
|
273
|
+
? rawStatus
|
|
274
|
+
: String(rawStatus).split(/[|,]/);
|
|
275
|
+
const statusSet = new Set(
|
|
276
|
+
statusList.map((item) => String(item).trim().toLowerCase()).filter(Boolean)
|
|
277
|
+
);
|
|
278
|
+
const allowAllStatus = statusSet.has("all") || statusSet.size === 0;
|
|
270
279
|
|
|
271
280
|
const productsResponse = await this.listProducts({ page: 1, limit: 1000 });
|
|
272
281
|
if (productsResponse.status !== 1) return productsResponse;
|
|
@@ -289,6 +298,10 @@ class ZentaoClient {
|
|
|
289
298
|
});
|
|
290
299
|
|
|
291
300
|
const matches = productBugs.filter((bug) => {
|
|
301
|
+
if (!allowAllStatus) {
|
|
302
|
+
const bugStatus = String(bug.status || "").trim().toLowerCase();
|
|
303
|
+
if (!statusSet.has(bugStatus)) return false;
|
|
304
|
+
}
|
|
292
305
|
const assigned = matchesAccount(bug.assignedTo, matchAccount);
|
|
293
306
|
const opened = matchesAccount(bug.openedBy, matchAccount);
|
|
294
307
|
const resolved = matchesAccount(bug.resolvedBy, matchAccount);
|
|
@@ -330,6 +343,7 @@ class ZentaoClient {
|
|
|
330
343
|
return normalizeResult({
|
|
331
344
|
account: matchAccount,
|
|
332
345
|
scope: targetScope,
|
|
346
|
+
status: allowAllStatus ? "all" : Array.from(statusSet),
|
|
333
347
|
total: totalMatches,
|
|
334
348
|
products: rows,
|
|
335
349
|
bugs: includeDetails ? bugs : [],
|
|
@@ -358,7 +372,7 @@ function getClient() {
|
|
|
358
372
|
const server = new Server(
|
|
359
373
|
{
|
|
360
374
|
name: "zentao-mcp",
|
|
361
|
-
version: "0.3.
|
|
375
|
+
version: "0.3.2",
|
|
362
376
|
},
|
|
363
377
|
{
|
|
364
378
|
capabilities: {
|
|
@@ -417,6 +431,10 @@ const tools = [
|
|
|
417
431
|
type: "string",
|
|
418
432
|
description: "Filter scope: assigned|opened|resolved|all (default assigned).",
|
|
419
433
|
},
|
|
434
|
+
status: {
|
|
435
|
+
type: ["string", "array"],
|
|
436
|
+
description: "Status filter: active|resolved|closed|all (default active).",
|
|
437
|
+
},
|
|
420
438
|
productIds: {
|
|
421
439
|
type: "array",
|
|
422
440
|
items: { type: "integer" },
|