Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.35 KB

File metadata and controls

42 lines (31 loc) · 1.35 KB

Cursor Background Agents API — mapping

This server is a thin wrapper over Cursor's REST API. Base URL: https://api.cursor.com. All requests send Authorization: Bearer $CURSOR_API_KEY and Content-Type: application/json.

Endpoints track Cursor's official documentation (https://cursor.com/docs → Background Agent → API). If Cursor changes the API, update src/cursor.js.

Agent management

cursor_launch_agentPOST /v0/agents

Request body:

{
  "prompt": { "text": "<task>" },
  "source": { "repository": "https://github.com/owner/repo", "ref": "main" },
  "model": "<optional model>",
  "target": { "branchName": "<optional>", "autoCreatePr": false }
}

Response includes id, name, status, source, target, createdAt.

cursor_add_followupPOST /v0/agents/{id}/followup

{ "prompt": { "text": "<follow-up>" } }

cursor_delete_agentDELETE /v0/agents/{id}

Agent information

cursor_get_agentGET /v0/agents/{id}

cursor_list_agentsGET /v0/agents?limit={n}

cursor_agent_conversationGET /v0/agents/{id}/conversation

General

cursor_list_modelsGET /v0/models

cursor_list_repositoriesGET /v0/repositories

Errors

Non-2xx responses are surfaced as Cursor API <status> <statusText>: <body> so the calling agent can react.