# Buildkite MCP for AI Agents MCP

> Buildkite connects your CI/CD pipelines to any AI agent, letting you manage complex build workflows using natural conversation. You can instantly list pipelines, trigger new tests on specific branches, and deep-dive into logs—all without leaving your chat interface.

## Overview
- **Category:** ship-it
- **Price:** Free
- **Tags:** ci-cd, pipeline-automation, deployment, build-management, devops

## Description

Stop context-switching between the terminal and web consoles just to check a build status. This MCP lets your AI agent handle full CI/CD lifecycle management through conversation. You can ask it to list all pipelines across the organization, trigger an ad-hoc test run on a specific feature branch, or instantly cancel a stuck deployment. It also handles everything in between: getting deep details about past runs and verifying which build agents are active.

It’s like giving your agent full control over your entire build operation center. Whether you're running local tests or coordinating hybrid infrastructure, the platform makes it simple to monitor builds for an entire company. You just connect this Buildkite MCP via Vinkius and start managing deployments conversationally.

## Tools

### cancel_build
Stops an actively running software build process immediately.

### create_build
Initiates a new build execution for any configured pipeline.

### get_access_token_info
Retrieves basic information confirming the status and scope of the currently connected API token.

### get_build
Fetches all detailed metadata about a single, specific build run.

### get_pipeline
Retrieves the full configuration and details for one named pipeline.

### list_agents
Pings and lists all operational build agents connected to your organization.

### list_all_builds
Retrieves a list of every build run that has occurred across the entire company setup.

### list_organizations
Lists all separate Buildkite organizations the connected API token can access.

### list_pipeline_builds
Gets a list of recent build runs associated with one specific pipeline.

### list_pipelines
Provides an inventory of all pipelines configured within the current organization.

### rebuild
Forces a re-execution of a specific build, useful if initial results were inconclusive.

## Prompt Examples

**Prompt:** 
```
What were the last three builds that ran on our main production pipeline?
```

**Response:** 
```
**Build History Summary**

*   ✅ Build #204: **Status:** Passed (Main Branch)
    *   *Duration:* 5m 12s
    *   *Commit:* `a1b3c9d`
*   ❌ Build #205: **Status:** Failed (Frontend Refactor)
    *   *Failure Point:* Unit Tests in `src/components/UI.js`.
    *   *Action:* Needs review of log segment 4.2.
*   ✅ Build #203: **Status:** Passed (Main Branch)
    *   *Duration:* 5m 10s
    *(Would you like me to inspect the failure logs for #205?)
```

**Prompt:** 
```
Trigger a fresh test run on the user-auth service with the latest code.
```

**Response:** 
```
**Build Initiated Successfully**

The `user-auth` pipeline is starting a new build. You can track its progress here: [Live Link]

*   **Target:** Latest Code (HEAD)
*   **Pipeline ID:** 456
*   **Status:** Running (Agent pinged successfully)

Please monitor this link; I'll let you know if the status changes.
```

**Prompt:** 
```
Can we check which build agents are currently online?
```

**Response:** 
```
Here is the current operational status of your connected build agents:

| Agent Name | Status | Last Ping Time |
| :--- | :--- | :--- |
| US-East-1-Runner | ✅ Online | 2 minutes ago |
| EU-West-2-Worker | ✅ Online | 3 minutes ago |
| Asia-Pacific-Test | ⚠️ Offline | Unknown |

The agent in the Asia Pacific region appears to be disconnected. Should I run a ping test?
```

## Capabilities

### List all organizational pipelines
Get a complete overview of every active build pipeline configured across your organization.

### Trigger ad-hoc builds
Start a new, immediate test run for any specific pipeline or branch.

### Cancel and restart deployments
Halt running builds that got stuck or quickly initiate a rebuild of a failed process.

### Monitor build agents globally
Verify the status of all connected build agents to ensure your infrastructure is online.

### Retrieve detailed build history
Fetch deep logs and metadata for any past pipeline execution, helping pinpoint failure causes.

## Use Cases

### The staging deployment is failing, and I need to know why.
Instead of checking the console logs for hours, you ask your agent. It uses `list_pipeline_builds` to find the latest failed runs, then calls `get_build` on that specific build to summarize the job failures and point you exactly where to look.

### We have a critical bug found in production; I need an immediate rollback test.
You prompt your agent. It identifies the correct pipeline, uses `create_build` to trigger a fresh build on the stable branch, and monitors the results until it confirms readiness for deployment.

### I suspect one of our remote build agents is offline.
You ask your agent about infrastructure health. It executes `list_agents`, showing you a real-time list of every registered agent and their operational status, letting you know immediately if parts of the team are disconnected.

### The main branch build keeps failing right after merge.
You ask your agent to review the situation. It uses `list_pipelines` to find the source pipeline, and then it can use `rebuild` on a specific failed execution ID to rule out transient network issues.

## Benefits

- Instantly cancel stuck builds or retry failures. You can use the `cancel_build` tool to stop a running job immediately, saving compute time and keeping deployments moving.
- Deep visibility into historical data. By calling `list_all_builds` and then `get_build`, you pinpoint exactly when and why a failure occurred months ago.
- Global agent monitoring is simple. Use `list_agents` to verify that all your distributed build agents are online, which is crucial for hybrid infrastructure.
- Never lose track of pipelines again. The ability to use `list_pipelines` gives you an instant inventory of every defined workflow in the company.
- Speed up iteration cycles. Need a quick test? Use `create_build` to trigger new runs on feature branches without leaving your chat window.

## How It Works

The bottom line is, you treat managing complex CI/CD infrastructure like talking to a teammate who already knows where all the buttons are.

1. Subscribe to this MCP on Vinkius and provide your Buildkite API Token and Organization Slug.
2. Your AI agent authenticates the connection and confirms access across your organization's build environment.
3. You use natural language prompts (e.g., 'What failed builds did we have yesterday?') and your agent executes the necessary commands to deliver actionable data.

## Frequently Asked Questions

**Can my AI agent restart failed builds for a specific branch?**
Yes. Ask the agent to find failed builds across your pipeline by using the list builds tool. Once it locates the specific build number, it can run the rebuild tool instantly, eliminating the need to search through hundreds of logs on the dashboard.

**How can I check the status of my physical runner agents?**
Ask your agent to list all agents connected to the Buildkite organization. It returns their UUIDs, operating systems, and connection state. If a runner hangs offline, your AI can immediately flag it to the Platform team, saving crucial deployment time.

**If a commit is pushed to 'main', can the agent trigger a fresh pipeline deployment?**
Absolutely. You can provide the commit SHA (or simply ask it to target 'HEAD' on the 'main' branch) and ask the agent to create a new build. It will hit the Buildkite trigger endpoint with a message of your choosing.