Quickstart: your first MCP tool call
Deploy the reference webhook, bind it, add a GitHub credential with its MCP server, connect Claude Code and watch the tool call and a denial appear in Activity.
At the end of this page Claude Code calls GitHub's MCP tools with your token, and never holds the token. You deploy the server that stores it, so step 2 is a deploy.
| You need | Why |
|---|---|
| A Cloudflare account (free tier) | Runs the reference webhook: a Worker plus a D1 database |
| A GitHub account and a personal access token | The credential. A fine-grained token with read-only access to one repo is enough |
| Claude Code, or another MCP app | Makes the tool call. Tabs below cover seven apps |
| Optional: Node 16+ or Go | Only for the CLI path |
Time: about 15 minutes. The Cloudflare deploy is most of it.
Sign in
Open tokenvault.uk/login. Sign in with Google, email and password, or an email link. The first sign-in creates your account.
With no webhook bound yet you land on Home, which shows a setup prompt. Follow it to the setup wizard. Its steps are Deploy, Enter URL, Connect and Ready; on the Cloudflare Workers path the worker's own /bind page replaces the middle two.
Deploy your webhook
On Deploy, pick Deploy to Cloudflare Workers (recommended) or Self-host.
You get a URL like https://tv-webhook.<your-subdomain>.workers.dev. Check it:
$ curl -s https://tv-webhook.<your-subdomain>.workers.dev/v1/health
{"status":"healthy","version":"…","keyConfigured":true,"capabilities":["store","credential","proxy","refresh",…],…}The seed never leaves your Cloudflare account. The webhook derives its AES-256-GCM key and its HMAC secret from it in memory.
Settle the seed before you bind
If you change TV_WEBHOOK_SEED after binding, the HMAC secret changes and every call fails until you bind again.
Prefer your own machine or cloud? Self-host the webhook. It is the same contract.
Bind it to Token Vault
Binding is one handshake. You never copy a secret by hand.
-
Open your worker's root,
https://tv-webhook.<your-subdomain>.workers.dev/. The page shows Deployed, Seed and Connected to Token Vault: not yet. -
Check the line Binding to:
https://tokenvault.uk. The site you continue to receives a one-time code that completes the key exchange, so confirm it is yours. -
Click Connect to Token Vault. The
/bindpage opens ("Connect this webhook to Token Vault"). Click Connect to Token Vault again. The webhook mints the code and sends your browser to:https://tokenvault.uk/vault/webhook-bind?code=<one-time code>&webhook_url=<base64 url>&hmac_hash=<sha256 of the HMAC secret> -
On Connect Webhook, review the URL, tick I deployed this webhook myself., then click Connect Webhook. The button stays disabled until you tick the box.
Token Vault's backend calls your webhook's POST /v1/exchange with the code, gets the HMAC secret, and checks that its SHA-256 matches hmac_hash. Token Vault now holds your webhook URL and that HMAC secret. It holds no credential and no encryption key. Details: Binding.
Add a credential
Open Credentials and click Add credential (/credentials/new). It is one page with one Save.
| Row | Set it to |
|---|---|
| What | GitHub (the MCP preset chip) |
| Name | github (suggested by the preset; you cannot rename it later) |
| Labels | Leave empty, or work. Labels never grant access |
| Value | Paste your PAT. The row says: Sent from this browser to your webhook at <host>. Token Vault never sees it. |
| MCP servers | The github preset, ticked: https://api.githubcopilot.com/mcp/ with Authorization: Bearer ${TOKEN} |
| Who uses it | Claude Code is ticked. Tick the other apps you use. Each one becomes its own agent with MCP access |
The CLI row shows the same thing as one command. Click Save. The receipt lists each step with its own Retry:
✓ Value on your webhook
✓ MCP server github: <n> tools
✓ Access 1 holder: claude-code (MCP)MCP means the agent can call the MCP server's tools and never gets the value. MCP access defaults to Until revoked. Value access would default to 24 hours.
Connect your app
Open the agent from the receipt (Open claude-code). Its Connect tab prints the exact text for your agent and MCP servers. The entry is named tokenvault-github-github and its URL is the MCP server URL:
https://api.tokenvault.uk/api/mcp/github/githubWhere your Token Vault has the single URL enabled, the tab shows one tokenvault entry (https://api.tokenvault.uk/api/agents/mcp) instead; use that the same way.
claude mcp add --transport http --scope user tokenvault-github-github https://api.tokenvault.uk/api/mcp/github/githubRun /mcp in Claude Code, select the MCP server, press Authenticate. Your browser opens Token Vault: pick claude-code and press Authorize.
From the CLI, tvault connect claude-code github=mcp:github --server github/github runs the same claude mcp add (it names the entry tv-github-github).
The app signs in with OAuth 2.1 and gets a one-hour tvsess_… session for that agent. No key is pasted anywhere. Scripts, CI and the headless option: Connect your apps.
Make the first tool call
Ask Claude Code something only GitHub can answer:
> Who am I on GitHub? Use the GitHub tools.Claude calls the MCP server's get_me tool. This is the request Token Vault receives:
POST /api/mcp/github/github HTTP/1.1
Host: api.tokenvault.uk
Authorization: Bearer tvsess_…
Content-Type: application/json
Accept: application/json, text/event-stream
{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"get_me","arguments":{}}}Token Vault checks the session, the MCP access, the kill switch and your policies. Then it forwards the body to your webhook with a signed ticket and the header template:
{
"ticket": "eyJzdmMiOiJnaXRodWIiLCJwdXIiOiJwcm94eSIs…fQ.4b1d…e09c",
"service": "github",
"upstream": {
"url": "https://api.githubcopilot.com/mcp/",
"method": "POST",
"body": "<base64 of the JSON-RPC body>"
},
"headerTemplates": {
"Authorization": "Bearer ${TOKEN}",
"Accept": "application/json, text/event-stream"
}
}Your webhook verifies the ticket, replaces ${TOKEN} with the stored PAT, calls GitHub, and returns GitHub's response unchanged. Claude Code shows your GitHub login.
See it in Activity
Open Activity (/activity). The newest row is Allowed: claude-code, credential github, MCP server github/github, channel MCP tools. Click it for the drawer. Its footer reads Events hold metadata, never values.
Filter to this MCP server with /activity?server=github/github. Drawer rows include Who, MCP server or tool, Channel, Response and Event type.
Now try to read the value
claude-code holds MCP access, so reading the value must fail. On the agent's Connect tab, Reveal the agent key (the reveal is itself audited), then:
$ curl -i "https://api.tokenvault.uk/api/agents/credentials?service=github" \
-H "Authorization: Bearer tvagent_…"
HTTP/1.1 403 Forbidden
content-type: application/json
{"detail":{"code":"GRANT_TOOLS_ONLY","message":"This grant does not allow reading the credential value; it can only be used through MCP access."}}Token Vault refused before it signed any ticket, so your webhook was never called. In the tvault CLI, logged in with that agent key, tvault get github prints:
denied: access to github allows tool calls only, not reading the value.
hint: add the value use: `tvault grant <agent> github=value`Back in Activity, a Denied row says:
claude-code can use github through MCP but not read the value. Its access allows tool calls only. Reading the value needs the Value use.
Its fix button is Edit access: add Value. Leave it as it is: MCP-only is the point.
What just happened
Every hop, and who saw the PAT:
| # | Hop | What moved | Saw the PAT |
|---|---|---|---|
| 1 | Browser → Token Vault POST /api/vault/store-ticket | {"serviceName":"github"} | No |
| 2 | Token Vault → browser | {"ticket":"…","webhookUrl":"…","expiresIn":60} | No |
| 3 | Browser → webhook POST /v1/store | ticket + tokenData.accessToken | Webhook only (encrypted at rest by the reference webhook) |
| 4 | Browser → Token Vault PUT /api/tokens/github/mcp-servers | MCP server URL + Authorization: Bearer ${TOKEN} (a template, not a value) | No |
| 5 | Claude Code ↔ Token Vault, OAuth | tvsess_… session for claude-code | No |
| 6 | Claude Code → Token Vault POST /api/mcp/github/github | JSON-RPC tools/call | No |
| 7 | Token Vault → webhook POST /v1/proxy | Ticket + body + header templates | No |
| 8 | Webhook → GitHub MCP | Authorization: Bearer ghp_… | Webhook and GitHub |
| 9 | GitHub → webhook → Token Vault → Claude Code | Tool result | No. Token Vault relays the result and does not log it |
| 10 | Agent key → Token Vault GET /api/agents/credentials | Refused: 403 GRANT_TOOLS_ONLY | No ticket was signed |
Token Vault saw names, URLs, templates, tickets it signed and metadata. The token itself only went browser → webhook and webhook → GitHub. Diagrams for every path: How it works.
Next steps
Add a policy
Business hours, a rate limit or a country rule on the github credential, the agent or a label.
Connect more apps
One agent per app, so Activity shows which app did what.
MCP servers
Linear and Sentry presets, custom URLs, header templates, up to five per credential.
Stop all access
One button refuses every agent, key and MCP client.
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.
Token Vault Documentation
Token Vault gives AI agents and MCP clients policy-checked access to your credentials. The credentials stay in storage you control, behind a webhook you run, and Token Vault never keeps one.
Concepts: the Token Vault model
The whole Token Vault model on one page (credentials, MCP servers, agents, access, labels, policies, API keys, Activity and the kill switch) plus what Token Vault holds versus your webhook.