CI构建信息MCP服务

一个基于drone.io的CI构建信息和日志的MCP服务,提供只读功能。

  • by madappa-sharath
  • TypeScript
  • 本地部署
  • 6 星标
  • 更新于
在 GitHub 查看 madappa-sharath/drone-ci-mcp

使用说明

无人机ci-mcp

一个固执己见的mcp服务器,暴露 drone.io ci构建信息和日志作为MCP。将仅支持只读功能。

[!警告] 仍在积极开发中,使用风险自负

用法

启动运输

npx -y drone-ci-mcp --access-token=<access-token-from-drone> --server-url=<url>

克劳德设置

{
  "mcpServers": {
    "drone-ci-mcp": {
      "command": "npx",
      "args": [
        "-y"
        "drone-ci-mcp",
        "--access-token=<token>",
        "--server-url=<url>"
      ]
    }
  }
}

MCP检查员

npx @modelcontextprotocol/inspector npx -y drone-ci-mcp --access-token=<token> --server-url=<url>

工具

drone_build_info

只读工具,用于查找构建信息并将输出作为YAML返回。

输入:

  1. repoSlug-无人机中存储库的蛞蝓。所有者/组织和以“/”分隔的存储库名称的组合,即所有者/仓库
  2. buildNumber-无人机CI构建号

输出:

答复来自https://docs.drone.io/api/builds/build_info/作为马尔敦+YAML

# Build **1** in **<repo slug>**

```yaml
id: 1
repo_id: 5
trigger:<trigger>
number: 1
status: success
event: custom
action: ''
link: >-
  https://github.com/<commit-link>
timestamp: 0
message: <commit message>
before: dbde12a8600cb6591f4c84085acb95d08b5505e6
after: dbde12a8600cb6591f4c84085acb95d08b5505e6
ref: refs/heads/main
source_repo: ''
source: main
target: main
author_login: <username>
author_name: <name>
author_email: <email>
author_avatar: <avatar>
sender: madappa-sharath
started: 1745806907
finished: 1745806908
created: 1745806904
updated: 1745806907
version: 3
stages:
  - id: 1
    repo_id: 5
    build_id: 1
    number: 1
    name: hello-world
    kind: pipeline
    type: docker
    status: success
    errignore: false
    exit_code: 0
    machine: drone-runner-65d8dd8798-rf8xr
    os: linux
    arch: arm64
    started: 1745806907
    stopped: 1745806908
    created: 1745806904
    updated: 1745806908
    version: 4
    on_success: true
    on_failure: false
    steps:
      - id: 1
        step_id: 1
        number: 1
        name: clone
        status: success
        exit_code: 0
        started: 1745806907
        stopped: 1745806908
        version: 4
        image: drone/git:latest
        .....
```

drone_build_info

查找步骤日志的只读工具。

输入:

  1. repoSlug-无人机中存储库的蛞蝓。所有者/组织和以“/”分隔的存储库名称的组合,即所有者/仓库
  2. buildNumber-无人机CI构建号
  3. stageNumber-构建阶段编号。由舞台上的“数字”字段表示
  4. stepId-构建步骤id。由步骤上的字段“step_id”表示

输出:

答复来自https://docs.drone.io/api/builds/build_logs/作为马尔敦

# Logs for step 2 in stage **1** of **1** build in **<repo slug>** repository

```shell
+ echo 'hello-world'
,hello-world
```

演示