zerohead
Get started

Agents

Cursor

Run Cursor's command-line agent as a zerohead agent, with its settings and what zerohead changes in your Cursor settings, though it has not yet run for real.

The source is not public yet. It will be published under MIT. The pages under Contributing describe working on it once it is.

The Cursor adapter starts Cursor's command-line agent, cursor-agent, once for each run.

The Cursor agent has not yet been run against a real Cursor. The adapter was written from Cursor's help text and documentation, and it has only been tested with a test agent. The first real run may need adjusting.

What you install

Install Cursor's command-line agent, cursor-agent, yourself, and sign in to it. Run cursor-agent login once, as the same user that runs zerohead. You can also put CURSOR_API_KEY in the agent's Environment setting. zerohead never reads, copies or changes your sign-in. Nothing of Cursor's is shipped with zerohead.

Settings

Choose Cursor as the Adapter.

SettingWhat it does
CommandA program name or path to run instead of cursor-agent.
ModelThe model to use, for example auto or gpt-5. Empty means the model set in Cursor. It must be on one line and must not start with -.
EnvironmentVariables the program starts with, such as CURSOR_API_KEY. Values are kept private.

There is no sandbox setting.

How it runs

zerohead runs cursor-agent -p --output-format stream-json --force --trust in the run's folder, with --model added when you set a model. The prompt goes in on standard input, and the agent's added instructions come first in it. Standard input is then closed. Each run starts a fresh session.

That the prompt can go in on standard input is an assumption. No page of Cursor's documentation says so. If it is wrong, every run ends with Cursor's own error.

A run succeeds only when Cursor reports a successful result and exits with 0. Anything else fails the run.

How zerohead's tools reach it

Cursor's command-line agent has no option for a settings file of its own, so it reads ~/.cursor/mcp.json in your home folder. zerohead adds one entry named zerohead to that file. The entry holds no secret. It names two environment variables, and each run sets them for itself with the tool endpoint's address and a token that works only while that run lasts.

Here is everything zerohead does to your Cursor settings:

  • It adds that one zerohead entry, once. The rest of the file stays exactly as it was. If the file is not valid JSON, or already has a different zerohead entry, zerohead leaves it alone and the run does not start. The error says what to do.
  • Before each run it asks Cursor to approve that one server, with cursor-agent mcp enable zerohead. Cursor records the approval in its own folder. If the approval fails, the run does not start.

Cursor's own app lists the entry as a server that is not connected. zerohead never passes --approve-mcps, which would start every tool server there is, including a project's own.

What it can do without asking

A run is unattended, so nothing can answer a permission prompt. zerohead runs Cursor with --force, which is Cursor's "Run Everything" mode. The agent runs commands and tools without asking, and Cursor's sandbox is off. zerohead adds no sandbox of its own. A sandboxed mode is not offered.

Tool servers you have already approved in Cursor stay available to the agent, and their tools run without asking. Servers nobody approved are expected not to start. That comes from Cursor's documentation and has not been seen in a real run.

A run is refused when a .cursor/mcp.json in the run's folder or in a folder above it does any of these things:

  • It is not strict JSON, with no comments and no trailing commas. zerohead cannot tell what such a file defines.
  • It defines a server named zerohead, which would take the place of zerohead's own.
  • It mentions a variable that starts with ZEROHEAD_, which could read the run's token.

The error names the file.

Budgets

Cursor's documented output carries no usage and no price. A run that ends without a usage report is charged the budget's margin as an estimate, and an estimate counts like spend. See Budgets and approvals.

Has it run for real?

No. Nothing about the Cursor agent has been observed in a real run. These things rest on Cursor's documentation only: the prompt on standard input, the way the entry in ~/.cursor/mcp.json is read, what mcp enable does, and that unapproved servers do not start. The repository has a Cursor smoke test, which runs only when you ask for it. It spends a little of your Cursor usage, and it adds the zerohead entry to your real ~/.cursor/mcp.json.

zeroheadHomeMIT license