@cnbcool/mcp-server 0.3.0-beta.1 → 0.3.0
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 +23 -0
- package/README.md +4 -0
- package/dist/tools/issueTools.js +9 -9
- package/dist/tools/workspaceTools.js +3 -12
- package/package.json +28 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## 0.3.0 (April 23, 2025)
|
|
2
|
+
|
|
3
|
+
### New Features
|
|
4
|
+
|
|
5
|
+
- Supports list user's own workspaces
|
|
6
|
+
- Supports delete user's own workspace
|
|
7
|
+
|
|
8
|
+
### Refactor
|
|
9
|
+
|
|
10
|
+
- Adjust code structure
|
|
11
|
+
|
|
12
|
+
## 0.2.0 (April 11, 2025)
|
|
13
|
+
|
|
14
|
+
### Refactor
|
|
15
|
+
|
|
16
|
+
- Adjust code structure
|
|
17
|
+
|
|
18
|
+
## 0.1.2 (April 9, 2025)
|
|
19
|
+
|
|
20
|
+
### Documents
|
|
21
|
+
|
|
22
|
+
- Modify README.md
|
|
23
|
+
|
|
1
24
|
## 0.1.1 (March 25, 2025)
|
|
2
25
|
|
|
3
26
|
### New Features
|
package/README.md
CHANGED
package/dist/tools/issueTools.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { createIssue, getIssue, listIssues } from '../api/issue.js';
|
|
3
3
|
export default function registerIssueTools(server) {
|
|
4
4
|
server.tool('list-issues', '查询仓库的 Issues', {
|
|
5
|
-
|
|
5
|
+
repo: z.string().describe('仓库路径'),
|
|
6
6
|
page: z.number().optional().describe('第几页,从1开始'),
|
|
7
7
|
page_size: z.number().optional().describe('每页多少条数据'),
|
|
8
8
|
state: z.enum(['open', 'closed']).optional().describe('Issue 状态'),
|
|
@@ -14,9 +14,9 @@ export default function registerIssueTools(server) {
|
|
|
14
14
|
updated_time_begin: z.string().optional().describe('Issue 更新时间的范围,开始时间点'),
|
|
15
15
|
updated_time_end: z.string().optional().describe('Issue 更新时间的范围,结束时间点'),
|
|
16
16
|
order_by: z.string().optional().describe('Issue 排序顺序')
|
|
17
|
-
}, async ({
|
|
17
|
+
}, async ({ repo, page, page_size, state, keyword, priority, labels, authors, assignees, updated_time_begin, updated_time_end, order_by }) => {
|
|
18
18
|
try {
|
|
19
|
-
const issues = await listIssues(
|
|
19
|
+
const issues = await listIssues(repo, {
|
|
20
20
|
page,
|
|
21
21
|
page_size,
|
|
22
22
|
state,
|
|
@@ -51,11 +51,11 @@ export default function registerIssueTools(server) {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
server.tool('get-issue', '获取指定 Issue 信息', {
|
|
54
|
-
|
|
54
|
+
repo: z.string().describe('仓库路径'),
|
|
55
55
|
issueId: z.number().describe('Issue ID')
|
|
56
|
-
}, async ({
|
|
56
|
+
}, async ({ repo, issueId }) => {
|
|
57
57
|
try {
|
|
58
|
-
const issues = await getIssue(
|
|
58
|
+
const issues = await getIssue(repo, issueId);
|
|
59
59
|
return {
|
|
60
60
|
content: [
|
|
61
61
|
{
|
|
@@ -78,15 +78,15 @@ export default function registerIssueTools(server) {
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
server.tool('create-issue', '创建一个 Issue', {
|
|
81
|
-
|
|
81
|
+
repo: z.string().describe('仓库路径'),
|
|
82
82
|
title: z.string().describe('Issue 标题'),
|
|
83
83
|
body: z.string().optional().describe('Issue 描述'),
|
|
84
84
|
assignees: z.array(z.string()).optional().describe('一个或多个 Issue 处理人的用户名'),
|
|
85
85
|
labels: z.array(z.string()).optional().describe('一个或多个 Issue 标签'),
|
|
86
86
|
priority: z.string().optional().describe('Issue 优先级')
|
|
87
|
-
}, async ({
|
|
87
|
+
}, async ({ repo, title, body, assignees, labels, priority }) => {
|
|
88
88
|
try {
|
|
89
|
-
const issue = await createIssue(
|
|
89
|
+
const issue = await createIssue(repo, {
|
|
90
90
|
title,
|
|
91
91
|
body,
|
|
92
92
|
assignees,
|
|
@@ -9,27 +9,18 @@ export default function registerWorkspaceTools(server) {
|
|
|
9
9
|
.describe('查询结束时间,格式:YYYY-MM-DD HH:mm:ssZZ,例如:2024-12-01 00:00:00+0800'),
|
|
10
10
|
end: z.string().optional().describe('查询开始时间,格式:YYYY-MM-DD HH:mm:ssZZ,例如:2024-12-01 00:00:00+0800'),
|
|
11
11
|
page: z.number().optional().describe('分页页码,从 1 开始,默认为 1'),
|
|
12
|
-
|
|
12
|
+
page_size: z.number().optional().describe('每页条数,默认为 20,最高 100'),
|
|
13
13
|
slug: z.string().optional().describe('仓库路径,例如:groupname/reponame'),
|
|
14
14
|
status: z
|
|
15
15
|
.enum(['running', 'closed'])
|
|
16
16
|
.optional()
|
|
17
17
|
.describe('开发环境状态,running: 开发环境已启动,closed:开发环境已关闭,默认为所有状态')
|
|
18
|
-
}, async ({ branch, page,
|
|
19
|
-
console.log('list-workspace', {
|
|
20
|
-
branch,
|
|
21
|
-
page,
|
|
22
|
-
pageSize,
|
|
23
|
-
start,
|
|
24
|
-
end,
|
|
25
|
-
slug,
|
|
26
|
-
status
|
|
27
|
-
});
|
|
18
|
+
}, async ({ branch, page, page_size, start, end, slug, status }) => {
|
|
28
19
|
try {
|
|
29
20
|
const workspaces = await listWorkspace({
|
|
30
21
|
branch,
|
|
31
22
|
page,
|
|
32
|
-
pageSize,
|
|
23
|
+
pageSize: page_size,
|
|
33
24
|
start,
|
|
34
25
|
end,
|
|
35
26
|
slug,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cnbcool/mcp-server",
|
|
3
3
|
"description": "CNB MCP Server. A comprehensive MCP server that provides seamless integration to the CNB's API(https://cnb.cool), offering a wide range of tools for repository management, pipelines operations and collaboration features",
|
|
4
|
-
"version": "0.3.0
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cnb-mcp-server": "dist/index.js"
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc",
|
|
12
|
-
"
|
|
12
|
+
"watch": "tsc --watch",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"prepare": "husky",
|
|
15
|
+
"lint": "eslint src",
|
|
16
|
+
"format": "prettier --check src"
|
|
13
17
|
},
|
|
14
18
|
"repository": {
|
|
15
19
|
"type": "git",
|
|
@@ -33,12 +37,29 @@
|
|
|
33
37
|
"typescript": ">=5.5"
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"@modelcontextprotocol/sdk": "
|
|
37
|
-
"dotenv": "
|
|
38
|
-
"zod": "
|
|
40
|
+
"@modelcontextprotocol/sdk": "1.6.1",
|
|
41
|
+
"dotenv": "16.4.7",
|
|
42
|
+
"zod": "3.24.2"
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
45
|
+
"@commitlint/cli": "19.8.0",
|
|
46
|
+
"@commitlint/config-conventional": "19.8.0",
|
|
47
|
+
"@eslint/js": "9.24.0",
|
|
48
|
+
"@types/node": "22.13.9",
|
|
49
|
+
"eslint": "9.24.0",
|
|
50
|
+
"eslint-config-prettier": "10.1.2",
|
|
51
|
+
"eslint-plugin-prettier": "5.2.6",
|
|
52
|
+
"globals": "16.0.0",
|
|
53
|
+
"husky": "9.1.7",
|
|
54
|
+
"lint-staged": "15.5.1",
|
|
55
|
+
"prettier": "3.5.3",
|
|
56
|
+
"typescript": "5.8.2",
|
|
57
|
+
"typescript-eslint": "8.30.1"
|
|
58
|
+
},
|
|
59
|
+
"lint-staged": {
|
|
60
|
+
"**/*": [
|
|
61
|
+
"eslint --fix src",
|
|
62
|
+
"prettier --write --ignore-unknown src"
|
|
63
|
+
]
|
|
43
64
|
}
|
|
44
65
|
}
|