API referenceConsole
code agent
Polylane investigates the issue and hands the fix to Cursor cloud agents, which implement it and open the pull request on GitHub or the merge request on GitLab. Bring your own API key.

Connect

Connect Cursor from the terminal. Pass --help for the flags Cursor accepts.

Terminal
polylane integration connect --type cursor

How it works

Polylane hands the fix to Cursor

When a fix run confirms the root cause of an issue, Polylane writes a brief: the root cause, the change to make, and how to check it. Every brief tells the agent to run the typecheck, the lint and the tests of the repository, and to list each check in the description. A fix from a chat thread also includes the change that Polylane wrote in its sandbox.

Before the launch, Polylane applies the same gates as for its own fixes: the autofix switch, the autofix quota, a fix already in progress, and an open change for the same fix. Then Polylane launches one cloud agent on the base branch of the repository and asks Cursor to open the change when the agent is done. The agent also gets Polylane's MCP server, so it can read issues, the infrastructure graph and observability data while it works.

If Cursor refuses the launch because of its rate limit, Polylane waits 2, 5, 10 and then 20 minutes, and tries again after each wait.

Code hosts

Cursor works with repositories on GitHub and on GitLab. On GitLab, the agent opens a merge request.

The change comes back

Polylane reads the agent every five minutes, for a maximum of six hours. When the agent opens the change, Polylane records it on the autofix and adds a section with its evidence and the history of the fix. Cursor creates the change itself, so the workspace setting for draft pull requests does not apply.

Review comments

When a person comments on the change and asks for an edit, Polylane sends the comment and the discussion to the same Cursor agent. Polylane reads that run every five minutes, for a maximum of two hours, and then posts a comment with the result.

When a run fails

If the run fails, expires, or does not finish in six hours, Polylane's own agent takes the fix and writes it. A run that opened a change always counts as a success. If Cursor refuses the key, Polylane sends one notice and gives new fixes to its own agent until you reconnect or verify the integration.

Polylane's MCP tools

You do not have to set up anything. Polylane adds its MCP server to every Cursor cloud agent that it launches. If Cursor refuses the launch with the MCP server, Polylane launches the agent again without it.

To stop this, set mcpInjectionEnabled: false on the Cursor integration through the integrations PATCH API.

For cloud agents that you launch yourself, add the server in the Cursor dashboard under Integrations & MCP:

  • Transport: Streamable HTTP.
  • URL: https://mcp.polylane.com/mcp.
  • Header: Authorization: Bearer <key>, with an API key from Settings → Coding agents in Polylane.

Troubleshooting

When a Cursor run fails, Polylane's own agent writes the fix. To let Cursor do the next fix, correct the cause:

What Polylane reportsWhat to do
The repository is not connected to your Cursor accountConnect the repository in Cursor.
Cursor refused the launch because of its rate limitWait some minutes before you start the fix again.
Cursor did not finish in the time limitGive Cursor a smaller task.
Cursor refused the keyCreate a new API key and reconnect Cursor.

Disconnecting

Disconnect Cursor in Polylane, then revoke the API key in Cursor. Polylane deletes the cursor-cloud-agent-mcp API key automatically. After you disconnect, Polylane's own agent writes new fixes.

Disconnect

Disconnecting stops every sync and check and deletes the credentials Polylane held. Everything Polylane set up in Cursor is removed as well; nothing is left behind.

Terminal
polylane integration disconnect <id>