mcp-server

v0.6.7
@cnbcool/mcp-server Checked 1 hour ago Published 9 months ago

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…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

cnb_list_groups

获取当前用户在CNB平台里拥有权限的顶层组织列表

ParameterTypeDescription
pagenumber第几页,从1开始
page_sizenumber每页多少条数据
rolestring最小仓库权限
searchstring仓库关键字

cnb_list_sub_groups

获取当前用户在CNB平台里指定组织下拥有权限的子组织列表

ParameterTypeDescription
group *string组织名称
accessnumber权限等级
pagenumber第几页,从1开始
page_sizenumber每页多少条数据

cnb_get_group

获取CNB平台指定组织的信息

ParameterTypeDescription
group *string组织路径

cnb_create_group

在CNB平台创建一个新组织

ParameterTypeDescription
path *string组织路径
bind_domainstring根组织绑定的域名
descriptionstring组织描述
remarkstring仓库备注

cnb_list_repositories

获取当前用户在CNB平台里拥有权限的仓库列表

ParameterTypeDescription
remote_url *string远程仓库URL,需要先执行`git remote get-url origin`命令获取,获取不到传空字符串
descboolean是否开启倒叙排序,默认值是false
filter_typestring仓库类型,为空表示所有仓库类型,默认值为空
order_bystring排序类型,默认值是last_updated_at
pagenumber第几页,从1开始,默认值是1
page_sizenumber每页多少条数据,默认值为10
rolestring最小仓库权限,当用户未指定角色时,需要主动传入Reporter
searchstring查询关键字

cnb_list_group_repositories

获取当前用户在CNB平台里指定组织下拥有权限的仓库列表

ParameterTypeDescription
group *string组织名称
descboolean是否开启倒叙排序,默认值是false
descendantstring查全部、直接属于当前组织的仓库、子组织的仓库
filter_typestring仓库类型
order_bystring排序类型
pagenumber第几页,从1开始,默认值是1
page_sizenumber每页多少条数据,默认值为10
searchstring仓库关键字

cnb_get_repository

获取CNB平台指定仓库的信息

ParameterTypeDescription
repo *string仓库路径

cnb_create_repository

在CNB平台创建一个新仓库

ParameterTypeDescription
name *string仓库名称
descriptionstring仓库描述
groupstring仓库所属分组
licensestring仓库许可
visibilitystring仓库可见性

cnb_get_current_repository

获取当前工作区对应的CNB平台仓库信息

ParameterTypeDescription
remote_url *string远程仓库URL, 需要先执行`git remote get-url origin`命令获取

cnb_list_issues

获取CNB平台指定仓库的ISSUE列表

ParameterTypeDescription
repo *string仓库路径
assigneesstringIssue 处理人,example: 张三,李四,-; - means assign to nobody
authorsstringIssue 作者的名字, example: 张三,李四
keywordstringIssue 关键字
labelsstringIssue 标签
order_bystringIssue 排序顺序.example: created_at, -updated_at, reference_count。‘-’ prefix means descending order
pagenumber第几页,从1开始
page_sizenumber每页多少条数据,默认是30
prioritystringIssue 优先级,example: p0,p1,p2,p3
statestringIssue 状态
updated_time_beginstringIssue 更新时间的范围,开始时间点,example: 2022-01-31
updated_time_endstringIssue 更新时间的范围,结束时间点,example: 2022-01-31

cnb_get_issue

获取CNB平台指定ISSUE的信息

ParameterTypeDescription
issueId *numberIssue ID
repo *string仓库路径

cnb_create_issue

在CNB平台指定的仓库创建一条新ISSUE。如需添加标签,另外调用cnb_add_issue_labels工具

ParameterTypeDescription
repo *string仓库路径
title *stringIssue 标题
assigneesarray一个或多个 Issue 处理人的用户名
bodystringIssue 描述
end_datestringIssue 截止时间,格式为 YYYY-MM-DD
labelsarray一个或多个 Issue 标签
prioritystringIssue 优先级
start_datestringIssue 起始时间,格式为 YYYY-MM-DD

cnb_update_issue

更新CNB平台指定ISSUE的信息。如需更新标签,另外调用cnb_set_issue_labels工具

ParameterTypeDescription
issueId *numberIssue ID
repo *string仓库路径
bodystringIssue 描述
end_datestringIssue 截止时间,格式为 YYYY-MM-DD
prioritystringIssue 优先级
start_datestringIssue 起始时间,格式为 YYYY-MM-DD
statestringIssue 状态
state_reasonstringIssue 状态原因
titlestringIssue 标题

cnb_list_issue_comments

获取CNB平台指定ISSUE的评论列表

ParameterTypeDescription
issueId *numberIssue ID
repo *string仓库路径
pagenumber第几页,从1开始
page_sizenumber每页多少条数据,默认是30

cnb_create_issue_comment

在CNB平台指定的ISSUE创建一条新评论

ParameterTypeDescription
body *string评论内容
issueId *numberIssue ID
repo *string仓库路径

cnb_update_issue_comment

更新CNB平台指定ISSUE评论的内容

ParameterTypeDescription
body *string评论内容
commentId *string评论 ID
issueId *numberIssue ID
repo *string仓库路径

cnb_list_issue_labels

获取CNB平台指定ISSUE的标签列表

ParameterTypeDescription
issueId *numberIssue ID
repo *string仓库路径

cnb_add_issue_labels

为CNB平台指定的ISSUE添加一个或多个标签

ParameterTypeDescription
issueId *numberIssue ID
labels *array要添加的标签列表,每个标签需要从仓库标签列表中选择
repo *string仓库路径

cnb_set_issue_labels

变更CNB平台指定ISSUE的标签

ParameterTypeDescription
issueId *numberIssue ID
labels *array新的标签列表(将替换所有现有标签),每个标签需要从仓库标签列表中选择
repo *string仓库路径

cnb_clear_issue_labels

清除CNB平台指定ISSUE的标签

ParameterTypeDescription
issueId *numberIssue ID
repo *string仓库路径

cnb_remove_issue_label

移除CNB平台指定ISSUE的指定标签

ParameterTypeDescription
issueId *numberIssue ID
labelName *string要删除的标签名称
repo *string仓库路径

cnb_list_workspaces

获取当前用户在CNB平台的云原生开发环境列表

ParameterTypeDescription
branchstring分支名,例如:main
endstring查询开始时间,格式:YYYY-MM-DD HH:mm:ssZZ,例如:2024-12-01 00:00:00+0800
pagenumber分页页码,从 1 开始,默认为 1
page_sizenumber每页条数,默认为 20,最高 100
slugstring仓库路径,例如:groupname/reponame
startstring查询结束时间,格式:YYYY-MM-DD HH:mm:ssZZ,例如:2024-12-01 00:00:00+0800
statusstring开发环境状态,running: 开发环境已启动,closed:开发环境已关闭,默认为所有状态

cnb_delete_workspace

在CNB平台删除指定的云原生开发环境

ParameterTypeDescription
pipelineId *string开发环境 ID

cnb_start_workspace

在CNB平台启动指定仓库的云原生开发环境

ParameterTypeDescription
repo *string仓库路径,格式为 {group}/{repo}
branchstring分支名或 tag 名,例如:main 或 v1.0.0
refstringGit ref,例如,refs/heads/main 或 refs/tags/v1.0.0。不传 ref 时默认基于分支启动

cnb_list_pulls

获取CNB平台指定仓库的合并请求列表

ParameterTypeDescription
repo *string仓库路径,格式为 {group}/{repo}
directionstring排序方向
pagenumber页码
per_pagenumber每页数量
sortstring排序字段
statestringPull Request状态

cnb_get_pull

获取CNB平台指定合并请求的信息

ParameterTypeDescription
number *numberPull Request编号
repo *string仓库路径,格式为 {group}/{repo}

cnb_create_pull

在CNB平台指定的仓库创建一个新合并请求

ParameterTypeDescription
base *string目标仓库目标分支
head *string来源仓库分支
repo *string目标仓库路径,格式为 {group}/{repo}
title *string标题
bodystring描述
head_repostring来源仓库路径,格式为 {group}/{repo},不填则为目标仓库

cnb_update_pull

更新CNB平台指定合并请求的信息

ParameterTypeDescription
number *numberPull Request编号
repo *string仓库路径,格式为 {group}/{repo}
bodystring描述
statestring状态
titlestring标题

cnb_merge_pull

合并CNB平台指定的合并请求

ParameterTypeDescription
commit_title *string合并提交标题
number *numberPull Request编号
repo *string仓库路径,格式为 {group}/{repo}
commit_messagestring合并提交信息
merge_stylestring合并方式

cnb_list_pull_comments

获取CNB平台指定合并请求的评论列表

ParameterTypeDescription
number *numberPull Request编号
repo *string仓库路径,格式为 {group}/{repo}
pagenumber页码
per_pagenumber每页数量

cnb_create_pull_comment

在CNB平台指定的合并请求创建一条新评论

ParameterTypeDescription
body *string评论内容
number *numberPull Request编号
repo *string仓库路径,格式为 {group}/{repo}

cnb_buildLogsDelete

删除流水线或云原生构建日志内容

ParameterTypeDescription
repo *string仓库路径
sn *string构建 ID

cnb_buildRunnerDownloadLog

流水线或云原生构建runner日志下载

ParameterTypeDescription
pipelineId *string流水线 ID
repo *string仓库路径

cnb_getBuildLogs

查询流水线或云原生构建构建列表

ParameterTypeDescription
repo *string仓库路径
createTimestring构建开始时间,格式为 YYYY-MM-DD
endTimestring构建结束时间,格式为 YYYY-MM-DD
eventstring触发事件
pagenumber页码
pagesizenumber每页数据的条数
shastringCommit ID
snstring构建 ID
sourceRefstring源分支名
statusstring构建状态
targetRefstring目标分支名
userIdstring用户 ID
userNamestring用户名

cnb_getBuildStage

查询流水线或云原生构建Stage详情

ParameterTypeDescription
pipelineId *string流水线 ID,一个构建可以包含多条流水线。格式 {sn}-001, {sn}-002 等等,001 为起始,加一递增
repo *string仓库路径
sn *string构建序列号或 ID
stageId *string流水线阶段 ID,一条流水线可以包含多个阶段。格式 prepare, beforeEnd, end, stage-0, stage-1 等等,0 为起始,加一递增

cnb_getBuildStatus

查询流水线或云原生构建构建状态

ParameterTypeDescription
repo *string仓库路径
sn *string构建 ID

cnb_startBuild

开始一个构建

ParameterTypeDescription
branch *string分支名
event *string触发事件
repo *string仓库路径
configstring配置
envobject环境变量
shastringCommit ID
syncstring同步模式,等待请求完成
tagstringgit tag

cnb_stopBuild

停止一个构建

ParameterTypeDescription
repo *string仓库路径
sn *string构建 ID

cnb_getKnowledgeBaseInfo

获取知识库信息

ParameterTypeDescription
repo *string仓库路径

cnb_queryKnowledgeBase

查询知识库

ParameterTypeDescription
query *string要查询的关键词或问题
repo *string仓库路径
metadata_filtering_conditionsobject元数据过滤条件
score_thresholdnumber匹配相关性分数阈值
top_knumber返回结果的最大数量