MCP Server
The CI server exposes a Model Context Protocol (MCP) endpoint at /mcp. This lets AI assistants (GitHub Copilot, Claude, etc.) inspect pipeline runs, list task output, and search across pipelines directly from your editor — no manual curl required.
Quick start
1. Start the server
pocketci server \
--storage sqlite://pocketci.db \
--basic-auth admin:yourpassword \
--port 80802. Configure VS Code
Add a .vscode/mcp.json file to your workspace:
{
"servers": {
"ci": {
"url": "http://localhost:8080/mcp",
"type": "http",
"headers": {
"Authorization": "Basic ${input:ciBasicAuth}"
}
}
},
"inputs": [
{
"id": "ciBasicAuth",
"type": "promptString",
"description": "Base64-encoded 'user:password' (run: echo -n 'admin:yourpassword' | base64)",
"password": true
}
]
}Generate the Base64 value once and store it securely:
echo -n 'admin:yourpassword' | base64VS Code will prompt for the value on first use and remember it for the session.
3. Use the tools
Open GitHub Copilot Chat (or any MCP-compatible assistant) and ask questions like:
- "What failed in run
abc123?" - "Show me the stdout of the last task in this run."
- "Find pipelines that use the
busyboximage."
Available tools
get_run
Retrieve the status and metadata for a single pipeline run.
Input
| Field | Type | Description |
|---|---|---|
run_id | string | The run ID to fetch |
Returns JSON with status (queued / running / success / failed), pipeline_id, started_at, finished_at, and any error message.
Example prompt
"Get the status of run
_Y0_q5n3RMUktK5y2tYGO."
list_run_tasks
List every task that executed within a run, including stdout, stderr, elapsed time, and exit status.
Input
| Field | Type | Description |
|---|---|---|
run_id | string | The run ID whose tasks to list |
Returns An array of task objects, each with:
| Field | Description |
|---|---|
path | Hierarchical task identifier |
status | success / failed / running / queued |
type | task, agent, or pipeline |
stdout | Captured standard output |
stderr | Captured standard error |
elapsed | Wall-clock duration |
started_at | RFC3339 start timestamp |
Example prompt
"List all tasks for run
_Y0_q5n3RMUktK5y2tYGOand tell me which one failed."
search_tasks
Full-text search in two modes — either within one run's task output, or across all runs for a pipeline.
Input
| Field | Type | Required | Description |
|---|---|---|---|
run_id | string | one of the two | Search task stdout/stderr within this single run |
pipeline_id | string | one of the two | Search runs for this pipeline (by ID, status, error) — mirrors the web UI runs search |
query | string | yes | Search query (see mode notes below) |
page | integer | no | 1-based page number (default: 1, pipeline_id mode only) |
per_page | integer | no | Results per page (default: 20, pipeline_id mode only) |
Provide either run_id or pipeline_id. If run_id is given it takes precedence.
Mode 1 — search task output within a run (run_id)
Uses FTS5 to match any task's stdout/stderr/text fields. Returns matching task records (path, status, stdout, stderr). Useful for pinpointing an error message or stack trace without scrolling through all output.
| FTS5 query | Matches |
|---|---|
panic | Any task containing "panic" |
"exit code 1" | Exact phrase |
error NOT warn | "error" but not "warn" |
Mode 2 — search runs for a pipeline (pipeline_id)
Uses FTS5 on run ID, status, and error message. Supports the same prefix matching and quoted phrases as run_id mode. Returns a paginated PaginationResult[PipelineRun]. Equivalent to the pipeline-level runs search in the web UI (/pipelines/:id/runs-search/).
| Query example | Matches |
|---|---|
failed | Runs with status failed |
timeout | Runs with "timeout" in error |
"out of mem" | Exact phrase in error message |
seg | Prefix match ("segfault", etc.) |
Example prompts
"Search run
_Y0_q5n3RMUktK5y2tYGOforpermission denied." (run_id mode)
"Search pipeline
d22bcae276f280529d3c4c351e81c699runs forfailed." (pipeline_id mode)
search_pipelines
Full-text search across all stored pipelines by name or content. Supports pagination.
Input
| Field | Type | Description |
|---|---|---|
query | string | Search string (empty → return all) |
page | integer | 1-based page number (default: 1) |
per_page | integer | Results per page (default: 20) |
Returns Paginated list of pipelines with id, name, and driver_dsn.
Example prompt
"Find all pipelines that reference
golangin their source."
Connecting to a remote server
For a deployed instance (e.g. on Fly.io), point the URL at the public hostname:
{
"servers": {
"ci": {
"url": "https://ci.fly.dev/mcp",
"type": "http",
"headers": {
"Authorization": "Basic ${input:ciBasicAuth}"
}
}
},
"inputs": [
{
"id": "ciBasicAuth",
"type": "promptString",
"description": "Base64-encoded 'user:password' for ci.fly.dev",
"password": true
}
]
}Typical debug workflow
- A pipeline run fails. Copy the run ID from the URL (
/runs/<run_id>/tasks). - Ask the assistant: "What failed in run
<run_id>?" - The assistant calls
get_runto confirm the status, thenlist_run_tasksto surface the failed step and its stderr. - If the output is noisy, use
search_tasksto zero in on the error. - Fix the pipeline source and re-run.