Add a credential
Store a credential on your webhook from one page, attach MCP servers, label it and give apps access, then rotate, delete and watch its health.
A credential is a secret that lives on your webhook: an API key, a token, an SSH key, a TOTP seed or a JSON blob. Token Vault keeps only a directory row (name, type, labels, MCP servers). The value goes from your browser or CLI straight to the webhook with a ticket Token Vault signed.
Open Credentials, then Add credential (https://tokenvault.uk/credentials/new). One page, one Save. Nothing leaves the form until you press it.
The Add flow, row by row
| Row | What you set | Default and rules |
|---|---|---|
| What | A preset chip: GitHub, Linear, Sentry (MCP presets), Google (OAuth), GitHub (OAuth), Spotify (OAuth), Plain text, or Other | Default Plain text. A preset suggests a name until you type your own. Other shows a type radio (see Credential types). |
| Name | The service name, for example github or my-api | ^[A-Za-z0-9][A-Za-z0-9._~-]{0,199}$. This name cannot be changed after creation. The Add page reserves new, oauth-return and oauth-result. The API also refuses grants, sessions, mcp, connect, tools, servers, reveal-key, rotate-key, credentials, whoami, bulk, dashboard, dashboard-sim, audit-log and sign-in (any letter case), and any name that starts with __tv_. |
| Labels | Comma or space separated, for example work, ai | Lowercase letters, digits and hyphens (1 to 32 each), max 10. Shows "Policies from these labels apply at once". A label never grants access. |
| Value | The secret itself, fields depend on the type | Text under the field: "Sent from this browser to your webhook at <host>. Token Vault never sees it." Plain text and JWT also offer Paste a value or Connect your OAuth app. |
| MCP servers | MCP servers to attach (Plain text and JWT only) | The preset's MCP server is ticked. Custom URL adds name, URL and headers (default Authorization: Bearer ${TOKEN}). Max 5. See MCP servers. |
| Who uses it | Apps that get access | First run: tick apps (Claude Code is ticked). Later: Access with your agents and keys. |
Who uses it on your first run lists eight apps. Each ticked app becomes its own agent, so Activity shows which app did what.
| App | Agent name created |
|---|---|
| Claude Code | claude-code |
| Claude.ai | claude-ai |
| ChatGPT | chatgpt |
| Cursor | cursor |
| VS Code | vscode |
| Codex | codex |
| Gemini CLI | gemini-cli |
| Script or CI | script |
Once you have agents, the row becomes Access: checkboxes for active agents and keys (first five, then More (n)), a per-holder use chip, and a New agent name field. Each chip reads MCP or Value 24 h. Agents can switch between them when the credential has MCP servers. API keys are fixed to Value. The default is MCP when the credential gets servers, otherwise Value.
Nobody gets access unless you tick them. This matches tvault add without --for. Keys get Value only.
The page shows a live CLI line that mirrors your choices, so you can copy the same action into a script.
Save and the receipt
Press Save. The page runs four steps in order. Each step gets its own row in the receipt, and a failed row gets a Retry button. A later failure never undoes an earlier success.
| Step | What runs | Where the value goes |
|---|---|---|
| Value on your webhook | The browser asks Token Vault for a store ticket, then posts the value to your webhook | Browser to webhook only |
| MCP server | Token Vault saves the MCP server list, then fetches each MCP server's tools through your webhook. The row shows <server>: N tools or the error | Header templates only, never a value |
| Labels | Token Vault saves the label set | Metadata |
| Access | New agents are created, then grants are made. Value grants last 24 h. MCP-only grants never expire | Metadata |
If an MCP grant needs an MCP server that failed, Access waits and shows "skipped: Waiting for the MCP server." Fix the MCP server, press Retry on its row, then retry Access.
What just happened
| Hop | Sees the value? | Carries |
|---|---|---|
Browser or CLI to Token Vault (store-ticket) | No | Service name in, signed ticket out |
Browser or CLI to webhook (/v1/store) | Yes, only here | Ticket, service name, tokenData |
| Browser to Token Vault (labels, MCP servers, grants) | No | Names, header templates, use choices |
Token Vault never holds the value, before, during or after the store. (The one exception on the whole platform is the legacy tv-refresh path, used only for tokens from Token Vault's old built-in OAuth apps and off by default in the reference webhook: Token refresh.) Whether the webhook encrypts at rest is your webhook's choice (the reference webhook does).
The receipt then shows Connect your apps: for each agent it created, the command to run in that app. Press Open <service> to land on the credential page.
| App | Command shown | Then |
|---|---|---|
| Claude Code | claude mcp add --transport http --scope user tokenvault https://api.tokenvault.uk/api/agents/mcp | Run /mcp, press Authenticate, pick the agent. |
| Claude.ai | Settings, Connectors, Add custom connector, paste the URL | Pick the agent and press Authorize. |
| ChatGPT | Settings, Connectors, Create, paste the URL | Pick the agent and press Authorize. |
| Cursor | ~/.cursor/mcp.json with the URL | Cursor opens Token Vault on first use. Pick the agent. |
| VS Code | code --add-mcp '{"name":"tokenvault","type":"http","url":"..."}' | Start the MCP server. It opens Token Vault. Pick the agent. |
| Codex | ~/.codex/config.toml with [mcp_servers.tokenvault] | Run codex mcp login tokenvault, then pick the agent. |
| Gemini CLI | gemini mcp add --transport http tokenvault ... | Run /mcp auth tokenvault, then pick the agent. |
| Script or CI | printf %s "$AGENT_KEY" | tvault login --key-stdin --as ci (or header Authorization: Bearer <agent key>) | No browser. The agent key lives in that machine's config until you rotate it. |
The receipt URL gives an app Token Vault's own tools. Tools from a credential's MCP servers use one URL per MCP server, which the agent's Connect tab lists. See Connect your apps and MCP servers.
Credential types
Plain text and Other map to the API tokenType. Pick the type that matches the shape of the secret.
| Preset or radio | tokenType | Fields on the page | Notes |
|---|---|---|---|
| Plain text | PlainText | Secret value | API keys, PATs. Can carry MCP servers. |
| Other, OAuth (access + refresh) | JWT | Access value, Refresh value, Scopes (placeholder read:user, repo) | The page requires refresh value and scopes. Can carry MCP servers. |
| Other, SSH key | SSHKey | SSH private key, optional Public Key | |
| Other, Certificate | Certificate | PEM, optional Private Key, optional Certificate Chain | |
| Other, 2FA (TOTP) | TOTP | otpauth:// URI or Secret Key (Base32) | See TOTP codes. |
| Other, Raw (JSON, config, connection string) | RawCredential | One text area; a badge shows what it detected | See Raw credentials. |
| Other, Multi-field | Composite | Key and value rows, Add field | Read one field with tvault get name.field. No MCP servers. |
| Google (OAuth), Spotify (OAuth) | JWT | Connect your OAuth app panel | See OAuth apps. |
| GitHub (OAuth) | PlainText | Connect your OAuth app panel |
Each account holds up to 50 credentials.
Connect with your own OAuth app
For Google, GitHub and Spotify, the Value row has a Connect your OAuth app toggle. You register an OAuth app at the provider, keep its secret on your webhook, and the webhook finishes the sign-in. Token Vault sees only the status. Steps and the exact trace are on OAuth apps.
The credential page
Open a credential from Credentials. The address is /credentials/<name>, and ?tab= selects a tab.
| Tab | What it shows |
|---|---|
| Overview | Status, Description, a Reveal credential control (fetched from the webhook, see below), Type, Expiry, Last used, scopes, a live code for TOTP, and the buttons Rotate credential, View activity and Delete credential. |
| MCP servers | The credential's MCP servers: Refetch tools, Edit, Add policy, Remove, the Agent URL to copy, and Add blank MCP server or Add from template. See MCP servers. |
| Access | Who holds access to this credential, with edit and revoke per holder. |
| Limits | Policies on the credential and on each of its MCP servers. See Policies. |
Labels appear above the tabs. Editing them there is the same action as the Labels row.
Reveal credential does not read the value from Token Vault. The browser calls POST /api/vault/credential-ticket with {"serviceName":"github","purpose":"user_reveal"} and gets back a ticket and your webhook URL. It then calls POST <webhook>/v1/credential with {"ticket":"...","service":"github"}. The webhook answers {"token":{...}} straight to the browser.
Rotate a credential
Press Rotate credential on the Overview tab, or open /credentials/new?rotate=<name>.
Re-enter the full credential. It is sent directly to your webhook and replaces everything stored for this service. Fields you leave blank are removed.
The button reads Rotate value. It uses the same store ticket path as the first save. MCP servers, labels and access stay as they are. For an OAuth credential the page offers a sign-in again with your OAuth app instead.
Press Rotate credential, paste the new value, press Rotate value.
Rotating changes the value your webhook holds. It does not change the secret at the provider. Revoke the old secret there too.
Delete a credential
Press Delete credential on the Overview tab.
This permanently removes the credential reference from Token Vault. Your webhook may still hold the credential. Manage it there to fully delete it.
The confirmation says what it does: Token Vault drops the directory row, grants and MCP servers. Remove the stored value on your webhook if you want it gone there. From the CLI: tvault rm github (add --force in scripts).
Refresh and health
Token Vault does not refresh credentials you add here. Your webhook refreshes OAuth credentials on its own timer, using the OAuth app credentials you gave it. Token Vault asks it to refresh (/v1/refresh-notify, reason manual_request) only when you press a manual refresh. The one exception is the legacy tv-refresh path for tokens from Token Vault's old built-in OAuth apps (Token refresh).
| Where | What you see |
|---|---|
| Credentials list | A health chip per credential: Healthy, Expiring (under 24 h left) or Expired. A credential with no expiry is Healthy. |
| Credential page header | Healthy, Expires in 1 h or Expired 2 h ago. |
| Credential page banner | Reconnect needed: this credential's sign-in no longer refreshes. with a Reconnect link to the Add flow. Raised by Token Vault's refresh health, which tracks the legacy path only. |
If the provider revokes the grant, reconnect the credential. Static keys never expire, so they stay Healthy until you rotate them. See Token refresh for the contract.
Next steps
MCP servers
Give an agent access
Connect your apps
Ready to try it?
Sign in with Google or email. Your credentials stay on your own webhook, and the quickstart gets Claude Code making its first MCP tool call in about 15 minutes.
How it works
Sequence diagrams and a who-saw-what table for every Token Vault hot path, from storing a value and fetching it by 307 to MCP tool calls, OAuth sign-in, own-app OAuth connect and denials.
MCP servers
Attach MCP servers to a credential so agents call their tools through your webhook, which injects the credential, and never see the value.