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

VariableDefaultDescription
TOOLBAR_AUTO_RUN0Enable automatic agent execution when a capture arrives. Set to "1" to enable.
TOOLBAR_CODEX_CWDAbsolute path to the repo the agent should edit. Required for auto-run.
TOOLBAR_CODEX_CMDcodexOverride the command used to invoke Codex. Useful if codex is not on PATH.
TOOLBAR_CODEX_MODELcodex-mini-latestModel passed to Codex. Use a larger model for complex multi-file edits.
TOOLBAR_CODEX_FULL_AUTO1Pass --full-auto to Codex, allowing it to edit files without per-write prompts. Set to "0" to disable.
TOOLBAR_CODEX_USE_SDK1Use 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.

ModeDescription
fullSnapshot the entire repo before every agent run. Safest. Slowest. Use when you want guaranteed rollback.
deferSnapshot after the agent finishes. Faster. Default. The diff still reflects what changed.
offNo 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: high always use full mode.
  • All other providers default to full unless the global mode is off.
  • The global TOOLBAR_SNAPSHOT_MODE value overrides per-run logic when set to full or off.

Provider config

VariableDefaultDescription
TOOLBAR_SNAPSHOT_MODEdeferControls when the workspace is snapshotted for rollback. See Snapshot modes below.
TOOLBAR_CODEX_FULL_AUTO1Pass --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.