All integrations

Cursor Cloud Agents

Launch and review Cursor Cloud Agents via MCP. Start agents on GitHub repos, follow up with runs, and inspect results and artifacts with an API key.

Manual setup 15 tools

Overview

Connect Cursor Cloud Agents so AI clients can launch cloud agents on your repositories, send follow-up prompts, and review run status, results, and artifacts through the Cloud Agents API.

stackgate.ai stores your Cursor API key encrypted and calls https://api.cursor.com on your behalf. Tool results are returned to your AI client for that request.

Automations (schedules, GitHub/Slack triggers, permission scopes) are configured in the Cursor Automations dashboard. This integration covers launching and reviewing cloud agents via the public API - not creating or enabling Automations definitions.

Prerequisites

  • A Cursor account with Cloud Agents access
  • GitHub connected in Cursor for repo-backed agents
  • A stackgate.ai account

Getting credentials

  1. Sign in to Cursor and open Dashboard → API Keys.
  2. Create a user API key or a service account key. Copy it once (often prefixed with crsr_).
  3. In stackgate.ai, open My Integrations → Cursor Cloud Agents, paste the API key, and click Connect & enable.
  4. Optionally set a default environment name (a named Cursor-hosted cloud environment from your Cloud Agents dashboard). When set, create_agent can use that environment if you omit repo_url.

Treat the key like a password. Revoke or rotate it in Cursor if it is exposed.

Using with AI clients

  • Dedicated endpoint: POST /mcp/cursor with a Sanctum bearer token
  • Private gateway: one config for all integrations - use cursor__* namespaced tools

See Documentation for HTTP authentication and private gateway setup.

Suggested workflow

  1. get_api_key_info / list_models - confirm the key and pick a model if needed.
  2. list_agents / get_agent - find existing agents.
  3. create_agent with prompt_text and repo_url (or rely on default_environment / environment_name).
  4. get_run - poll until FINISHED / ERROR / CANCELLED / EXPIRED; read result and git.
  5. create_run for follow-ups; cancel_run if stuck busy.
  6. list_artifacts / download_artifact for walkthrough files; archive_agent when done.

Troubleshooting

  • 422 integration not configured - paste a Cursor API key in My Integrations.
  • 401 Unauthorized - regenerate the key under Dashboard → API Keys and update My Integrations.
  • Provide repo_url or environment - create_agent does not support no-repo agents. Pass repo_url, or set default_environment / pass environment_name. Named environments and explicit repos are mutually exclusive upstream.
  • 409 agent_busy - wait for the active run or call cancel_run, then create_run again.
  • 429 Too many requests - Cursor enforces team rate limits; wait and retry. Avoid polling list_repositories (about 1/min and 30/hour per user).
  • Automations management - enable/disable triggers and permission scopes in the Cursor UI; this MCP does not expose an Automations control API.

Available tools

  • get_api_key_info

    Get metadata for the connected Cursor API key (name, user email when user-scoped).

  • list_models

    List recommended models and parameters for create_agent model.id / model.params.

  • list_agents

    List Cursor cloud agents for the connected account, newest first.

  • get_agent

    Get durable metadata for a Cursor cloud agent. Use latestRunId with get_run for execution status.

  • create_agent

    Create a Cursor cloud agent and enqueue its initial run. Provide repo_url for a GitHub repository, or environment_name for a named Cursor cloud environment (defaults from My Integrations). Named environments and explicit repos are mutually exclusive. No-repo agents are not supported.

  • list_runs

    List runs for a Cursor cloud agent, newest first.

  • get_run

    Get status and (for terminal runs) result text, duration, and git branches/PRs for a run. Primary tool for reviewing agent progress.

  • create_run

    Send a follow-up prompt to an existing active agent. Returns 409 if another run is already CREATING or RUNNING.

  • cancel_run

    Cancel the active run for an agent. Cancellation is terminal; create a new run to continue.

  • archive_agent

    Archive a Cursor cloud agent. Archived agents remain readable but cannot accept new runs until unarchived.

  • unarchive_agent

    Unarchive a Cursor cloud agent so it can accept new runs again.

  • get_agent_usage

    Get token usage for an agent, optionally scoped to a single run.

  • list_artifacts

    List artifacts produced by a Cursor cloud agent (paths relative to artifacts/).

  • download_artifact

    Get a temporary presigned URL to download an agent artifact. Pass the path from list_artifacts.

  • list_repositories

    List GitHub repositories accessible via Cursor GitHub App installation. Very strict rate limits (about 1 request per user per minute and 30 per hour) - do not poll.

MCP endpoint: https://stackgate.ai/mcp/cursor (HTTP) or via the private gateway.