Skip to main content
TagManifest /Docs Dashboard

Authentication

Bearer-token auth. Three kinds of token are accepted - an API key, an MCP access token from the OAuth flow, and the account page's session token.

On this page 6

API requests carry a bearer token in the Authorization header. The same header works on the REST API and on the MCP endpoint.

A few requests need no token: a CORS preflight (OPTIONS), GET /mcp (it returns the server name and protocol version), and the MCP handshake messages initialize, notifications/initialized and ping when they are sent with no Authorization header.

HEADERAuthorization: Bearer <token>

Token kinds

TagManifest accepts three kinds of token.

TokenWho issues itLifetimeUsed for
API key (tm_…)You, on the account pageUntil you revoke itREST calls, and MCP clients that take a header in their config
MCP access tokenTagManifest's own OAuth server, at /oauth/token1 hour, then refreshedMCP clients that sign in through the browser, such as Claude.ai
Account session tokenThe Google sign-in on the account pageManaged by the account pageCreating, listing and revoking API keys

Most integrations need only an API key.

API key

  1. Sign in on the account page and create a key. An account can hold up to five active keys.
  2. Copy the plaintext key. It is shown once and is not stored.
  3. Keep it in TM_API_KEY or in your client's MCP config.
  4. Send Authorization: Bearer tm_… on every request.

Keys are 51 characters: tm_ followed by 48 hex characters (24 random bytes). The backend stores a SHA-256 hash, so a lost key cannot be recovered. Revoke it and create a new one.

MCP access token

MCP clients that support OAuth get their token from TagManifest's own OAuth 2.1 server. The client registers itself, sends the user through Google sign-in and a consent screen, and receives a short-lived access token plus a refresh token. It renews the access token at POST /oauth/token.

The client does all of this for you. The full flow, for anyone writing their own MCP client, is on the OAuth flow page.

An MCP access token carries the scopes the user approved. It also works on the REST endpoints, within those scopes.

Account session token

The account page signs you in with Google and holds a session token in the browser. That token is what the page sends to /v1/api-keys to create, list and revoke keys.

Its job is key management, and the account page handles it for you: manage keys on the page. The token carries both scopes, so the scan and rule endpoints and the MCP endpoint accept it too. Do not build on that. It belongs to the browser session and its lifetime is managed by the account page. API keys and MCP sign-in are the supported ways in.

API keys and MCP access tokens can't manage API keys. The /v1/api-keys endpoints accept only the account session token. An API key, or a valid MCP access token, gets a 403. A token that is expired or not recognised gets a 401. A leaked key, or a token held by an MCP client, cannot create more keys.

Scopes

ScopeAllows
mcp:readGET /v1/rules, GET /v1/rules-detail, and the tools list_rules, get_rule, account_status
mcp:toolsEverything in mcp:read, plus POST /v1/scan-url, POST /v1/scan, POST /v1/evaluate-rule and the tools scan_url, scan_container, evaluate_rule, get_health_score, compare_containers

API keys and account session tokens carry both scopes. An MCP access token carries what the user approved at sign-in.

Authentication errors

Auth failures return HTTP 401, or 403 for a token that is valid but not allowed. The body is JSON with an error string.

StatuserrorCause
401Missing or malformed Authorization headerNo Authorization header, or it does not start with Bearer .
401Invalid or revoked API keyA tm_ key that is unknown or revoked.
401Invalid or expired tokenAn MCP access token or session token that is malformed, expired or not recognised.
403insufficient_scopeAn MCP access token without the scope the endpoint needs. A message field names the scope.
403API keys cannot manage API keys — use a session JWTAn API key sent to /v1/api-keys.
403MCP access tokens cannot manage API keys — use a session JWTAn MCP access token sent to /v1/api-keys.

On the MCP endpoint a 401 also carries a WWW-Authenticate header that points the client at the OAuth metadata, so it can sign in again. See Errors for the full list.

Examples

Header
# API key (servers, scripts, MCP clients with a config file)
Authorization: Bearer tm_a1b2c3d4e5f6789a…

# MCP access token (issued by the OAuth flow)
Authorization: Bearer eyJhbGciOiJIUzI1NiIs…