Cursor
Connect
Connect Cursor from the terminal. Pass --help for the flags Cursor accepts.
polylane integration connect --type cursorAn API key from your Cursor account.
Connect Cursor to let Cursor cloud agents write the fixes that Polylane finds. Polylane investigates the issue and confirms the root cause. A Cursor cloud agent writes the change and opens the pull request on GitHub or the merge request on GitLab. You use your own Cursor account, so your Cursor plan must include Cloud Agent access.
- In Cursor, go to Settings and create an API key. The key starts with
key_. - Make sure that your target repositories are connected to your Cursor account.
- Paste the key into Polylane.
When you connect Cursor, it becomes the executor for every autofix of the workspace. To send autofixes back to Polylane's own agent, turn off Use Cursor for all autofixes on the Cursor integration page in Settings.
On connect, Polylane also creates a workspace API key named cursor-cloud-agent-mcp with read scopes, for its MCP server.
Polylane encrypts the key before it stores it, and the agent never sees it.
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 reports | What to do |
|---|---|
| The repository is not connected to your Cursor account | Connect the repository in Cursor. |
| Cursor refused the launch because of its rate limit | Wait some minutes before you start the fix again. |
| Cursor did not finish in the time limit | Give Cursor a smaller task. |
| Cursor refused the key | Create 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.
polylane integration disconnect <id>