@zzp123/mcp-zentao 1.18.9 → 1.18.11
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/CHANGELOG.md +1018 -1018
- package/LICENSE +20 -20
- package/dist/api/zentaoApi.js +19 -18
- package/dist/index-dev.js +43 -36
- package/dist/index-pm.js +76 -637
- package/dist/index-qa.js +29 -34
- package/dist/index.js +61 -41
- package/dist/roleConfig.d.ts +0 -4
- package/dist/roleConfig.js +28 -33
- package/dist/types/zentao.d.ts +1 -0
- package/json-args.js +26 -26
- package/package.json +75 -75
- package/scripts/MCP-INTEGRATION.md +298 -298
- package/scripts/README.md +315 -315
- package/scripts/generate-role-versions.cjs +216 -209
- package/scripts/get-clipboard-base64.js +93 -93
- package/scripts/get_clipboard.ps1 +13 -13
- package/scripts/upload-clipboard-image.js +200 -200
- package/scripts/upload-clipboard-image.ps1 +128 -128
- package/scripts/upload-clipboard-image.py +196 -196
- package/scripts/upload.bat.example +41 -41
package/dist/index-qa.js
CHANGED
|
@@ -3,6 +3,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ZentaoAPI } from './api/zentaoApi.js';
|
|
5
5
|
import { loadConfig, saveConfig } from './config.js';
|
|
6
|
+
import { withApi } from './mcpHelpers.js';
|
|
6
7
|
import { interactiveInitTransport, startServerTransport } from './serverTransport.js';
|
|
7
8
|
// 解析命令行参数
|
|
8
9
|
const args = process.argv.slice(2);
|
|
@@ -33,6 +34,7 @@ const server = new McpServer({
|
|
|
33
34
|
});
|
|
34
35
|
// Initialize ZentaoAPI instance
|
|
35
36
|
let zentaoApi = null;
|
|
37
|
+
const getApi = () => zentaoApi;
|
|
36
38
|
export default async function main(params) {
|
|
37
39
|
// 如果传入了配置信息,就保存它
|
|
38
40
|
if (params.config) {
|
|
@@ -55,24 +57,20 @@ server.tool("initZentao", {}, async ({}) => {
|
|
|
55
57
|
});
|
|
56
58
|
server.tool("getMyTasks", {
|
|
57
59
|
status: z.enum(['wait', 'doing', 'done', 'all']).optional()
|
|
58
|
-
}, async ({ status }) => {
|
|
59
|
-
|
|
60
|
-
throw new Error("Please initialize Zentao API first");
|
|
61
|
-
const tasks = await zentaoApi.getMyTasks(status);
|
|
60
|
+
}, withApi(getApi, async (api, { status }) => {
|
|
61
|
+
const tasks = await api.getMyTasks(status);
|
|
62
62
|
return {
|
|
63
63
|
content: [{ type: "text", text: JSON.stringify(tasks, null, 2) }]
|
|
64
64
|
};
|
|
65
|
-
});
|
|
65
|
+
}));
|
|
66
66
|
server.tool("getTaskDetail", {
|
|
67
67
|
taskId: z.number()
|
|
68
|
-
}, async ({ taskId }) => {
|
|
69
|
-
|
|
70
|
-
throw new Error("Please initialize Zentao API first");
|
|
71
|
-
const task = await zentaoApi.getTaskDetail(taskId);
|
|
68
|
+
}, withApi(getApi, async (api, { taskId }) => {
|
|
69
|
+
const task = await api.getTaskDetail(taskId);
|
|
72
70
|
return {
|
|
73
71
|
content: [{ type: "text", text: JSON.stringify(task, null, 2) }]
|
|
74
72
|
};
|
|
75
|
-
});
|
|
73
|
+
}));
|
|
76
74
|
server.tool("getMyBugs", "获取我的Bug列表 - 固定查询指派给我的Bug(status='assigntome'),固定每页20条", {
|
|
77
75
|
productId: z.number().optional().describe("产品ID,默认使用第二个产品"),
|
|
78
76
|
page: z.number().optional().describe("页码,从1开始,默认为1"),
|
|
@@ -148,11 +146,11 @@ server.tool("getProductBugs", "获取指定产品的Bug列表 - 支持多种状
|
|
|
148
146
|
});
|
|
149
147
|
server.tool("getBugDetail", {
|
|
150
148
|
bugId: z.number(),
|
|
151
|
-
fields: z.enum(['basic', 'detail', 'full']).optional().describe(`
|
|
152
|
-
字段级别:
|
|
153
|
-
- basic: 基本信息(id, title, status, severity, pri等核心字段)
|
|
154
|
-
- detail: 详细信息(包含steps步骤,但不包含files/cases/linkBugs等关联数据)
|
|
155
|
-
- full: 完整信息(包含所有字段,默认值)
|
|
149
|
+
fields: z.enum(['basic', 'detail', 'full']).optional().describe(`
|
|
150
|
+
字段级别:
|
|
151
|
+
- basic: 基本信息(id, title, status, severity, pri等核心字段)
|
|
152
|
+
- detail: 详细信息(包含steps步骤,但不包含files/cases/linkBugs等关联数据)
|
|
153
|
+
- full: 完整信息(包含所有字段,默认值)
|
|
156
154
|
`.trim())
|
|
157
155
|
}, async ({ bugId, fields }) => {
|
|
158
156
|
if (!zentaoApi)
|
|
@@ -197,29 +195,26 @@ server.tool("resolveBug", {
|
|
|
197
195
|
};
|
|
198
196
|
});
|
|
199
197
|
server.tool("getStoryDetail", "获取需求详情 - 支持软件需求(story)和用户需求(requirement),自动识别类型", {
|
|
200
|
-
storyId: z.number().describe("需求ID(可以是story或requirement类型)")
|
|
201
|
-
|
|
202
|
-
字段级别:
|
|
203
|
-
- basic: 基本信息(id, title, status, stage, pri等核心字段)
|
|
204
|
-
- detail: 详细信息(包含spec和verify,但不包含executions/tasks/stages/children等关联数据)
|
|
205
|
-
- full: 完整信息(包含所有字段,默认值)
|
|
206
|
-
`.trim())
|
|
207
|
-
}, async ({ storyId, fields }) => {
|
|
198
|
+
storyId: z.number().describe("需求ID(可以是story或requirement类型)")
|
|
199
|
+
}, async ({ storyId }) => {
|
|
208
200
|
if (!zentaoApi)
|
|
209
201
|
throw new Error("Please initialize Zentao API first");
|
|
210
|
-
const story = await zentaoApi.getStoryDetail(storyId,
|
|
211
|
-
//
|
|
202
|
+
const story = await zentaoApi.getStoryDetail(storyId, 'basic');
|
|
203
|
+
// 只返回基本信息
|
|
212
204
|
const result = {
|
|
213
|
-
|
|
214
|
-
|
|
205
|
+
id: story.id,
|
|
206
|
+
title: story.title,
|
|
207
|
+
status: story.status,
|
|
208
|
+
stage: story.stage,
|
|
209
|
+
pri: story.pri,
|
|
210
|
+
type: story.type,
|
|
211
|
+
category: story.category,
|
|
212
|
+
product: story.product,
|
|
213
|
+
productName: story.productName,
|
|
214
|
+
openedBy: story.openedBy,
|
|
215
|
+
openedDate: story.openedDate,
|
|
216
|
+
assignedTo: story.assignedTo
|
|
215
217
|
};
|
|
216
|
-
// 根据字段级别添加提示
|
|
217
|
-
if (fields === 'basic') {
|
|
218
|
-
result.note = '仅显示基本信息,如需完整内容请使用 fields=detail 或 fields=full';
|
|
219
|
-
}
|
|
220
|
-
else if (fields === 'detail') {
|
|
221
|
-
result.note = '显示详细信息但不包含关联数据(executions/tasks/stages/children),如需完整内容请使用 fields=full';
|
|
222
|
-
}
|
|
223
218
|
return {
|
|
224
219
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
225
220
|
};
|
package/dist/index.js
CHANGED
|
@@ -162,11 +162,11 @@ server.tool("getProductBugs", "获取指定产品的Bug列表 - 支持多种状
|
|
|
162
162
|
// Add getBugDetail tool
|
|
163
163
|
server.tool("getBugDetail", {
|
|
164
164
|
bugId: z.number(),
|
|
165
|
-
fields: z.enum(['basic', 'detail', 'full']).optional().describe(`
|
|
166
|
-
字段级别:
|
|
167
|
-
- basic: 基本信息(id, title, status, severity, pri等核心字段)
|
|
168
|
-
- detail: 详细信息(包含steps步骤,但不包含files/cases/linkBugs等关联数据)
|
|
169
|
-
- full: 完整信息(包含所有字段,默认值)
|
|
165
|
+
fields: z.enum(['basic', 'detail', 'full']).optional().describe(`
|
|
166
|
+
字段级别:
|
|
167
|
+
- basic: 基本信息(id, title, status, severity, pri等核心字段)
|
|
168
|
+
- detail: 详细信息(包含steps步骤,但不包含files/cases/linkBugs等关联数据)
|
|
169
|
+
- full: 完整信息(包含所有字段,默认值)
|
|
170
170
|
`.trim())
|
|
171
171
|
}, async ({ bugId, fields }) => {
|
|
172
172
|
if (!zentaoApi)
|
|
@@ -268,8 +268,19 @@ server.tool("getProductPlans", {
|
|
|
268
268
|
if (!zentaoApi)
|
|
269
269
|
throw new Error("Please initialize Zentao API first");
|
|
270
270
|
const plans = await zentaoApi.getProductPlans(productId, branch, begin, end, status, parent);
|
|
271
|
+
// 精简返回字段
|
|
272
|
+
const simplifyPlan = (p) => ({
|
|
273
|
+
id: p.id,
|
|
274
|
+
title: p.title,
|
|
275
|
+
status: p.status,
|
|
276
|
+
begin: p.begin,
|
|
277
|
+
end: p.end,
|
|
278
|
+
stories: p.stories,
|
|
279
|
+
bugs: p.bugs
|
|
280
|
+
});
|
|
281
|
+
const simplified = plans.map(simplifyPlan);
|
|
271
282
|
return {
|
|
272
|
-
content: [{ type: "text", text: JSON.stringify(
|
|
283
|
+
content: [{ type: "text", text: JSON.stringify(simplified, null, 2) }]
|
|
273
284
|
};
|
|
274
285
|
});
|
|
275
286
|
// Add createTask tool
|
|
@@ -441,29 +452,26 @@ server.tool("getProjectReleases", {
|
|
|
441
452
|
});
|
|
442
453
|
// Add getStoryDetail tool
|
|
443
454
|
server.tool("getStoryDetail", "获取需求详情 - 支持软件需求(story)和用户需求(requirement),自动识别类型", {
|
|
444
|
-
storyId: z.number().describe("需求ID(可以是story或requirement类型)")
|
|
445
|
-
|
|
446
|
-
字段级别:
|
|
447
|
-
- basic: 基本信息(id, title, status, stage, pri等核心字段)
|
|
448
|
-
- detail: 详细信息(包含spec和verify,但不包含executions/tasks/stages/children等关联数据)
|
|
449
|
-
- full: 完整信息(包含所有字段,默认值)
|
|
450
|
-
`.trim())
|
|
451
|
-
}, async ({ storyId, fields }) => {
|
|
455
|
+
storyId: z.number().describe("需求ID(可以是story或requirement类型)")
|
|
456
|
+
}, async ({ storyId }) => {
|
|
452
457
|
if (!zentaoApi)
|
|
453
458
|
throw new Error("Please initialize Zentao API first");
|
|
454
|
-
const story = await zentaoApi.getStoryDetail(storyId,
|
|
455
|
-
//
|
|
459
|
+
const story = await zentaoApi.getStoryDetail(storyId, 'basic');
|
|
460
|
+
// 只返回基本信息
|
|
456
461
|
const result = {
|
|
457
|
-
|
|
458
|
-
|
|
462
|
+
id: story.id,
|
|
463
|
+
title: story.title,
|
|
464
|
+
status: story.status,
|
|
465
|
+
stage: story.stage,
|
|
466
|
+
pri: story.pri,
|
|
467
|
+
type: story.type,
|
|
468
|
+
category: story.category,
|
|
469
|
+
product: story.product,
|
|
470
|
+
productName: story.productName,
|
|
471
|
+
openedBy: story.openedBy,
|
|
472
|
+
openedDate: story.openedDate,
|
|
473
|
+
assignedTo: story.assignedTo
|
|
459
474
|
};
|
|
460
|
-
// 根据字段级别添加提示
|
|
461
|
-
if (fields === 'basic') {
|
|
462
|
-
result.note = '仅显示基本信息,如需完整内容请使用 fields=detail 或 fields=full';
|
|
463
|
-
}
|
|
464
|
-
else if (fields === 'detail') {
|
|
465
|
-
result.note = '显示详细信息但不包含关联数据(executions/tasks/stages/children),如需完整内容请使用 fields=full';
|
|
466
|
-
}
|
|
467
475
|
return {
|
|
468
476
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
469
477
|
};
|
|
@@ -519,8 +527,17 @@ server.tool("getProjectExecutions", {
|
|
|
519
527
|
if (!zentaoApi)
|
|
520
528
|
throw new Error("Please initialize Zentao API first");
|
|
521
529
|
const executions = await zentaoApi.getProjectExecutions(projectId);
|
|
530
|
+
// 只返回基本字段
|
|
531
|
+
const simplified = executions.map((e) => ({
|
|
532
|
+
id: e.id,
|
|
533
|
+
name: e.name,
|
|
534
|
+
status: e.status,
|
|
535
|
+
begin: e.begin,
|
|
536
|
+
end: e.end,
|
|
537
|
+
progress: e.progress
|
|
538
|
+
}));
|
|
522
539
|
return {
|
|
523
|
-
content: [{ type: "text", text: JSON.stringify(
|
|
540
|
+
content: [{ type: "text", text: JSON.stringify(simplified, null, 2) }]
|
|
524
541
|
};
|
|
525
542
|
});
|
|
526
543
|
// Add createPlan tool
|
|
@@ -555,8 +572,10 @@ server.tool("getProjects", {
|
|
|
555
572
|
if (!zentaoApi)
|
|
556
573
|
throw new Error("Please initialize Zentao API first");
|
|
557
574
|
const projects = await zentaoApi.getProjects(page, limit);
|
|
575
|
+
// 只返回 id 和 name 字段
|
|
576
|
+
const simplified = projects.map((p) => ({ id: p.id, name: p.name }));
|
|
558
577
|
return {
|
|
559
|
-
content: [{ type: "text", text: JSON.stringify(
|
|
578
|
+
content: [{ type: "text", text: JSON.stringify(simplified, null, 2) }]
|
|
560
579
|
};
|
|
561
580
|
});
|
|
562
581
|
// Add changeStory tool
|
|
@@ -603,10 +622,10 @@ server.tool("changeStory", "需求变更 - 支持软件需求(story)和用户需
|
|
|
603
622
|
verify: z.string().optional(),
|
|
604
623
|
// 备注
|
|
605
624
|
comment: z.string().optional()
|
|
606
|
-
}).describe(`更新需求(使用 PUT 接口)
|
|
607
|
-
|
|
608
|
-
此工具使用标准的"修改需求其他字段"接口(PUT /stories/:id),支持修改29个字段。
|
|
609
|
-
自动处理评审人问题,无需手动设置 needNotReview。
|
|
625
|
+
}).describe(`更新需求(使用 PUT 接口)
|
|
626
|
+
|
|
627
|
+
此工具使用标准的"修改需求其他字段"接口(PUT /stories/:id),支持修改29个字段。
|
|
628
|
+
自动处理评审人问题,无需手动设置 needNotReview。
|
|
610
629
|
`.trim())
|
|
611
630
|
}, async ({ storyId, update }) => {
|
|
612
631
|
if (!zentaoApi)
|
|
@@ -755,6 +774,7 @@ server.tool("deleteProject", { projectId: z.number() }, async ({ projectId }) =>
|
|
|
755
774
|
server.tool("createExecution", {
|
|
756
775
|
projectId: z.number(), project: z.number(), name: z.string(), code: z.string(),
|
|
757
776
|
begin: z.string(), end: z.string(), days: z.number().optional(), lifetime: z.string().optional(),
|
|
777
|
+
products: z.array(z.number()).describe("关联产品ID数组"),
|
|
758
778
|
PO: z.string().optional(), PM: z.string().optional(), QD: z.string().optional(),
|
|
759
779
|
RD: z.string().optional(), teamMembers: z.array(z.string()).optional(),
|
|
760
780
|
desc: z.string().optional(), acl: z.string().optional(), whitelist: z.array(z.string()).optional()
|
|
@@ -830,11 +850,11 @@ server.tool("createRequirement", "创建用户需求(requirement) - 用户需求
|
|
|
830
850
|
});
|
|
831
851
|
server.tool("getRequirementDetail", "获取用户需求详情 - 用户需求的专用接口,提供更好的语义化", {
|
|
832
852
|
requirementId: z.number().describe("用户需求ID"),
|
|
833
|
-
fields: z.enum(['basic', 'detail', 'full']).optional().describe(`
|
|
834
|
-
字段级别:
|
|
835
|
-
- basic: 基本信息(id, title, status, stage, pri等核心字段)
|
|
836
|
-
- detail: 详细信息(包含spec和verify,但不包含executions/tasks/stages/children等关联数据)
|
|
837
|
-
- full: 完整信息(包含所有字段,默认值)
|
|
853
|
+
fields: z.enum(['basic', 'detail', 'full']).optional().describe(`
|
|
854
|
+
字段级别:
|
|
855
|
+
- basic: 基本信息(id, title, status, stage, pri等核心字段)
|
|
856
|
+
- detail: 详细信息(包含spec和verify,但不包含executions/tasks/stages/children等关联数据)
|
|
857
|
+
- full: 完整信息(包含所有字段,默认值)
|
|
838
858
|
`.trim())
|
|
839
859
|
}, async ({ requirementId, fields }) => {
|
|
840
860
|
if (!zentaoApi)
|
|
@@ -872,11 +892,11 @@ server.tool("changeRequirement", "用户需求变更 - 用户需求的专用接
|
|
|
872
892
|
assignedTo: z.string().optional(),
|
|
873
893
|
reviewer: z.array(z.string()).optional(),
|
|
874
894
|
comment: z.string().optional()
|
|
875
|
-
}).describe(`
|
|
876
|
-
更新用户需求(使用 PUT /stories/:id 接口)
|
|
877
|
-
|
|
878
|
-
此工具使用标准的"修改需求其他字段"接口(PUT /stories/:id),支持修改多个字段。
|
|
879
|
-
自动处理评审人问题,无需手动设置 needNotReview。
|
|
895
|
+
}).describe(`
|
|
896
|
+
更新用户需求(使用 PUT /stories/:id 接口)
|
|
897
|
+
|
|
898
|
+
此工具使用标准的"修改需求其他字段"接口(PUT /stories/:id),支持修改多个字段。
|
|
899
|
+
自动处理评审人问题,无需手动设置 needNotReview。
|
|
880
900
|
`.trim())
|
|
881
901
|
}, async ({ requirementId, update }) => {
|
|
882
902
|
if (!zentaoApi)
|
package/dist/roleConfig.d.ts
CHANGED
|
@@ -2,17 +2,13 @@ export type Role = 'pm' | 'qa' | 'dev' | 'admin' | 'all';
|
|
|
2
2
|
export declare const TOOL_CATEGORIES: {
|
|
3
3
|
init: string[];
|
|
4
4
|
story: string[];
|
|
5
|
-
storyReadonly: string[];
|
|
6
5
|
product: string[];
|
|
7
6
|
plan: string[];
|
|
8
7
|
program: string[];
|
|
9
8
|
feedback: string[];
|
|
10
9
|
bug: string[];
|
|
11
|
-
bugResolve: string[];
|
|
12
|
-
bugReadonly: string[];
|
|
13
10
|
testcase: string[];
|
|
14
11
|
task: string[];
|
|
15
|
-
taskReadonly: string[];
|
|
16
12
|
project: string[];
|
|
17
13
|
execution: string[];
|
|
18
14
|
build: string[];
|
package/dist/roleConfig.js
CHANGED
|
@@ -9,7 +9,6 @@ export const TOOL_CATEGORIES = {
|
|
|
9
9
|
'changeStory', 'changeRequirement', 'deleteStory', 'deleteRequirement',
|
|
10
10
|
'getRequirementDetail', 'getProductStories', 'addStoryComment'
|
|
11
11
|
],
|
|
12
|
-
storyReadonly: ['getStoryDetail', 'getRequirementDetail', 'getProductStories'],
|
|
13
12
|
// 产品管理(仅产品经理)
|
|
14
13
|
product: [
|
|
15
14
|
'getProducts', 'getProductDetail', 'createProduct',
|
|
@@ -36,8 +35,6 @@ export const TOOL_CATEGORIES = {
|
|
|
36
35
|
'getMyBugs', 'getProductBugs', 'getBugDetail', 'createBug',
|
|
37
36
|
'updateBug', 'deleteBug', 'resolveBug', 'addBugComment'
|
|
38
37
|
],
|
|
39
|
-
bugResolve: ['getMyBugs', 'getBugDetail', 'resolveBug', 'addBugComment'],
|
|
40
|
-
bugReadonly: ['getMyBugs', 'getProductBugs', 'getBugDetail'],
|
|
41
38
|
// 测试用例(仅测试)
|
|
42
39
|
testcase: [
|
|
43
40
|
'getProductTestCases', 'getTestCaseDetail', 'createTestCase',
|
|
@@ -48,7 +45,6 @@ export const TOOL_CATEGORIES = {
|
|
|
48
45
|
'getMyTasks', 'getTaskDetail', 'createTask',
|
|
49
46
|
'updateTask', 'finishTask', 'deleteTask', 'addTaskComment'
|
|
50
47
|
],
|
|
51
|
-
taskReadonly: ['getMyTasks', 'getTaskDetail'],
|
|
52
48
|
// 项目管理(仅开发)
|
|
53
49
|
project: [
|
|
54
50
|
'getProjects', 'getProjectDetail', 'createProject',
|
|
@@ -86,39 +82,38 @@ export const TOOL_CATEGORIES = {
|
|
|
86
82
|
};
|
|
87
83
|
// 角色权限配置
|
|
88
84
|
export const ROLE_PERMISSIONS = {
|
|
89
|
-
//
|
|
85
|
+
// 产品经理:初始化+项目+需求+执行+计划+评论+用户
|
|
90
86
|
pm: [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
'initZentao',
|
|
88
|
+
'getProjects',
|
|
89
|
+
'createStory',
|
|
90
|
+
'getStoryDetail',
|
|
91
|
+
'changeStory',
|
|
92
|
+
'deleteStory',
|
|
93
|
+
'getProjectExecutions',
|
|
94
|
+
'getProductPlans',
|
|
95
|
+
'linkStoriesToPlan',
|
|
96
|
+
'createExecution',
|
|
97
|
+
'deleteExecution',
|
|
98
|
+
'deletePlan',
|
|
99
|
+
'getComments',
|
|
100
|
+
'addComment',
|
|
101
|
+
'getUsers',
|
|
102
|
+
'getMyProfile'
|
|
103
|
+
],
|
|
104
|
+
// 测试工程师:初始化+缺陷与用例
|
|
102
105
|
qa: [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
...TOOL_CATEGORIES.taskReadonly,
|
|
108
|
-
...TOOL_CATEGORIES.comment,
|
|
109
|
-
...TOOL_CATEGORIES.utility
|
|
106
|
+
'initZentao',
|
|
107
|
+
'createBug',
|
|
108
|
+
'createTestCase',
|
|
109
|
+
'getMyBugs'
|
|
110
110
|
],
|
|
111
|
-
//
|
|
111
|
+
// 开发工程师:初始化+缺陷处理
|
|
112
112
|
dev: [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
...TOOL_CATEGORIES.execution,
|
|
118
|
-
...TOOL_CATEGORIES.build,
|
|
119
|
-
...TOOL_CATEGORIES.storyReadonly,
|
|
120
|
-
...TOOL_CATEGORIES.comment,
|
|
121
|
-
...TOOL_CATEGORIES.utility
|
|
113
|
+
'initZentao',
|
|
114
|
+
'getMyBugs',
|
|
115
|
+
'getBugDetail',
|
|
116
|
+
'resolveBug'
|
|
122
117
|
],
|
|
123
118
|
// 管理员:所有工具
|
|
124
119
|
admin: [
|
package/dist/types/zentao.d.ts
CHANGED
package/json-args.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// 获取命令行参数中的 JSON 字符串
|
|
4
|
-
const jsonArg = process.argv[2];
|
|
5
|
-
|
|
6
|
-
if (!jsonArg) {
|
|
7
|
-
process.stderr.write('[ERROR] 请提供 JSON 参数\n');
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
// 解析 JSON 字符串
|
|
13
|
-
const params = JSON.parse(jsonArg);
|
|
14
|
-
|
|
15
|
-
// 导入并执行主程序
|
|
16
|
-
import('./dist/index.js')
|
|
17
|
-
.then(module => {
|
|
18
|
-
module.default(params);
|
|
19
|
-
})
|
|
20
|
-
.catch(error => {
|
|
21
|
-
process.stderr.write('[ERROR] 执行失败: ' + String(error) + '\n');
|
|
22
|
-
process.exit(1);
|
|
23
|
-
});
|
|
24
|
-
} catch (error) {
|
|
25
|
-
process.stderr.write('[ERROR] JSON 解析失败: ' + String(error) + '\n');
|
|
26
|
-
process.exit(1);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// 获取命令行参数中的 JSON 字符串
|
|
4
|
+
const jsonArg = process.argv[2];
|
|
5
|
+
|
|
6
|
+
if (!jsonArg) {
|
|
7
|
+
process.stderr.write('[ERROR] 请提供 JSON 参数\n');
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
// 解析 JSON 字符串
|
|
13
|
+
const params = JSON.parse(jsonArg);
|
|
14
|
+
|
|
15
|
+
// 导入并执行主程序
|
|
16
|
+
import('./dist/index.js')
|
|
17
|
+
.then(module => {
|
|
18
|
+
module.default(params);
|
|
19
|
+
})
|
|
20
|
+
.catch(error => {
|
|
21
|
+
process.stderr.write('[ERROR] 执行失败: ' + String(error) + '\n');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
});
|
|
24
|
+
} catch (error) {
|
|
25
|
+
process.stderr.write('[ERROR] JSON 解析失败: ' + String(error) + '\n');
|
|
26
|
+
process.exit(1);
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zzp123/mcp-zentao",
|
|
3
|
-
"version": "1.18.
|
|
4
|
-
"description": "禅道项目管理系统的高级API集成包 - 完整版,包含所有94个工具。另有产品经理、测试工程师、开发工程师专用精简版本可选",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"zentao": "dist/index.js",
|
|
10
|
-
"zentao-dev": "dist/index-dev.js",
|
|
11
|
-
"zentao-pm": "dist/index-pm.js",
|
|
12
|
-
"zentao-qa": "dist/index-qa.js"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist",
|
|
16
|
-
"README.md",
|
|
17
|
-
"CHANGELOG.md",
|
|
18
|
-
"json-args.js",
|
|
19
|
-
"scripts"
|
|
20
|
-
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "tsc",
|
|
23
|
-
"watch": "tsc -w",
|
|
24
|
-
"lint": "eslint src/**/*.ts",
|
|
25
|
-
"test": "jest",
|
|
26
|
-
"test:watch": "jest --watch",
|
|
27
|
-
"test:manual": "ts-node test/manual-test.ts",
|
|
28
|
-
"prepublishOnly": "npm run test && npm run build",
|
|
29
|
-
"start": "node json-args.js",
|
|
30
|
-
"upload:clipboard": "node scripts/upload-clipboard-image.js",
|
|
31
|
-
"upload:clipboard:py": "python scripts/upload-clipboard-image.py"
|
|
32
|
-
},
|
|
33
|
-
"keywords": [
|
|
34
|
-
"mcp",
|
|
35
|
-
"zentao",
|
|
36
|
-
"禅道",
|
|
37
|
-
"任务管理",
|
|
38
|
-
"项目管理",
|
|
39
|
-
"bug跟踪",
|
|
40
|
-
"api集成",
|
|
41
|
-
"cursor-ide",
|
|
42
|
-
"typescript"
|
|
43
|
-
],
|
|
44
|
-
"author": "zzp123",
|
|
45
|
-
"license": "MIT",
|
|
46
|
-
"repository": {
|
|
47
|
-
"type": "git",
|
|
48
|
-
"url": "git+https://github.com/yourusername/mcp-zentao.git"
|
|
49
|
-
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
52
|
-
"axios": "^1.6.7",
|
|
53
|
-
"chalk": "^4.1.2",
|
|
54
|
-
"form-data": "^4.0.4",
|
|
55
|
-
"fs": "^0.0.1-security",
|
|
56
|
-
"table": "^6.8.1",
|
|
57
|
-
"yargs": "^17.7.2"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@types/form-data": "^2.2.1",
|
|
61
|
-
"@types/jest": "^29.5.12",
|
|
62
|
-
"@types/node": "^20.11.19",
|
|
63
|
-
"@types/table": "^6.3.2",
|
|
64
|
-
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
65
|
-
"@typescript-eslint/parser": "^7.0.1",
|
|
66
|
-
"eslint": "^8.56.0",
|
|
67
|
-
"jest": "^29.7.0",
|
|
68
|
-
"ts-jest": "^29.1.2",
|
|
69
|
-
"ts-node": "^10.9.2",
|
|
70
|
-
"typescript": "^5.9.3"
|
|
71
|
-
},
|
|
72
|
-
"publishConfig": {
|
|
73
|
-
"access": "public"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@zzp123/mcp-zentao",
|
|
3
|
+
"version": "1.18.11",
|
|
4
|
+
"description": "禅道项目管理系统的高级API集成包 - 完整版,包含所有94个工具。另有产品经理、测试工程师、开发工程师专用精简版本可选",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"zentao": "dist/index.js",
|
|
10
|
+
"zentao-dev": "dist/index-dev.js",
|
|
11
|
+
"zentao-pm": "dist/index-pm.js",
|
|
12
|
+
"zentao-qa": "dist/index-qa.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"CHANGELOG.md",
|
|
18
|
+
"json-args.js",
|
|
19
|
+
"scripts"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"watch": "tsc -w",
|
|
24
|
+
"lint": "eslint src/**/*.ts",
|
|
25
|
+
"test": "jest",
|
|
26
|
+
"test:watch": "jest --watch",
|
|
27
|
+
"test:manual": "ts-node test/manual-test.ts",
|
|
28
|
+
"prepublishOnly": "npm run test && npm run build",
|
|
29
|
+
"start": "node json-args.js",
|
|
30
|
+
"upload:clipboard": "node scripts/upload-clipboard-image.js",
|
|
31
|
+
"upload:clipboard:py": "python scripts/upload-clipboard-image.py"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"mcp",
|
|
35
|
+
"zentao",
|
|
36
|
+
"禅道",
|
|
37
|
+
"任务管理",
|
|
38
|
+
"项目管理",
|
|
39
|
+
"bug跟踪",
|
|
40
|
+
"api集成",
|
|
41
|
+
"cursor-ide",
|
|
42
|
+
"typescript"
|
|
43
|
+
],
|
|
44
|
+
"author": "zzp123",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/yourusername/mcp-zentao.git"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
52
|
+
"axios": "^1.6.7",
|
|
53
|
+
"chalk": "^4.1.2",
|
|
54
|
+
"form-data": "^4.0.4",
|
|
55
|
+
"fs": "^0.0.1-security",
|
|
56
|
+
"table": "^6.8.1",
|
|
57
|
+
"yargs": "^17.7.2"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/form-data": "^2.2.1",
|
|
61
|
+
"@types/jest": "^29.5.12",
|
|
62
|
+
"@types/node": "^20.11.19",
|
|
63
|
+
"@types/table": "^6.3.2",
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
65
|
+
"@typescript-eslint/parser": "^7.0.1",
|
|
66
|
+
"eslint": "^8.56.0",
|
|
67
|
+
"jest": "^29.7.0",
|
|
68
|
+
"ts-jest": "^29.1.2",
|
|
69
|
+
"ts-node": "^10.9.2",
|
|
70
|
+
"typescript": "^5.9.3"
|
|
71
|
+
},
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"access": "public"
|
|
74
|
+
}
|
|
75
|
+
}
|