CNB (云原生构建) 服务 MCP 接入
通过 MCP 协议提供 CNB 服务调用,支持查询仓库,查看issue,创建issue等能力。
环境变量
- 需要将 API_TOKEN 配置为您在 CNB 上创建的 访问令牌
使用说明
🗺️ 功能清单
工具标识 | 功能描述 | 核心参数 |
---|---|---|
list-repositories | 获取当前用户拥有指定权限及其以上权限的仓库 | page, page_size, search, filter_type, role, order_by, desc |
list-group-repositories | 获取分组里当前用户有权限的仓库 | page, page_size, search, group, filter_type, order_by, desc, descendant |
get-repository | 获取指定仓库信息 | repoId |
list-issues | 查询仓库的 Issues | repoId, page, page_size, state, keyword, priority, labels, authors, assignees, updated_time_begin, updated_time_end, order_by |
get-issue | 获取指定 Issue 信息 | repoId, issueId |
create-issue | 创建一个 Issue | repoId, title, body, assignees, labels, priority |
仓库地址
https://cnb.cool/cnb/tools/cnb-mcp-server
🔌 使用方式
参数说明
list-repositories
获取当前用户拥有指定权限及其以上权限的仓库
输入参数 | Type | 描述 |
---|---|---|
page | optional number | 页数 |
page_size | optional number | 页大小 |
search | string | 查询关键词 |
filter_type | optional string | 仓库类型 private, public, encrypted |
role | optional string | 最小仓库权限,默认owner, 枚举值:Reporter, Developer, Master, Owner |
order_by | optional string | 排序类型,默认last_updated_at,枚举值:created_at, last_updated_at, stars, slug_path, forks |
desc | optional boolean | 是否降序 |
返回: 仓库信息
list-group-repositories
获取分组里当前用户有权限的仓库
输入参数 | Type | 描述 |
---|---|---|
page | optional number | 页数 |
page_size | optional number | 页大小 |
search | string | 查询关键词 |
group | string | 组织名称 |
filter_type | optional string | 仓库类型 private, public, encrypted |
order_by | optional string | 排序类型,默认last_updated_at,枚举值:created_at, last_updated_at, stars, slug_path, forks |
desc | optional boolean | 是否降序 |
descendant | optional boolean | 枚举值:查全部/查询直接属于当前组织的仓库/查询子组织的仓库, all/sub/grand |
返回: 仓库信息
get-repository
获取指定仓库信息
输入参数 | Type | 描述 |
---|---|---|
repoId | optional string | repo path |
返回: 仓库信息
list-issues
查询仓库的 Issues
输入参数 | Type | 描述 |
---|---|---|
repoId | optional string | repo path |
page | optional number | 页数 |
page_size | optional number | 页大小 |
state | optional string | open or closed |
keyword | optional string | 查询关键词 |
priority | optional string | issue 优先级,枚举值:p0,p1,p2,p3 |
labels | optional string | issue 标签,枚举值:git,bug,feature |
authors | optional string | issue 作者名 |
assignees | optional string | issue 处理人 |
updated_time_begin | optional string | issue 更新时间的范围,开始时间点,举例:2022-01-31 |
updated_time_end | optional string | issue 更新时间的范围,结束时间点,举例:2022-01-31 |
order_by | optional string | issue 排序顺序,枚举值:created_at, -updated_at, reference_count (‘-’ 前缀表示降序) |
返回: issue信息
get-issue
获取指定 Issue 信息
输入参数 | Type | 描述 |
---|---|---|
repoId | optional string | repo path |
issueId | optional number | issue 编号 |
返回: issue信息
create-issue
创建一个 Issue
输入参数 | Type | 描述 |
---|---|---|
repoId | optional string | repo path |
title | optional string | issue 标题 |
body | optional string | issue 描述 |
assignees | optional string[] | 一个或多个 Issue 处理人的用户名 |
labels | optional string[] | 一个或多个 Issue 标签 |
priority | optional string | issue 优先级,枚举值:p0,p1,p2,p3 |
返回: issue信息