travis-mcp
Travis MCP server lets AI agents inspect Travis CI builds and logs read-only, with optional opt-in restart/cancel, plus a usage metrics script.
get_build: fetch state, branch/PR, commit, timing, job IDs, and web URL for a Travis build
get_build_jobs: list a build's jobs with state and stage to identify the failing job
list_builds: list recent builds for a repo, filterable by branch, event type, state, or pull request number
get_job_log: retrieve a job's plain-text log (ANSI/travis markers stripped), tailed by default or filtered with grep and context
restart_build (opt-in via
TRAVIS_ALLOW_WRITE=restart): restart a finished buildcancel_build (opt-in via
TRAVIS_ALLOW_WRITE=cancel): cancel a running or created buildUsage metrics script (
scripts/travis_metrics.py): read-only account-wide analysis of build minutes, concurrency peaks, queue waits, reliability, and saturation, outputting CSV/JSON reports
Provides read-only access to Travis CI builds, jobs, and logs via the Travis API v3, enabling agents to check build status, identify failing jobs, and read job logs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@travis-mcp Why did the last build fail?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
travis-mcp
MCP server for Travis CI, over the Travis API v3. Lets AI coding agents check build status, find the failing job and read its log — read-only by default, with opt-in build restart/cancel. Also ships a standalone usage metrics script (build minutes, concurrency peaks, reliability) for an entire Travis account.
Why access control lives in the server
Travis API tokens have no scopes: the API docs state a token can be used "to do anything that you can do using the web interface" (restart/cancel/trigger builds, edit settings and env vars). Access therefore cannot be narrowed through the token and is enforced here:
the HTTP client reads with
GET, and its only write method refuses any path other than/build/{id}/restartand/build/{id}/cancelbefore sending anything (covered by tests, including path-traversal attempts);the write tools are not even registered unless
TRAVIS_ALLOW_WRITElists them;nothing ever triggers a build with custom config, reads or edits env vars, settings or caches.
Related MCP server: mcp-ci-triage
Tools
Tool | Travis endpoint | Purpose |
|
| State, branch/PR, commit, timing, job IDs, web URL |
|
| Per-job state and stage, to spot the failing job |
|
| Recent builds, filtered by branch, event type, state or PR number |
|
| Job log, ANSI and |
|
| Opt-in ( |
|
| Opt-in ( |
The write tools are annotated destructiveHint: true, so MCP clients that honor
annotations ask for confirmation. Their descriptions tell the model to call them only on
an explicit human instruction naming the build; they return the build's state before the
action and whether Travis accepted it (@type: pending).
A job may have no stored log (Travis then returns a literal null body, e.g. a log not yet
archived or removed); get_job_log reports it as unavailable rather than returning null.
The API has no pull request filter, so list_builds with pull_request pages through the
last 500 PR builds and filters client side.
Configuration
Variable | Required | Default |
| yes | — |
| no | — ( |
| no | empty = read-only. Comma list of |
| no |
|
| no |
|
Get the token from https://app.travis-ci.com/account/preferences → API authentication
(works for accounts that sign in with GitHub), or with the Travis CLI:
travis login --pro && travis token --pro. The Assets and RSS tokens on the same page
do not give access to builds or logs.
Keep the token out of tracked files: store it in the OS keychain or a secrets manager and export it into the environment the MCP client is launched from.
Usage
Claude Code .mcp.json, pinned to a full commit SHA — not a tag or branch, which can be
moved to point at different code (the matching tag is listed in the release):
{
"mcpServers": {
"travis": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:vlhommeau/travis-mcp#<commit-sha>"],
"env": {
"TRAVIS_API_TOKEN": "${TRAVIS_API_TOKEN}",
"TRAVIS_DEFAULT_REPO": "owner/name",
"TRAVIS_ALLOW_WRITE": "restart,cancel"
}
}
}
}No build step: the server is plain ESM JavaScript, runnable straight from a git checkout
(Node.js 20+). Dependencies are pinned to exact versions and the whole tree is locked by
npm-shrinkwrap.json — unlike package-lock.json, npm honors it when the package is
installed as a dependency (including through npx github:...), so every install resolves
the same transitive versions.
Usage metrics script
scripts/travis_metrics.py extracts account-wide usage over a
period — the numbers Travis Insights doesn't show (concurrency) or can't export. Python
3.11+, standard library only, GET requests only.
export TRAVIS_API_TOKEN=...
python3 scripts/travis_metrics.py --owner my-org --out ./travis-metrics # last 3 months
python3 scripts/travis_metrics.py --owner my-org --since 2026-06-01 --until 2026-09-01 --limit 10
python3 scripts/travis_metrics.py --from-cache ./travis-metrics/raw.json --limit 5 # re-analyze, no API callsOption | Default | |
| — | Organization or user login; every repository under it is scanned |
| 3 months up to yesterday |
|
|
| Timezone for calendar days |
|
| Plan concurrency limit, for saturation detection |
| all | Restrict to a slug (repeatable) |
|
| Throttle between requests (Travis publishes no rate-limit headers; 429/5xx are retried with backoff, honoring |
Outputs, in --out:
daily.csv— per day: builds, jobs, build minutes, peak concurrent jobs, peak demand (running + waiting — running jobs can never exceed the plan's cap, so demand is what shows how far above it the need went), minutes at or above the limit, peak waiting jobs and waiting job-minutes while at the limit, jobs that waited over 1 minute, passed/failed/errored/canceled counts, errored and failed rates;saturated_days.csv— the days whose peak reached the limit;summary.json— totals and mean/median/p90: minutes per month, builds per day, build duration (wall clock and billed), concurrency and peak demand, queue wait percentiles and histogram (with the "waited" threshold stated explicitly), state split, active repositories, and the caveats below;raw.json— the fetched builds and jobs, for--from-cachere-analysis.
How it works:
Repositories come from
GET /owner/{login}/repos(skipping those with no build ever); builds fromGET /repo/{id}/builds?include=build.jobs&sort_by=id:desc, which embeds each job'screated_at/started_at/finished_at/restarted_at, so one request covers 100 builds;GET /job/{id}is only a fallback. Paging stops once a whole page predates the period.Concurrency: one sweep over every job's
[started_at, finished_at]across all repositories (the plan's limit is account-wide), split at local midnight.Queue wait: from when a job became runnable —
restarted_at, elsecreated_at, or the end of the previous stage for multi-stage builds — tostarted_at(or to its cancellation if it never started). The "waiting at limit" figures only count waiting while running jobs are at or above--limit, i.e. queueing attributable to the cap.
Caveats (also written to summary.json): a restarted job only keeps its latest run's
timestamps, so minutes and peaks are lower bounds; queue wait includes VM boot time, hence
the 1-minute threshold; waits over 6 hours are treated as data artifacts and excluded.
Development
npm install
npm test
python3 -m unittest discover -s test -p 'test_*.py'
TRAVIS_API_TOKEN=... npx @modelcontextprotocol/inspector node src/index.jsAvailable Tools
4 toolsget_buildGet buildBRead-only
State, branch/PR, commit, timing and job IDs of one Travis build.
Inputs: build_id (required).
get_build_jobsGet build jobsARead-only
Jobs of one Travis build with their state and stage, to find which job failed.
Inputs: build_id (required).
get_job_logGet job logARead-only
Plain-text log of one Travis job, ANSI codes stripped. Returns the last lines by default; use grep to extract matching lines with context instead.
Inputs: job_id (required), grep, tail_lines.
list_buildsList buildsARead-only
Most recent builds of a repository, newest first. Filter by branch, event type, state or pull request number.
Inputs: repo, limit, state, branch, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct layer of the CI data model: build, jobs of a build, build list, and job log. There is no overlap or ambiguity in purpose.
All names follow a clean snake_case verb_noun pattern. The use of list_ for the plural build listing and get_ for singular resources is a standard and predictable convention.
Four tools form a well-scoped, focused surface for read-only Travis CI build inspection. Each tool clearly earns its place without unnecessary redundancy.
The set covers the complete inspection workflow: discover builds, view build details, drill into jobs, and fetch job logs. Missing write operations like restart or cancel are likely out of scope but could be considered minor gaps.
Related MCP Connectors
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
Read your runners.io organisation's jobs, logs, test results, cache and spend from an AI agent.
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceRead-only MCP server for Jenkins CI, enabling AI agents to securely query job/build status, logs, artifacts, and generate verification reports for loop workflows.ISC
- AlicenseAqualityDmaintenanceExposes GitHub Actions state as four compact, read-only tools for triaging CI failures, letting agents answer why CI is red without leaving the chat.4MIT
- AlicenseNot gradedqualityDmaintenanceProvides read-only access to Jenkins, enabling users to inspect project and environment build status, list builds, retrieve console logs and test reports, diagnose failed builds, and search jobs via natural language, without triggering or changing builds.MIT
- AlicenseNot gradedqualityCmaintenanceEnables read-only inspection of Depot CI failures, job logs, GitHub Actions jobs on Depot runners, and container builds through the Depot API, so agents can diagnose issues without installing the Depot CLI.MIT