Authorization header. The setup CLI handles this for you, it authenticates your account via OAuth, provisions a new key, and writes it directly into your host’s MCP config so you never have to paste anything manually.
How the setup CLI provisions your key
When you runnpx --yes @synsci/thesis setup, the CLI:
- Opens your browser to the Thesis OAuth login page (or uses device-code flow on headless machines).
- After login, provisions a new Thesis API key scoped to your account.
- Writes the key automatically into the MCP server entry for each detected host config.
thk_* prefix and is only shown once during provisioning. The setup CLI captures and stores it for you, so no manual copy-paste is required.
Authorization header format
All MCP tool calls authenticate with the key as a Bearer token:Get a key manually
If you need to retrieve an existing key or generate a new one without running setup, go to Settings → API Keys in the Thesis web app. From there you can view active keys, create new ones, and revoke any key you no longer need. For web-based hosts such as Claude.ai and ChatGPT.com, copy your key from Settings and paste it when the host prompts for API credentials.Provision credentials for shell-based workflows
For workflows that drive Thesis through bash subcommands rather than MCP tool calls, the scripts readTHESIS_API_TOKEN and THESIS_MCP_URL from ~/.config/thesis/env. Provision that file with:
<KEY> with a key from Settings → API Keys. The setup writes the env file once, and the shell scripts source it automatically on every invocation.
The
--cli flag writes only the env file. It does not modify any agent host MCP config. Run it in addition to the standard setup command if you want both MCP and shell workflows working.Troubleshooting
Authentication timed out during setup
Authentication timed out during setup
The OAuth browser flow has a short expiry window. If it times out before you complete login, re-run the setup command to start a fresh authentication flow:
Port conflict prevents the local callback server from starting
Port conflict prevents the local callback server from starting
The CLI starts a temporary local server to receive the OAuth callback. If another process is using that port, the callback fails. Switch to device-code authentication to bypass the local server entirely:
MCP calls return 401 Unauthorized
MCP calls return 401 Unauthorized