Token VaultDocs
Agents and Apps

Connect your apps

Exact commands and config to connect Claude Code, Claude.ai, ChatGPT, Cursor, VS Code, Codex, Gemini CLI or a script to Token Vault.

Every app gets its own agent and connects to one or more MCP URLs. The agent page, Connect tab, prints the exact text below for your agent and your MCP servers. This page shows the same strings.

Which URL

URLGives the appWorks
https://api.tokenvault.uk/api/mcp/{service}/{server}The tools of one MCP server on a credential.Everywhere. This is the main path.
https://api.tokenvault.uk/api/agents/mcpToken Vault's own tools (list_credentials, get_credential, whoami, show_credential, credential_history).Everywhere.
Same /api/agents/mcp URLAlso the tools of every MCP server the agent holds MCP access on.Only where your Token Vault has the single-URL option enabled.

Add one entry per MCP server. The Connect tab names them tokenvault (own tools) and tokenvault-<service>-<server>. Below, N is the entry name and U the URL. Where your Token Vault has the single URL enabled, the tab shows one tokenvault entry instead. Examples use a GitHub MCP server:

N = tokenvault-github-github
U = https://api.tokenvault.uk/api/mcp/github/github

The app needs MCP access on that credential. The agent needs no other switch.

A Token Vault sign-in MCP server is always connected by its own URL, even where the single URL is on.

Best practice: one agent per app

Activity then shows which app did what, and you can stop one app without the others.

Connect

claude mcp add --transport http --scope user tokenvault https://api.tokenvault.uk/api/agents/mcp
claude mcp add --transport http --scope user tokenvault-github-github https://api.tokenvault.uk/api/mcp/github/github

Run /mcp in Claude Code, press Authenticate, pick the agent.

Or let the CLI do the grant and the registration (see tvault connect):

tvault connect claude-code github=mcp:github --server github/github

Headless? Use the agent key instead of OAuth: append --header "Authorization: Bearer <your agent key>". The key then lives in that config until you rotate it, and there is no browser step.

The agent key is sent as an Authorization header, never in the URL.

What the app sees

After sign-in the app lists tools. Names depend on the setup: per-MCP-server entries expose the upstream tool names as they are; the single URL prefixes them as {toolPrefix}__{tool} (one MCP server) or {toolPrefix}_{server}__{tool} (several).

If an agent holds no MCP access, the Connect tab says "This agent has no MCP access, so it sees no MCP server tools" and the app sees only Token Vault's five tools.

What just happened

Loading diagram...

Token Vault checked who you are and what you may do. The webhook put the token into the request. The app never held it, and Token Vault never saw it.

tvault connect

tvault connect claude-code github=mcp:github --server github/github --yes

It creates the agent if needed, applies the grant, then runs claude mcp add --transport http --scope user tokenvault-github-github <url> (name from --name). It never prints the agent key. Claude Code only. Flags: --server <service>/<server> (an MCP server), --name, --print (print the command, run nothing), --no-claude, --yes. Requires tvault 0.14.0 or later.

Hosted clients

Claude.ai, ChatGPT and other hosted clients run in the cloud, so they cannot read a local config or send a custom header. They use OAuth: you paste the URL, the app sends you to Token Vault, you pick the agent and press Authorize.

  1. Add the URL in the app (tabs above).
  2. If the app's redirect host is not trusted yet, Token Vault refuses with a message naming the host. Add it under Settings > Trusted hosts, then retry. See Trusted hosts.
  3. Pick the agent and press Authorize.

An app that still uses an old MCP connection URL (/api/proxy/{id}/mcp, or an mcp_ key) keeps working for now. Move it to the MCP server URL. See Old MCP connection URLs.

Manage or end these sessions on the agent page, Connect tab, Sessions.

Next steps

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.

On this page