# Trinity: every agent-facing doc in one file --- source: https://app.usetrinity.ai/llms.txt # Trinity > Trinity is agentic coordination for engineering teams. It turns what people commit to in Slack, meetings, GitHub, Linear and Jira into tasks with an owner and a date, follows each one until it lands, and gives coding agents the context behind the task they work on. app.usetrinity.ai is the Trinity dashboard. A coding agent connects to Trinity over MCP: it reads a task's context (the thread it came from, its pull requests, its milestone) and reports its own progress on that task. The agent gets its token from one browser approval by the person it works for. Tools on the MCP server: get_task_context, get_task, find_tasks, get_milestone, list_milestones and read_source read the workspace; start_task, report_progress, link_pull_request, propose_task, ask_blocker and finish_task write, as the person who approved the token. Pricing: free for two weeks with no card, then $50 a seat a month (https://usetrinity.ai/pricing). ## Connect an agent - [Getting credentials as an AI agent](https://app.usetrinity.ai/auth.md): the fastest path to a token, and where the person must step in - [Quickstart](https://app.usetrinity.ai/docs/): get a token, connect over MCP, work on a task - [MCP reference](https://app.usetrinity.ai/docs/mcp): every tool, its arguments and errors - [Agent setup](https://app.usetrinity.ai/agent-setup.txt): pick your coding agent and follow its plain-text steps - [Setup for any MCP client](https://app.usetrinity.ai/agent-setup/other.txt): get a token through one browser approval, then connect over MCP - [MCP server](https://app.usetrinity.ai/api/v1/agent/mcp): Streamable HTTP, header `Authorization: Bearer ` - [OpenAPI spec](https://app.usetrinity.ai/openapi.json): the token endpoints and the MCP endpoint - [MCP server card](https://app.usetrinity.ai/.well-known/mcp.json): the server's endpoint, transport and auth header as JSON ## Optional - [llms-full.txt](https://app.usetrinity.ai/llms-full.txt): this file and every doc above in one request - [Sitemap](https://app.usetrinity.ai/sitemap.xml): every page written for agents - [security.txt](https://app.usetrinity.ai/.well-known/security.txt): where to report a vulnerability - [Product site](https://usetrinity.ai): what Trinity does, features and FAQ - [Product overview for agents](https://usetrinity.ai/llms.txt) --- source: https://app.usetrinity.ai/auth.md # Getting Trinity credentials as an AI agent Trinity gives an agent one bearer token, approved once in the browser by the person the agent works for. The token opens Trinity's MCP server and acts as that person. There is no API key screen, no test key, no CLI and no OAuth client registration. ## Fastest path: one browser approval 1. `POST https://app.usetrinity.ai/api/v1/devices/authorize/start` with `{"tool": "other", "name": ""}`. Keep the `deviceCode` it answers secret. 2. Tell the person, in one line, to open `verificationUrl` and approve the request that shows `verificationCode`. 3. Every `intervalSeconds`, `POST https://app.usetrinity.ai/api/v1/devices/authorize/exchange` with `{"deviceCode", "hostname", "machineId"}`. `machineId` names this machine: derive it with the [quickstart's recipe](https://app.usetrinity.ai/docs/), never send the raw machine id, and never let two agents share one. `202` means not approved yet. `200` answers `token` and `mcpUrl`. `404` means the request expired: start again once. 4. Verify: ```bash curl -s -X POST https://app.usetrinity.ai/api/v1/agent/mcp \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' ``` Every step with `curl`: [quickstart](https://app.usetrinity.ai/docs/). The same steps as plain instructions: [agent-setup/other.txt](https://app.usetrinity.ai/agent-setup/other.txt). The endpoints: [openapi.json](https://app.usetrinity.ai/openapi.json). ## MCP Connect to `https://app.usetrinity.ai/api/v1/agent/mcp` over Streamable HTTP with the header `Authorization: Bearer `. Trinity has no OAuth sign-in for MCP yet, so a client that can only connect through OAuth cannot use it. Use a client that takes a custom header. Tools: [MCP reference](https://app.usetrinity.ai/docs/mcp). Claude Code, Codex, Cursor, Gemini CLI and GitHub Copilot CLI have a Trinity plugin that does this pairing and also records coding sessions: [agent-setup.txt](https://app.usetrinity.ai/agent-setup.txt). ## Where a human must step in - Signing up. The person signs in at https://app.usetrinity.ai with Google or GitHub and creates or joins an organization. An agent cannot create the account. - Approving the token. One click on the `verificationUrl` page, signed in. The agent never sees their session. - Paying, after two weeks. An owner subscribes in the dashboard. Until then the person cannot approve a new token, so your request stays pending until it expires with `404`; tell the person rather than starting again in a loop. Writes fail while existing tokens can still read, and once a paid subscription lapses, reads fail too. ## Limits - Free for two weeks with no card, then $50 a seat a month ([pricing](https://usetrinity.ai/pricing)). - 10 authorization starts a minute per IP address. A request lasts 10 minutes. Poll every 2 seconds. - Each tool call has 20 seconds. - The token endpoints answer `{"error": ""}` with a status code. The MCP server answers `401` for an unknown token and `403` for a revoked device: pair again for either. --- source: https://app.usetrinity.ai/docs/index.md # Trinity developer docs Trinity keeps an engineering team's commitments as tasks: what people ask for in Slack, meetings, GitHub, Linear and Jira gets an owner and a date, and Trinity follows it until it lands. For a coding agent, Trinity is one MCP server. Read a task's context before you work on it, then report your progress and your pull request on it as you go. - MCP server: `https://app.usetrinity.ai/api/v1/agent/mcp` (Streamable HTTP, stateless) - Auth: `Authorization: Bearer `, a device token you get with one browser approval - Tools: [MCP reference](https://app.usetrinity.ai/docs/mcp) - API spec: [openapi.json](https://app.usetrinity.ai/openapi.json) - Price: free for two weeks with no card, then $50 a seat a month ([pricing](https://usetrinity.ai/pricing)) ## Before you start The person you work for needs a Trinity account. They sign in at https://app.usetrinity.ai with Google or GitHub and create or join an organization. A new organization gets two weeks of free access with no card. Your token acts as that person, in that organization. ## 1. Get a token Getting a token is self-serve: there is no API key screen and no sales call. You ask, the person approves once in the browser, and you collect the token. Start a device authorization. Use `"tool": "other"` for any MCP client without a Trinity plugin, and a short name the person will recognise: ```bash BASE=https://app.usetrinity.ai curl -s -X POST "$BASE/api/v1/devices/authorize/start" \ -H 'Content-Type: application/json' \ -d '{"tool": "other", "name": "my-agent"}' ``` The answer carries `deviceCode`, `verificationUrl`, `verificationCode`, `intervalSeconds` (2) and `expiresInSeconds` (600). `deviceCode` is a secret: never show it or log it. Ask the person to open `verificationUrl` and approve the request that shows `verificationCode`. Then poll every `intervalSeconds`. `machineId` is 64 lowercase hex characters that name this machine to Trinity: a Trinity-specific digest of the machine's own id, never the raw id and never a secret. A container often has no machine id, so the recipe below keeps a random one in your config directory instead; two agents must never send the same `machineId`, because pairing the same machine again takes over its device and its token. Containers cloned from one image can share `/etc/machine-id`: give each its own. ```bash SOURCE=$( (cat /etc/machine-id 2>/dev/null || ioreg -rd1 -c IOPlatformExpertDevice 2>/dev/null | awk -F'"' '/IOPlatformUUID/{print $4}') | tr -d '[:space:]' | tr 'A-Z' 'a-z') if [ -z "$SOURCE" ]; then ID_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/trinity/machine-id" [ -s "$ID_FILE" ] || { mkdir -p "${ID_FILE%/*}" && od -An -N32 -tx1 /dev/urandom | tr -d ' \n' > "$ID_FILE"; } SOURCE=$(cat "$ID_FILE") fi MACHINE_ID=$(printf 'trinity-machine-id:%s' "$SOURCE" | { sha256sum 2>/dev/null || shasum -a 256; } | cut -c1-64) curl -s -X POST "$BASE/api/v1/devices/authorize/exchange" \ -H 'Content-Type: application/json' \ -d "{\"deviceCode\": \"$DEVICE_CODE\", \"hostname\": \"my-agent\", \"machineId\": \"$MACHINE_ID\"}" ``` - `202 {"status": "pending"}`: not approved yet, poll again. - `200 {"token", "deviceId", "mcpUrl", "ingestUrl"}`: done. The authorization is spent. - `404`: the request expired or was already used. Start again. If it expired after the person tried to approve it, their organization's free period may have ended or its subscription lapsed: approval is refused until an owner subscribes, so tell them rather than starting again in a loop. - `402`: the organization lost access between the approval and this exchange (its free period ended or its subscription lapsed). The error names the reason. Keep the token where your MCP client keeps secrets, never in a repository. It lasts until the device is revoked in Trinity. Pairing the same machine again (same person, organization, tool and `machineId`) reuses the device and rotates its token. ## 2. Connect over MCP Claude Code: ```bash claude mcp add --transport http trinity https://app.usetrinity.ai/api/v1/agent/mcp \ --header "Authorization: Bearer $TOKEN" ``` Any other client: add a Streamable HTTP server at the MCP URL with the `Authorization` header. A raw check: ```bash curl -s -X POST "$BASE/api/v1/agent/mcp" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' ``` ## 3. Work on a task A task is named by its code (T123), a GitHub issue or pull request, a Linear or Jira key, or a pasted URL. A typical session: 1. `get_task_context`: the task, the thread it came from, its pull requests and related work. 2. `start_task` when you begin. A task still to do moves to in progress. 3. `report_progress` with one line every few minutes. 4. `link_pull_request` as soon as you open the pull request. 5. `finish_task` with `ready_for_review`, `blocked` or `done`. When you are stuck on a question only the asker can answer, `ask_blocker` posts it in the Slack thread the task came from. Every tool and its arguments: [MCP reference](https://app.usetrinity.ai/docs/mcp). ## Errors - Token endpoints answer JSON `{"error": ""}` with the status codes in the [spec](https://app.usetrinity.ai/openapi.json). - The MCP server answers `401` for a token Trinity does not know and `403` for a revoked device. Pair again for either. - A tool that cannot run answers an MCP error with one line saying why, for example `billing locked: free_access_expired`. ## Limits - 10 authorization starts a minute per IP address. A request lasts 10 minutes. - Each tool call has 20 seconds. ## Plugins Claude Code, Codex, Cursor, Gemini CLI and GitHub Copilot CLI have a Trinity plugin. It does this pairing for you and also records coding sessions on the tasks they serve. Setup steps for each: https://app.usetrinity.ai/agent-setup.txt --- source: https://app.usetrinity.ai/docs/mcp.md # Trinity MCP server - URL: `https://app.usetrinity.ai/api/v1/agent/mcp` - Transport: Streamable HTTP, stateless. Send `Accept: application/json, text/event-stream`. - Auth: `Authorization: Bearer `. Get a token in the [quickstart](https://app.usetrinity.ai/docs/). - Answers: every tool answers one text block holding JSON. `tools/list` gives each tool's full input schema. The token belongs to one person in one organization. Reads see the projects that person is a member of. Writes are made as that person, and Trinity shows them on the task and keeps its GitHub, Linear and Jira issues in step. ## Naming a task Every tool that works on one task takes one of: - `task_code`: a project task code such as `T123`. A bare number is not a code. - `task_id`: the Trinity task id. - `github_repository` with `github_number`: a GitHub issue or pull request. - `tracker_issue`: a Linear or Jira key such as `ENG-142`. - `url`: a pasted GitHub issue or pull request URL. Add `repo` (the repository you work in, as `owner/name` or its git remote) or `project` (a slug or id) when the person is in several projects. A reference no task tracks answers `not_tracked` with what to read instead. ## Read tools | Tool | What it answers | Main arguments | |---|---|---| | `get_task_context` | The read to make before working on a task: the task and its trackers, the Slack thread it came from, its pull requests and coding sessions, revisions, open obligations, and related work found by meaning. Each related hit names the tool that reads it whole. | a task, `query`, `hops` (1 to 3), `limit` | | `get_task` | One task by any reference a person hands you. | a task | | `find_tasks` | The project's tasks, searched by meaning and words or listed by milestone, status and assignee. | `query`, `milestone`, `status`, `assignee` (`me` or a user id), `limit` | | `get_milestone` | One milestone and its tasks, fifty to a page. | `code` (M7, m7, 7 or an id), `page` | | `list_milestones` | The project's milestones with code, name, estimate, target date and status. | `include_archived` | | `read_source` | One record a `get_task_context` hit points at, whole: a GitHub, Linear or Jira issue, a pull request, a Slack message or thread, a meeting note, a Notion page or a coding session. | `kind`, `key`, `thread_ts` | ## Write tools | Tool | What it does | Main arguments | |---|---|---| | `start_task` | Says you are starting a task. A task still to do moves to in progress. | a task, `branch` | | `report_progress` | Records one line of what you are doing now on the task. Call it at most every few minutes. | a task, `line` (280 characters) | | `link_pull_request` | Records a pull request as the work on a task. Call it when you open the pull request. | a task, `repository`, `number` | | `propose_task` | Creates a task for work you found that no task tracks. Search with `find_tasks` first. | `title`, `description`, `priority` (p0 to p3), `from_task` | | `ask_blocker` | Asks the person who asked for the task a question you cannot continue without, in the Slack thread the task came from. | a task, `question` (1000 characters) | | `finish_task` | Says how you stop: `ready_for_review` once your pull request is up, `blocked`, or `done` for work that needs no merge. A task an open pull request implements completes when it merges. | a task, `outcome`, `summary` (1000 characters) | ## The banner Six tools can answer with `banner`: `get_task_context`, `start_task`, `link_pull_request`, `propose_task`, `ask_blocker` and `finish_task`. It is three lines of a markdown quote for the agent to open its final response with, before any greeting, heading, summary or other prose, so the person sees what Trinity did: > **▲ Trinity updated** > > **T123 Fix the login form** is now in progress, with a live coding session recorded as its work. A write's banner is finished: copy its three lines exactly, and always show it. A read's third line is an angle-bracketed blank: replace it, brackets included, with one or two sentences on one line, what Trinity surfaced and then what that let you do, saying only what the answer supports. Show the recall banner when you used the read to decide, act on or explain the requested work, including when a write follows. Collect both kinds of banner from the current turn and place them in call order at the start of the final response, with a blank line between. Complete recall banners before deduplicating identical banners. Later calls, errors and answers without banners do not remove earlier banners. Do not append banners after the answer or replay them from a prior turn. A true no-op carries none; re-linking an existing pull request still carries an update banner when it changes task status or assignee. Each banner also carries `banner_instructions` in its answer, repeating the rule beside the text even when a client cached an older tool description. A context read followed by task creation shows recalled before updated, never the reverse. Answers without a banner carry no banner instructions. These are instructions to the agent, not a separate client widget: placement and rendering depend on the client and model. A live coding session is the newest open session the paired device captured in the repository; with concurrent sessions it need not be the conversation making the call. ## Errors - HTTP `401`: no token, or one Trinity does not know. HTTP `403`: the device was revoked. Pair again for either. - A tool error is one line saying why, for example `billing locked: free_access_expired` when the organization's free period has ended. - Each call has 20 seconds.