Skip to main content

Documentation Index

Fetch the complete documentation index at: https://trunk-4cab4936-sam-gutentag-flaky-tests-new-monitors.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Trunk Flaky Tests includes a Model Context Protocol (MCP) server. AI applications like Claude Code or Cursor can use MCP servers to connect to data sources, tools, and workflows, enabling them to access key information and perform tasks.

Supported AI applications

The following applications are currently supported: Cursor, Claude Code, Gemini CLI, and GitHub Copilot.
Gemini Code Assist and Windsurf are not supported due to their limited support for MCP servers

API

The Trunk MCP server is available at https://mcp.trunk.io/mcp and exposes the following tools:
ToolCapability
search-testExperimental: Lookup the id of a test case
fix-flaky-testExperimental: Retrieve insights around a failing/flaky test
investigate-ci-failureExperimental: Retrieve failing test logs from a CI run
setup-trunk-uploadsCreate a setup plan to upload test results

Authorization

The Trunk MCP server supports two authentication methods. OAuth (default) OAuth 2.0 + OpenID Connect is the default. MCP clients that support the MCP authorization spec will initiate the OAuth flow automatically. Most interactive clients (Cursor, Claude Code, GitHub Copilot) use this path. API token As an alternative, you can authenticate with your Trunk organization API token. This is useful for MCP clients that do not support OAuth, CI/headless environments, or quick manual setup. Find your token under Settings > API in the Trunk dashboard. Pass it as a Bearer token in the Authorization header:
{
  "mcpServers": {
    "trunk": {
      "url": "https://mcp.trunk.io/mcp",
      "headers": {
        "Authorization": "Bearer <your-trunk-api-token>"
      }
    }
  }
}
API token auth is org-level — all requests are attributed to the organization rather than to a specific user. OAuth remains the preferred method for interactive use because it provides user-level identity.

Get started

To get started, configure your AI application to communicate with Trunk’s MCP server: