Drone CI MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install
npm run build
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "DRONE_BASE_URL=${DRONE_BASE_URL}" -e "DRONE_TOKEN=${DRONE_TOKEN}" drone-ci -- node "<FULL_PATH_TO_MCP_DRONE_CI>/dist/index.js"

Replace <FULL_PATH_TO_MCP_DRONE_CI>/dist/index.js with the actual folder you prepared in step 1.

Required:DRONE_BASE_URLDRONE_TOKEN+ 4 optional
README.md

MCP server scaffold for Drone CI.

mcp-drone-ci

MCP server scaffold for Drone CI.

Status

This repository currently provides:

  • a TypeScript project scaffold,
  • a working Drone HTTP client (read + action endpoints),
  • a real MCP server entrypoint on stdio (SDK-based),
  • MCP tool/resource definitions for Drone CI monitoring,
  • webhook parsing and HMAC signature verification,
  • optional Drone webhook HTTP receiver with in-memory build-state cache,
  • basic policy/state modules,
  • initial unit tests.

Still pending before production use:

  • webhook event processing to store richer build metadata from payloads,
  • persistence backend (DB/Redis) for state beyond process memory,
  • broader integration tests against mock Drone API/webhook payloads.

Implementation Plan

See docs/implementation-plan.md.

Requirements

  • Node.js 20+
  • npm 10+

Quick Start

  1. Install dependencies:
npm install
  1. Review the required environment variables:
cp .env.example .env

Then export the values in your shell or pass them explicitly in your MCP client configuration. This project does not load .env automatically. 3. Build:

npm run build
  1. Run tests:
npm test
  1. Start:
npm start

Run As MCP (stdio)

npm start launches the MCP server on stdio. Configure your MCP client to spawn:

  • command: node
  • args: dist/index.js
  • env: DRONE_BASE_URL, optional tuning vars (and DRONE_WEBHOOK_SECRET only if webhook is enabled)

Example MCP config:

{
  "mcpServers": {
    "drone-ci": {
      "command": "node",
      "args": ["G:\\projets\\mcp-drone-ci\\dist\\index.js"],
      "env": {
        "DRONE_BASE_URL": "https://drone.example.com",
        "DRONE_TOKEN": "replace-with-drone-token",
        "MCP_ENABLE_WRITE_ACTIONS": "false",
        "MCP_WEBHOOK_PORT": "0",
        "MCP_RECONCILE_INTERVAL_MS": "5000"
      }
    }
  }
}

Windows/JetBrains/Codex note:

  • do not rely on custom parent environment variables such as DRONE_BASE_URL or DRONE_TOKEN being inherited automatically by a local stdio MCP process,
  • many MCP stdio launchers only forward a safe subset of environment variables, so DRONE_* values must usually be set explicitly in the server env block,
  • do not set DRONE_TOKEN to a placeholder like "${DRONE_TOKEN}" in MCP env if your client does not expand placeholders; otherwise the literal string is sent and Drone authentication fails (401).

Client compatibility note:

  • MCP tool inputSchema values are intentionally kept permissive to improve compatibility with clients such as JetBrains and Codex.
  • Strict business validation still happens in the tool handlers, so invalid empty strings or non-positive integers are rejected at execution time rather than at MCP discovery/schema time.
  • drone_ping is available as a minimal no-input diagnostic tool to verify that a client can discover and invoke tools correctly.

Real-time CI Tracking

To enable webhook-driven state cache:

  1. Set MCP_WEBHOOK_PORT to a non-zero port (for example 8080).
  2. Set DRONE_WEBHOOK_SECRET to the shared secret configured in Drone.
  3. Configure Drone webhook target to:
    • http://<host>:<MCP_WEBHOOK_PORT><MCP_WEBHOOK_PATH>
    • default path is /webhook/drone

Optional fallback polling:

  • set MCP_RECONCILE_INTERVAL_MS (for example 5000) to periodically refresh active builds from Drone API.

MCP Tools

Read tools:

  • drone_ping: minimal diagnostic tool returning { ok: true, server: "mcp-drone-ci" }
  • drone_list_repos: list repositories visible to the Drone token
  • drone_list_builds: list build summaries for a repository
  • drone_get_build: fetch full details for one build
  • drone_get_build_logs: fetch one stage/step log stream, with optional truncation
  • drone_get_cached_build_state: inspect webhook-cached build state

Action tools (only when MCP_ENABLE_WRITE_ACTIONS=true):

  • drone_restart_build
  • drone_stop_build
  • drone_approve_build
  • drone_decline_build

Build filters supported by drone_list_builds:

  • owner and repo are always required
  • optional prNumber
  • optional sourceBranch
  • optional targetBranch
  • optional page and limit

Numeric inputs:

  • build identifiers and pagination values are exposed as generic MCP numbers for broad client compatibility
  • integer, positivity, and max-value checks are enforced by the server when the tool is executed
  • filtered drone_list_builds searches report when the repository scan limit is hit, instead of silently returning a false negative

Example:

{
  "name": "drone_list_builds",
  "arguments": {
    "owner": "leuzeus",
    "repo": "gowire",
    "prNumber": 510,
    "sourceBranch": "S076-gcmp-v2-planning",
    "targetBranch": "dev",
    "limit": 5
  }
}

Token Efficiency

This MCP is designed so agents can stay efficient if they use the tools in the intended order:

  1. Use drone_list_builds to search.
  2. Use drone_get_build only for the specific b

Tools (10)

drone_pingMinimal diagnostic tool to verify client connectivity.
drone_list_reposList repositories visible to the Drone token.
drone_list_buildsList build summaries for a repository.
drone_get_buildFetch full details for one build.
drone_get_build_logsFetch one stage/step log stream.
drone_get_cached_build_stateInspect webhook-cached build state.
drone_restart_buildRestart a specific build.
drone_stop_buildStop a specific build.
drone_approve_buildApprove a specific build.
drone_decline_buildDecline a specific build.

Environment Variables

DRONE_BASE_URLrequiredThe base URL of the Drone CI instance.
DRONE_TOKENrequiredAuthentication token for the Drone API.
MCP_ENABLE_WRITE_ACTIONSEnable action tools like restart, stop, approve, and decline.
MCP_WEBHOOK_PORTPort for the optional Drone webhook HTTP receiver.
DRONE_WEBHOOK_SECRETShared secret for HMAC signature verification of webhooks.
MCP_RECONCILE_INTERVAL_MSInterval in milliseconds for polling build state.

Configuration

claude_desktop_config.json
{"mcpServers": {"drone-ci": {"command": "node", "args": ["G:\\projets\\mcp-drone-ci\\dist\\index.js"], "env": {"DRONE_BASE_URL": "https://drone.example.com", "DRONE_TOKEN": "replace-with-drone-token", "MCP_ENABLE_WRITE_ACTIONS": "false", "MCP_WEBHOOK_PORT": "0", "MCP_RECONCILE_INTERVAL_MS": "5000"}}}}

Try it

List all repositories available under my Drone CI account.
Show me the recent build history for the 'gowire' repository owned by 'leuzeus'.
Get the logs for the latest build of the 'dev' branch in the 'gowire' repository.
Approve the pending build number 510 for the 'gowire' repository.

Frequently Asked Questions

What are the key features of Drone CI?

Real-time CI/CD pipeline monitoring via Drone API and webhooks.. Webhook parsing with HMAC signature verification for secure event handling.. In-memory build-state caching for efficient status tracking.. Comprehensive toolset for listing, inspecting, and managing build lifecycles.. Optional fallback polling mechanism for environments without webhooks..

What can I use Drone CI for?

Automating CI/CD pipeline status checks directly within an AI assistant interface.. Quickly approving or declining deployment builds without switching to the Drone web UI.. Debugging build failures by fetching logs directly through natural language queries.. Monitoring multiple repositories for build status updates in real-time..

How do I install Drone CI?

Install Drone CI by running: npm install && npm run build

What MCP clients work with Drone CI?

Drone CI works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Drone CI docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare