NewAgent Observability is live.
Back to directory
Trunk logo

Trunk MCP server: four tools for flaky tests

A narrow hosted connector for flaky-test triage, which three of its four tools Trunk marks experimental, and what it does not reach.

Connector
Official, hosted
Coverage
Flaky tests, CI failure logs, test upload setup
Tools
4 documented
Biggest risk for an agent
Three of the four are labeled Experimental by Trunk

Last verified 27 August 2026 · from Trunk's own MCP reference documentation

This page is one of 90 in a directory of monitoring and developer tools. Each page checks what an AI coding agent can get out of the tool through its MCP server, the connector that lets the agent query the tool directly.

Summary

Trunk runs a hosted MCP server at mcp.trunk.io/mcp covering its Flaky Tests product. Its documentation lists 4 tools: search-test, fix-flaky-test, investigate-ci-failure and setup-trunk-uploads.

Three of the four carry an explicit warning in Trunk's own table. search-test, fix-flaky-test and investigate-ci-failure are each described as Experimental.

The one that is not experimental does setup rather than analysis. setup-trunk-uploads creates a plan for uploading test results in the first place.

What is the Trunk MCP server?

It is Trunk's server for the Model Context Protocol. Trunk's Flaky Tests product tracks intermittently failing tests, so a connected agent can tell a real regression from known noise.

The workflow is short by design. search-test looks up a test's identifier, fix-flaky-test returns insights about that test, and investigate-ci-failure pulls failing test logs from a CI run.

setup-trunk-uploads is the odd one out and the only tool without an experimental label. It exists for repositories that are not sending Trunk any test results yet.

Trunk's hosted server is focused on Flaky Tests: search, investigation, a proposed fix and upload setup. That makes it useful for test failures in CI, not for runtime, model or spend questions.

Part of the workWhat Trunk has hereCan an agent reach it
Code, tests & reviewFlaky test insights, test lookupYes. Core strength, though three of the four tools are marked experimental
CI & releaseCI failure logs, test upload setupPartial. investigate-ci-failure reads failing test logs from a run; nothing triggers or configures a pipeline
Production observabilityNoneNo metrics, logs or traces from running services
Agent observability & evalsNoneNo traces or evaluations for your own agents
AI cost managementNoneNo spend data of any kind

For an agent, that means Trunk answers whether a failing test is already known to be flaky, and hands back the log that failed. It cannot re-run the build and it cannot show the code. Pair it with a pipeline connector and a repository connector.

What can an AI agent do with Trunk?

TaskToolsWorksWatch out for
Find a test's identifiersearch-testPartialTrunk labels this Experimental in its own table
Ask whether a failure is known flakinessfix-flaky-testPartialReturns insights around a failing or flaky test; also labeled Experimental
Read the logs from a failing CI runinvestigate-ci-failurePartialRetrieves failing test logs from a run; also labeled Experimental
Start sending Trunk test resultssetup-trunk-uploadsYesCreates a setup plan rather than performing the setup
Re-run a failing jobCircleCI, GitHub or JenkinsNo, separate serverNothing here triggers CI
See the test's sourceGitHubNo, separate serverTrunk holds outcomes, not code

search-test exists because the other tools work from a test identifier rather than a name. Running it first is the whole sequence.

4 tools documented, 3 of them labeled Experimental

Lookup1
search-test
Insight2
fix-flaky-testinvestigate-ci-failure
Onboarding1
setup-trunk-uploads

Counts come from Trunk's own MCP reference, read 24 August 2026. The hosted endpoint returns 401 to an unauthenticated tools/list, so the inventory is documentary rather than captured.

What connecting costs before the first question

A context window is the amount of text a model can hold at once. Four flaky-test tools cost 540 to 683 tokens on Claude. Three of the four are labeled Experimental in Trunk's own table.

The surface is small, so the experimental labels cost little to live with. Connecting to find out spends 540 to 683 tokens on Claude.

Tool setToolsTokens (GPT-5.6, GPT-5.5)Tokens (GPT-4, GPT-3.5)Tokens (Claude Haiku 4.5 to Opus 5)Share of a 200,000-token window
Every tool documented480 to 11980 to 119540 to 6830.0% to 0.3%

Encodings: GPT-5.6, GPT-5.5 o200k_base; GPT-4, GPT-3.5 cl100k_base; Claude Haiku 4.5 to Opus 5 count_tokens. Counted from the 4 tool entries in the vendor's own documentation. That is the only public inventory.

The server could not be run for a live tools/list. So no input schemas are available. These figures cover each tool's name and description only. They are a floor, not the figure.

The Claude columns are measured through the API's count_tokens endpoint, with an empty schema per tool. So they cover the same content as the GPT columns. The range there is two tokenizer generations. Haiku 4.5 and Opus 4.6 sit at the low end. Opus 5 and Sonnet 5 sit at the high end. The gap between them is about a quarter.

Trunk MCP server limits: where answers come back incomplete

The three limits below come from a narrow surface rather than from anything failing.

Three of the four tools are labeled Experimental by Trunk itself.

Trunk's API table marks search-test, fix-flaky-test and investigate-ci-failure as Experimental. Only setup-trunk-uploads carries no such label.

Guard: Treat their output as subject to change, and avoid building an automation that parses their shape strictly.

The agent says: That test does not exist. It may not have been resolved yet.

fix-flaky-test and investigate-ci-failure work from a Trunk test identifier rather than a test name, and search-test is documented as the lookup that produces one.

Skipping the lookup returns nothing, which reads the same as a test Trunk has never seen.

Guard: Have the agent call search-test first and state the identifier it resolved, so an absence can be told apart from a missing lookup.

The agent says: Trunk says the repository is fine. This connector covers Flaky Tests only.

The four documented tools all belong to the Flaky Tests product. Trunk's linters, formatters and merge queue have no tools here.

Guard: Have the agent state that an answer covers flaky tests specifically, rather than the repository's health in general.

How to configure Trunk MCP for agents

  1. 1

    Expect experimental behavior

    Trunk marks three of its four tools Experimental, which is a statement about stability rather than about access.

  2. 2

    Prefer OAuth

    It is the documented default, and clients that support the MCP authorization specification start the flow automatically.

  3. 3

    Use a token for headless use

    Trunk documents an organization API token for CI and for clients without OAuth support.

  4. 4

    Know the boundary

    This is the Flaky Tests product only. Trunk's linters and its merge queue, which tests pull requests before they merge, have no tools here.

Paste this into your agent’s instructions

Three tools are experimental and their output shape can change. The block makes the agent name which one produced a claim.

Terminal
When you answer using Trunk MCP tools, state:
- The tool you called. Three of the four are labeled
  Experimental by Trunk.
- The repository and CI run the answer covers.
- Whether a test was identified by search-test first, since
  the other tools work from an identifier.
Never state that data does not exist. State that the tool
above returned no results for that test or run.
Write your answer in ASD-STE100 Simplified Technical
English. Use short sentences with one idea in each.

Do you need the MCP server at all?

Not for a weekly review. Trunk's web application shows the same flakiness data and costs no context at all.

The connector earns its place mid-failure, when the agent can ask whether this test is already known to be flaky before anyone investigates the code.

For a broader test-analytics surface, BuildPulse covers flakiness, coverage and CI submissions across more tools.

Connect it during triage. Use the dashboard for periodic review of the same numbers.

Trunk MCP server setup

The server is hosted, so there is nothing to install. OAuth 2.0 with OpenID Connect is the default and most interactive clients use it.

For CI or clients without OAuth, Trunk documents an organization API token found under Settings, Organization, General, in the API section.

Claude Code

No credentials appear here. The client detects OAuth discovery and opens a browser to authorize on first connection.

Terminal
claude mcp add --transport http trunk \
  https://mcp.trunk.io/mcp

Cursor

In ~/.cursor/mcp.json. Authorization happens in the browser; no credential is stored here.

Terminal
{"mcpServers":{"trunk":{
  "url":"https://mcp.trunk.io/mcp"}}}

Codex CLI

Codex reads TOML, so the JSON blocks above will not transfer. OAuth still runs in a browser.

Terminal
[mcp_servers.trunk]
url = "https://mcp.trunk.io/mcp"

Every other client

Each block below is the configuration for one client, with the file path and the key that client expects.

Claude Desktop

macOS ~/Library/Application Support/Claude/claude_desktop_config.json. Windows %APPDATA%\Claude\claude_desktop_config.json. There is no CLI. Edit through Settings, Developer, Edit Config.

Quit and restart fully for changes to load. Paths in args must be absolute. Logs at ~/Library/Logs/Claude/mcp.log.

No credentials appear in the file. The client detects OAuth discovery and authorizes in a browser.

Terminal
{"mcpServers":{"trunk":{"url":"https://mcp.trunk.io/mcp"}}}
Gemini CLI

~/.gemini/settings.json globally, or .gemini/settings.json per project. Key mcpServers. CLI: gemini mcp add.

No credentials appear in the file. The client detects OAuth discovery and authorizes in a browser.

Terminal
{"mcpServers":{"trunk":{"url":"https://mcp.trunk.io/mcp"}}}
VS Code Copilot

.vscode/mcp.json per workspace, or your user profile. CLI: code --add-mcp.

No credentials appear in the file. The client detects OAuth discovery and authorizes in a browser.

Terminal
{"servers":{"trunk":{"url":"https://mcp.trunk.io/mcp"}}}

The key is `servers`, not `mcpServers`. VS Code is the only client that uses that name, and copying a config from anywhere else fails silently.

Windsurf

~/.codeium/windsurf/mcp_config.json, which is the path Windsurf documents. Key mcpServers, the same JSON shape as Cursor, carrying the same credential.

Zed

~/.config/zed/settings.json, carrying the same credential as the blocks above.

The key is `context_servers`. Zed does not call them MCP servers in config, so searching its settings for mcp finds nothing.

Google Antigravity

~/.gemini/config/mcp_config.json globally, or .agents/mcp_config.json per project. Key mcpServers. There is no CLI. Use the /mcp overlay in the editor. Supports stdio, streamable HTTP, SSE and websocket.

No credentials appear in the file. The client detects OAuth discovery and authorizes in a browser.

Terminal
{"mcpServers":{"trunk":{"url":"https://mcp.trunk.io/mcp"}}}
Amp (Sourcegraph)

~/.config/amp/settings.json or .amp/settings.json, carrying the same credential. The amp mcp CLI covers approve, doctor and oauth.

The key is `amp.mcpServers`, namespaced. A bare mcpServers block is ignored.

Cline

~/.cline/mcp.json per the docs. The source also reads ~/.cline/data/settings/cline_mcp_settings.json. Key mcpServers, standard JSON shape, carrying the same credential. Supports stdio, streamable HTTP and SSE.

Goose (Block)

~/.config/goose/config.yaml, carrying the same credential.

YAML, and servers are called `extensions`. Goose does not use the MCP vocabulary in config at all. Add one interactively with goose configure, or per session with goose session --with-extension.

Kiro (AWS)

.kiro/settings/mcp.json per workspace, or ~/.kiro/settings/mcp.json globally. Key mcpServers, standard JSON shape, carrying the same credential.

Warp

~/.warp/.mcp.json or .warp/.mcp.json. Key mcpServers, standard shape, carrying the same credential. Also addable through the /agent-add-mcp skill.

JetBrains Junie

.junie/mcp/mcp.json per project, or ~/.junie/mcp/mcp.json. Key mcpServers, carrying the same credential. Use /mcp in the CLI to manage.

Roo Code

.roo/mcp.json per project. The global file is mcp_settings.json, opened from the Roo Code MCP settings view with Edit Global MCP. Key mcpServers, carrying the same credential.

Continue

.continue/mcpServers/*.yaml, one file per server, carrying the same credential.

YAML, and `mcpServers` is a list, not an object. Every JSON client keys servers by name. Continue takes an array, so a converted config will not parse.

Trae

.trae/mcp.json per project, or paste into the UI under Raw Config (JSON). Key mcpServers, standard shape, carrying the same credential.

Devin

Devin has no config file to edit. Servers are added through a web form in the settings UI, and Devin's documentation states you do not need to write or paste JSON. The block below is the shape those fields describe, shown for reference. Either route uses the same credential.

Organization API token

Trunk documents this route for CI, headless environments and clients that do not support OAuth. The token travels as a bearer header.

Terminal
{"mcpServers":{"trunk":{
  "url":"https://mcp.trunk.io/mcp",
  "headers":{"Authorization":"Bearer <your-token>"}}}}

Read-only access, permissions and security

  • Every documented tool reads

    Nothing in the four creates, deletes or triggers a build.

  • OAuth is the default path

    Clients implementing the MCP authorization specification start the flow without a token in a config file.

  • The API token is organization-scoped

    It comes from the organization's own settings rather than from a personal profile. Anyone holding it acts as the organization, not as one user.

  • Experimental labels are Trunk's own

    Three of the four tools carry them, which is worth knowing before building a workflow on their output shape.

Troubleshooting

The client cannot connect
An unauthenticated request returns 401 with a missing-authorization message. Let the client run OAuth, or supply the organization API token as a bearer header.
A tool cannot find the test
The insight tools work from a Trunk test identifier. Call search-test first to resolve a name into one.
There is no flakiness data at all
The repository may not be uploading results yet. setup-trunk-uploads creates a plan for doing that.
Output changed between sessions
Three of the four tools are labeled Experimental in Trunk's documentation, so their shape is not guaranteed stable.

Trunk MCP server: Reference

ItemValue
Endpointmcp.trunk.io/mcp
AuthOAuth 2.0 with OpenID Connect by default; organization API token as an alternative
Tools4 documented, all read-only
Experimental tools3 of 4, per Trunk's own table
Token locationSettings, Organization, General, API section
Product scopeFlaky Tests only
Inventory sourceTrunk's own MCP reference, read 24 August 2026

What engineers report

The documentation is short and specific, so the counts below come from it directly.

What was checkedWhat it shows
Documented tools4
Tools labeled Experimental3
Authentication routes2: OAuth and organization API token
Product scopeFlaky Tests

Tool inventory and authentication routes read from Trunk's own MCP reference on 24 August 2026. An unauthenticated tools/list against mcp.trunk.io/mcp returned 401 with a missing-authorization message on the same date, which is why this page is sourced from documentation rather than from the wire.

Should you connect an agent to Trunk?

Yes. Best for OAuth from an interactive client, with the organization token kept for headless use.

Strongest fit
Trunk Flaky Tests users who want a quick known-flake check without leaving the editor.
Main advantage
A tiny, focused surface with OAuth by default and a documented token route for CI.
Main weakness
Three of the four tools are experimental, and the connector covers one Trunk product.
Operational risk
None from the tools themselves; all four read and none triggers a build.

From Oodle

One platform for agent traces and infrastructure

Agent traces usually sit in a different product from the rest of your telemetry, so when a slow database makes an agent slow the symptom is in one tool and the cause is in another. Oodle keeps both in one query surface, from $10 per million spans.

See agent observability

Frequently asked questions

How many tools does the Trunk MCP server have?

4 documented: search-test, fix-flaky-test, investigate-ci-failure and setup-trunk-uploads. Read from Trunk's own reference on 24 August 2026.

Are they stable?

Trunk labels three of the four Experimental in its own table. Only setup-trunk-uploads carries no such label.

How does authentication work?

OAuth 2.0 with OpenID Connect is the default. An organization API token is documented for CI, headless use and clients without OAuth support.

Does it cover Trunk's linters or merge queue?

No. The documented tools all belong to the Flaky Tests product.

What if no data comes back?

The repository may not be uploading test results. setup-trunk-uploads creates a plan for configuring those uploads.

Changelog

  • 13 March 2026. io.trunk/mcp-server version 1.1.0 published to the MCP registry, and trunk-io/mcp-server last pushed.
  • 20 October 2025. io.trunk/mcp-server version 1.0.0 published to the MCP registry.
  • 15 October 2025. trunk-io/mcp-server created on GitHub.

Sources

Every number on this page traces to one of these

  1. Trunk MCP reference documentation, read 24 August 2026
  2. Tool table, experimental labels and authentication routes from the same page
  3. Official MCP registry entry io.trunk/mcp-server, confirmed 27 August 2026

Trunk’s own MCP documentation

Also test analytics:

For the pipeline behind a failure: