Skip to content

Document MCP API token authentication#537

Draft
samgutentag wants to merge 3 commits intomainfrom
sam-gutentag/mcp-api-token-auth
Draft

Document MCP API token authentication#537
samgutentag wants to merge 3 commits intomainfrom
sam-gutentag/mcp-api-token-auth

Conversation

@samgutentag
Copy link
Copy Markdown
Member

Documents API token authentication as an alternative to OAuth for the Trunk MCP server (shipped in v148, trunk-io/trunk2#3381).

Changes

  • Updated MCP server overview with both auth methods explained
  • Added API token config examples to all four client pages (Claude Code, Cursor, Gemini CLI, GitHub Copilot)

What's documented

  • OAuth remains default; API token for CI/headless environments or clients without OAuth support
  • Bearer token header configuration per client
  • Where to find the API token in the Trunk app

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

samgutentag and others added 3 commits April 9, 2026 10:59
Documents API token auth as an alternative to OAuth for the Trunk MCP
server. Useful for CI/headless environments and clients that don't
support OAuth. Source: trunk-io/trunk2#3381

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documents API token auth as an alternative to OAuth for the Trunk MCP
server. Covers the README overview and all four client config pages
(Claude Code, Cursor, GitHub Copilot, Gemini). Shipped in trunk2 v148 (#3381).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
https://claude.ai/code/session_01U4k4g3jSvW8Nu7LiCMtPNk
… examples

Resolves merge conflict with remote branch. Improves README authorization
section with OAuth spec link and org-level attribution note. Adds dedicated
API token sections to all four client config pages (Claude Code, Cursor,
GitHub Copilot, Gemini) with env var interpolation examples. Shipped in
trunk2 v148 (#3381).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
https://claude.ai/code/session_01U4k4g3jSvW8Nu7LiCMtPNk
@trunk-staging-io
Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 10, 2026

Claude finished @samgutentag's task in 2m 3s —— View job


PR Review

  • Gather context and read changed files
  • Review for typos, grammar, and formatting issues
  • Review for documentation best practices
  • Post final review

Summary

This PR is well-structured and accurately documents the API token authentication option across the overview page and all four client-specific pages. No blocking issues found.

What's good

  • Section headers are consistently renamed from ### Authentication### Authentication with OAuth (default) across all four client pages — clear and parallel structure.
  • VS Code's ${env:TRUNK_API_TOKEN} syntax is correctly distinguished from the ${TRUNK_API_TOKEN} used by other clients, with a helpful {% hint %} note explaining the difference.
  • Gemini CLI's "httpUrl" key is correctly used in its client-specific page (different from "url" used by others).
  • The PR also fixes a pre-existing copy/paste error in github-copilot-ide.md where the auth section incorrectly referred to "Cursor" instead of "GitHub Copilot".

Minor suggestions (non-blocking)

README.md generic JSON example — See inline comment. The overview's API token example uses "url", which works for most clients but not Gemini CLI (which needs "httpUrl"). A small note pointing readers to client-specific pages for the exact key would prevent confusion.

Pre-existing typos (not introduced by this PR, worth a follow-up):

  • cursor-ide.md:47: "follow insturctions" → "follow instructions"
  • github-copilot-ide.md:62: "follow insturctions" → "follow instructions"

Org-level caveat visibility — The README mentions "API token auth is org-level — all requests are attributed to the organization rather than to a specific user", but this isn't repeated on the per-client pages. Users who navigate directly to a client page won't see this important note. Consider adding a short callout or linking back to the overview.


Overall: no blocking issues. The documentation is accurate, consistent, and follows the existing patterns in the repo.

{
"mcpServers": {
"trunk": {
"url": "https://mcp.trunk.io/mcp",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: this generic example uses "url" which is correct for Claude Code, Cursor, and GitHub Copilot — but Gemini CLI requires "httpUrl" instead. Consider adding a note that the exact config key varies by client, with a pointer to the client-specific pages.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: Claude code review passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants