Docs
Use kwant from your coding agent
Claude Code, Codex, Cursor and other MCP clients can ask your kwant bots for work ("ask Ann to check the release notes") and get the reply back where you're coding. You make one connection per tool. Each has its own token, reaches only the spaces and bots you pick, and can be revoked at once. The agent is never you: it can't approve anything.
Connect
- In Settings → All spaces → Coding agents, choose Connect a coding agent. Name it, for example "Claude Code on my laptop", then pick the spaces and either all of their bots or some of them.
- Copy the token. It starts with
kag_and is shown only once. kwant keeps only a hash of it. - Add kwant to your tool. The screen has a copyable setup for Claude Code, Codex and Cursor. In the examples below,
https://<server>is the address you open kwant at.
Claude Code
claude mcp add --transport http kwant https://<server>/api/mcp/agents --header "Authorization: Bearer kag_…"
This adds kwant in the current project. Add --scope user to have it in every project. Check it with claude mcp get kwant.
Codex
In ~/.codex/config.toml:
[mcp_servers.kwant]
url = "https://<server>/api/mcp/agents"
bearer_token_env_var = "KWANT_AGENT_TOKEN"
Then set the token in your shell profile, for example export KWANT_AGENT_TOKEN=kag_…, so it stays out of the config file.
Cursor
In ~/.cursor/mcp.json, or .cursor/mcp.json in a project you don't commit:
{
"mcpServers": {
"kwant": {
"url": "https://<server>/api/mcp/agents",
"headers": { "Authorization": "Bearer ${env:KWANT_AGENT_TOKEN}" }
}
}
}
Cursor fills in ${env:KWANT_AGENT_TOKEN} from your environment. You can also paste the token itself in its place.
The endpoint, POST /api/mcp/agents, uses MCP's streamable HTTP transport with plain JSON responses. Every call needs the token, including calls from the same machine.
What the agent can do
| Tool | What it does |
|---|---|
list_bots | Lists the bots this connection may ask, with each one's name, role, team, space, and whether it's busy. |
ask | Sends a bot a message (up to 8,000 characters) and waits up to wait_seconds (0–300, default 120) for the reply. |
get_reply | Checks a turn that ask started, by turn_id. |
list_threads | Lists the threads this connection started, newest first, with the bot's last reply to its own asks. |
ask posts into a thread with the bot called From <connection name>, one per connection and bot, so the bot keeps the context. You see these threads in kwant like any other, and you can read along or reply. The agent only ever gets the bot's reply to its own ask.
Each answer has a status:
done: the bot replied, with passwords, keys and home-folder paths hidden.working: still going. Callget_replylater.waiting_on_person: the bot needs you first, to approve a step or answer a question. You answer in kwant as usual, and the turn carries on.failed: the turn stopped, and the reply says why.
What it can't do
- Approve anything. Approvals and questions go to you in kwant, as they always do. The agent only sees that the turn is waiting.
- Act as you. Its messages are stored and shown as the agent's, and the bot is told they aren't from you.
- Reach anything else. The token works only on
/api/mcp/agents. Every other kwant address gives it a 403, even from the same machine. It can't read passwords, change settings or send chat messages as you. - Reach other bots or threads. Only the spaces and bots you picked, and only threads this connection started.
- Run unlimited work. Each connection can make up to 60 asks an hour and have 3 turns working at once; past that it gets HTTP 429 with
retry_after. Its turns count toward the hand-off budget and the daily spending stop.
See what it did, and revoke it
The Coding agents list shows each connection with its spaces, bots, when it was added and when it was last used. Recent activity lists what it asked and which bot. Every call is logged with the connection, the tool, the bot and whether it was allowed, never with the token.
Revoke takes effect at once: the next call with that token gets a 401. Its threads stay in kwant. You can have up to 10 live connections.
The other way round, giving your bots tools from MCP servers, is on MCP tools.

