Cursor icon

Cursor

Interact with the Cursor REST API to spawn and manage AI coding agents

Actions13

Agent → Create

AI-generated

Summary

Create a new persistent AI agent configured for a specified GitHub repository and model, with optional automatic pull request creation and custom agent naming.

Inputs

  • Model — The model ID to use for the agent (default is 'composer-2', e.g., 'composer-2' or 'auto').
  • Repository URL (required) — The GitHub repository URL associated with the cloud agent.
  • Auto-Create PR — Whether to automatically create a pull request for the agent changes (boolean, default false).
  • Agent Name — An optional name to assign to the new agent.

Output shape

a single JSON object containing the agent details including its ID and full metadata returned from the API

The response includes the newly created agent's ID and additional metadata fields returned by the Cursor API's /v1/agents POST endpoint.

Examples

Example 1: Creating a persistent agent for a GitHub repo

Set the 'Repository URL' to the target GitHub repository, optionally specify 'Model' and 'Agent Name', and toggle 'Auto-Create PR' if a pull request should be opened automatically.

Links

Discussion