Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Cursor

Scalekit connector
Open markdown

The Cursor connector lets your AI agent act in each user's Cursor account. Each user connects their own Cursor access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 24 tools.

Tools
24
What they doRead · write · destructive
19 · 5 · 019 read5 write0 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Cursor connection

    In AgentKit > Connections, create a Cursor connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'cursor'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Cursor:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'cursor_agents_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Cursor credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • cursor_agent_getGet one Cursor Cloud Agent by ID.Read-only

    Get Agent

    Get one Cursor Cloud Agent by ID. Returns the agent's id, name, status (ACTIVE or ARCHIVED), env, dashboard url, latestRunId, repos, and branch and pull request settings. Use this for an agent's configuration. Use cursor_run_get for the status and result of its work, which live on runs.

    Inputs

    agent_idstringrequired
    ID of the Cloud Agent, in bc-<uuid> form. Get it from cursor_agents_list or from the agent object that cursor_agent_create returns. Example: bc-00000000-0000-0000-0000-000000000001
  • cursor_agent_usage_getGet token usage for a Cursor Cloud Agent, in total and per run, or for one run only.Read-only

    Get Agent Usage

    Get token usage for a Cursor Cloud Agent, in total and per run, or for one run only. Returns totalUsage and a runs list, each with input, output, cache-write, cache-read and total token counts. Use this to report what an agent consumed. This endpoint is in early access; accounts without it get 403 feature_unavailable.

    Inputs

    agent_idstringrequired
    ID of the Cloud Agent, in bc-<uuid> form. Get it from cursor_agents_list or from the agent object that cursor_agent_create returns. Example: bc-00000000-0000-0000-0000-000000000001
    run_idstring
    Optional run ID, in run-<uuid> form, to scope usage to a single run. Omit it to get usage for every run on the agent. An unknown run ID returns 404 run_not_found. Example: run-00000000-0000-0000-0000-000000000001
  • cursor_agents_listList the Cursor Cloud Agents owned by the API key's user, newest first, optionally filtered to one GitHub pull request.Read-only

    List Agents

    List the Cursor Cloud Agents owned by the API key's user, newest first, optionally filtered to one GitHub pull request. Returns a page of agents (id, name, status ACTIVE or ARCHIVED, env, url, latestRunId, timestamps) and a nextCursor for the next page. Use this to find an agent ID. Use cursor_agent_get for one agent's repos and PR settings, and cursor_runs_list for its runs.

    Inputs

    cursorstring
    Pagination cursor. Pass the nextCursor value from the previous response to fetch the next page; omit it for the first page. A null nextCursor means there are no more pages. Example: eyJvZmZzZXQiOjIwfQ
    include_archivedboolean
    Whether to include archived agents in the results. Defaults to true. Example: falsedefault true
    limitinteger
    Maximum number of agents to return in one page, from 1 to 100. Defaults to 20. Example: 10default 20
    pr_urlstring
    Only return agents working on this GitHub pull request URL. Example: https://github.com/your-org/your-repo/pull/123
  • cursor_artifact_download_url_getGet a temporary download link for one file a Cursor Cloud Agent produced.Read-only

    Get Artifact Download URL

    Get a temporary download link for one file a Cursor Cloud Agent produced. Returns a presigned url that stays valid for 15 minutes and its expiresAt time; it does not return the file contents. Use this after cursor_artifacts_list, passing an artifact path it returned.

    Inputs

    agent_idstringrequired
    ID of the Cloud Agent, in bc-<uuid> form. Get it from cursor_agents_list or from the agent object that cursor_agent_create returns. Example: bc-00000000-0000-0000-0000-000000000001
    pathstringrequired
    Path of the artifact relative to the workspace's artifacts/ directory, exactly as returned in the path field of cursor_artifacts_list. Example: artifacts/screenshot.png
  • cursor_artifacts_listList the files a Cursor Cloud Agent saved to its workspace's artifacts/ directory, such as screenshots, logs or reports.Read-only

    List Artifacts

    List the files a Cursor Cloud Agent saved to its workspace's artifacts/ directory, such as screenshots, logs or reports. Returns each artifact's path (relative to artifacts/), sizeBytes, and updatedAt. Use this to find an artifact path, then call cursor_artifact_download_url_get to get a link to the file.

    Inputs

    agent_idstringrequired
    ID of the Cloud Agent, in bc-<uuid> form. Get it from cursor_agents_list or from the agent object that cursor_agent_create returns. Example: bc-00000000-0000-0000-0000-000000000001
  • cursor_environment_active_build_getGet what a new agent started on a saved Cursor cloud agent environment boots from: one of the environment's builds or Cursor's default image.Read-only

    Get Active Environment Build

    Get what a new agent started on a saved Cursor cloud agent environment boots from: one of the environment's builds or Cursor's default image. Returns type 'build' with the buildId, or type 'universal_image' when agents start on the default image. Use this to confirm which build new agents use. Use cursor_environment_build_get with the buildId for that build's details.

    Inputs

    environment_idstringrequired
    UUID of the saved cloud agent environment. Get it from cursor_environments_list. An environment that doesn't exist or isn't visible to the API key returns 404 environment_not_found. Example: 8f14e45f-ceea-4e6b-9c3a-1d2e3f4a5b6c
  • cursor_environment_build_getGet one build of a saved Cursor cloud agent environment.Read-only

    Get Environment Build

    Get one build of a saved Cursor cloud agent environment. Returns the build's id, environmentId, status, trigger, draft flag, failure details if it failed, and created, updated and completed times. Use this to check a specific build from cursor_environment_builds_list. A build ID that does not belong to the environment returns 404 build_not_found.

    Inputs

    build_idstringrequired
    ID of the build, in bld-YYYYMMDD-<uuid> form, as returned by cursor_environment_builds_list or cursor_environment_active_build_get. Example: bld-20260930-3c59dc04-8a1d-4b6e-9f2a-7e5d1c0b9a8f
    environment_idstringrequired
    UUID of the saved cloud agent environment. Get it from cursor_environments_list. An environment that doesn't exist or isn't visible to the API key returns 404 environment_not_found. Example: 8f14e45f-ceea-4e6b-9c3a-1d2e3f4a5b6c
  • cursor_environment_builds_listList the builds of a saved Cursor cloud agent environment, newest first, up to 10 per page.Read-only

    List Environment Builds

    List the builds of a saved Cursor cloud agent environment, newest first, up to 10 per page. Returns each build's id, status (IN_PROGRESS, SUCCEEDED, FAILED, CANCELLED or SKIPPED), trigger (RECURRING, CONFIG_CHANGE or MANUAL), draft flag, failure details, and timestamps, plus a nextCursor. Use this to check whether an environment built successfully. Use cursor_environment_active_build_get to see which build new agents boot from.

    Inputs

    environment_idstringrequired
    UUID of the saved cloud agent environment. Get it from cursor_environments_list. An environment that doesn't exist or isn't visible to the API key returns 404 environment_not_found. Example: 8f14e45f-ceea-4e6b-9c3a-1d2e3f4a5b6c
    cursorstring
    Pagination cursor. Pass the nextCursor value from the previous response to fetch the next page of up to 10 builds; omit it for the first page. Example: eyJvZmZzZXQiOjEwfQ