Run the server

Rotate the token

Replace the MCP token or the trigger token after a leak or when someone who held it should lose it, restart Kraft and check the new files.

$KRAFT_HOME/run/mcp-token and $KRAFT_HOME/run/trigger-token stay the same until you delete them. The commands below follow KRAFT_RUN_DIR when it is set, and kraft admin doctor prints each token's path. The bearer token says what each one grants. A server accepts the old value until it restarts.

Rotate it

  1. Pause any active item that runs in place. A restart ends their agents, and once the mcp-token is gone a server bound off loopback refuses the kraft CLI, so kraft admin restart can't list them.
  2. Delete the file you are rotating, or both. Run only the lines you need:
    rm "${KRAFT_RUN_DIR:-${KRAFT_HOME:-$HOME/.kraft}/run}/trigger-token"
    rm "${KRAFT_RUN_DIR:-${KRAFT_HOME:-$HOME/.kraft}/run}/mcp-token"
    
  3. Restart Kraft. Kraft writes a new token on start, with mode 0600.
  4. Resume the items you paused: kraft item resume ID.
  5. Put the new trigger-token wherever its sender lives, such as a CI secret or a webhook. The kraft CLI and the MCP server on this machine read the mcp-token file on every call, so they need no setup. A console on another machine doesn't hold the mcp-token: it signs in with the password, and rotating the token doesn't touch its session. To end a session, sign it out in the web UI or change the password.

Check it worked

You know it worked when the file's modification time is the time of the restart:

ls -l "${KRAFT_RUN_DIR:-${KRAFT_HOME:-$HOME/.kraft}/run}/trigger-token"
ls -l "${KRAFT_RUN_DIR:-${KRAFT_HOME:-$HOME/.kraft}/run}/mcp-token"

A file you failed to delete keeps its old time. kraft admin doctor also shows the mcp token and trigger token rows with the file's path and mode 0600.

Next steps

Copyright © 2026