Environment variables
The Quey MCP bridge and auto-runner are configured entirely through environment variables. Set them in your shell, in .env, or directly in .mcp.json under the env key.
Tip
The fastest way to set these is inside your
.mcp.json env block — they're scoped to the project and don't pollute your shell.Auto-runner variables
| Variable | Default | Description |
|---|---|---|
TOOLBAR_AUTO_RUN | 0 | Enable automatic agent execution when a capture arrives. Set to "1" to enable. |
TOOLBAR_CODEX_CWD | — | Absolute path to the repo the agent should edit. Required for auto-run. |
TOOLBAR_CODEX_CMD | codex | Override the command used to invoke Codex. Useful if codex is not on PATH. |
TOOLBAR_CODEX_MODEL | codex-mini-latest | Model passed to Codex. Use a larger model for complex multi-file edits. |
TOOLBAR_CODEX_FULL_AUTO | 1 | Pass --full-auto to Codex, allowing it to edit files without per-write prompts. Set to "0" to disable. |
TOOLBAR_CODEX_USE_SDK | 1 | Use the Codex SDK (warm threads) instead of one-shot CLI runs. Set to "0" to force CLI mode. |
Snapshot modes
Snapshots capture the workspace state so you can roll back after a bad agent run. The mode controls when the snapshot is taken.
| Mode | Description |
|---|---|
full | Snapshot the entire repo before every agent run. Safest. Slowest. Use when you want guaranteed rollback. |
defer | Snapshot after the agent finishes. Faster. Default. The diff still reflects what changed. |
off | No snapshot. You're relying on git. Fastest. Use in CI or when you always commit before running. |
The snapshot mode also adapts automatically based on provider and effort:
- OpenAI / Codex runs with
effort: highalways usefullmode. - All other providers default to
fullunless the global mode isoff. - The global
TOOLBAR_SNAPSHOT_MODEvalue overrides per-run logic when set tofulloroff.
Provider config
| Variable | Default | Description |
|---|---|---|
TOOLBAR_SNAPSHOT_MODE | defer | Controls when the workspace is snapshotted for rollback. See Snapshot modes below. |
TOOLBAR_CODEX_FULL_AUTO | 1 | Pass --full-auto to Codex. Disable for prompted execution (more control, more interruptions). |
Full example
A complete .mcp.json for an auto-running Codex setup with defer snapshots:
.mcp.jsonjson
{
"mcpServers": {
"quey": {
"command": "npx",
"args": ["-y", "@uitoolbar/mcp", "server"],
"env": {
"TOOLBAR_AUTO_RUN": "1",
"TOOLBAR_CODEX_CWD": "/Users/you/projects/myapp",
"TOOLBAR_CODEX_MODEL": "codex-mini-latest",
"TOOLBAR_CODEX_FULL_AUTO": "1",
"TOOLBAR_CODEX_USE_SDK": "1",
"TOOLBAR_SNAPSHOT_MODE": "defer"
}
}
}
}Note
TOOLBAR_CODEX_CWD must be an absolute path. Relative paths will cause the runner to look in the wrong directory.