For forward deployed work
Per-user tokens for an MCP server
Switch between each user's own token and one shared service account, call the tools, and read the audit log.
From my work on Hive Mind
get_price
Latest price for a ticker. Needs prices:read.
Runs
It runs with Trader's own permissions.
get_positions
The desk's open positions. Needs positions:read.
Runs
It runs with Trader's own permissions.
search_research
Search internal research notes. Needs research:read.
Denied
Trader has no research:read scope, so the server refuses the call.
place_order
Send an order to the market. Needs orders:write.
Waits for approval
It changes state, so it waits for a person to approve it.
Audit log
Call a tool to write the first entry.
How the client gets a per-user token (OAuth 2.1 with PKCE)
- The client makes a random code_verifier and sends only its SHA-256 hash (the code_challenge).
- The user signs in with the company's SSO and agrees to the scopes the client asked for.
- The identity provider redirects back with a one-time authorization code.
- The client swaps the code plus the original code_verifier for an access token. A stolen code is useless without the verifier.
- The token names the user, carries only their scopes and expires in 15 minutes. The MCP server checks it on every tool call.