@kentcdodds/cursor
by @kentcdodds
Cursor API SDK for cloud agents, runs, artifacts, workers, models, repositories, and raw requests.
- cursor
- cloud-agents
- api
- sdk
- automation
- License
- MIT
- Published
- 7/9/2026
- Pinned commit
8cc04f3- Rating
- No ratings yet
- Adaptation effort
- —
- Forks
- 0
Fork with your agent
Copy this prompt into your MCP-capable agent to fork and adapt the package safely.
Use Kody to fork the community package "@kentcdodds/cursor" (listing id: 705c35a0-c67e-4bbb-b31d-09c7c7a486b5). Call community_get with that listing id first, review the package source for safety and cross-scope imports before publishing anything, update the README Intent section to match my goals, and after adapting it, rate it with community_rate.
README
# @kentcdodds/cursor
## Intent
Clean SDK for the [Cursor Cloud Agents API v1](https://cursor.com/docs/api). Domain-organized named exports cover agents, runs, artifacts, workers, models, repositories, and API-key metadata. Use `./request` as an escape hatch for any `api.cursor.com` path — including Enterprise-only Admin, Analytics, AI-Code-Tracking, and Bugbot APIs not wrapped here.
## When To Use
- Launch or manage Cursor Cloud Agents programmatically (create, list, follow-up runs, artifacts).
- Inspect fleet/worker utilization for self-hosted pools.
- Discover models and accessible GitHub repositories before creating agents.
- Call unwrapped Cursor API endpoints via the raw `cursorRequest` helper.
## Required setup
- **Secret** `cursorCloudAuthorizationHeader` (user scope): the full `Authorization` header value used verbatim against `api.cursor.com` (e.g. `Bearer <key>`). Mint keys at [cursor.com/dashboard → API Keys](https://cursor.com/dashboard).
- **Optional** `githubPersonalAccessToken`: required only for `agentsWithOpenGithubPrs` (GitHub PR enrichment).
## Exports
| Export | Description |
|--------|-------------|
| `.` | Package overview and domain map |
| `./request` | `cursorRequest` — raw API escape hatch |
| `./agents` | `createAgent`, `listAgents`, `getAgent`, `archiveAgent`, `unarchiveAgent`, `deleteAgent`, `agentStatusOverview`, `agentsWithOpenGithubPrs` |
| `./runs` | `createRun`, `listRuns`, `getRun`, `cancelRun`, `getAgentUsage`, `readRunStream` |
| `./artifacts` | `listArtifacts`, `downloadArtifact` |
| `./workers` | `listWorkers`, `getFleetSummary`, `getWorker`, `listPendingPoolRequests`, `createWorkerToken` |
| `./models` | `listModels` |
| `./repositories` | `listRepositories` |
| `./me` | `apiKeyInfo` |
Default exports: `./request` → `cursorRequest`; `./agents` → `listAgents`; `./runs` → `listRuns`; `./artifacts` → `listArtifacts`; `./workers` → `getFleetSummary`; `./models` → `listModels`; `./repositories` → `listRepositories`; `./me` → `apiKeyInfo`.
## Example
```ts
import { createAgent } from 'kody:@kentcdodds/cursor/agents'
import { createRun } from 'kody:@kentcdodds/cursor/runs'
const { agent } = await createAgent({
prompt: 'Add a README with setup instructions',
repository: 'https://github.com/your-org/your-repo',
ref: 'main',
autoCreatePR: true,
})
const { run } = await createRun({
agentId: agent.id,
prompt: 'Also add a troubleshooting section',
})
```
Enterprise-only endpoints are available via `./request`:
```ts
import { cursorRequest } from 'kody:@kentcdodds/cursor/request'
await cursorRequest({ path: '/v1/admin/...' })
```
## Docs
- [Cursor API overview](https://cursor.com/docs/api)
- [Background agent endpoints](https://cursor.com/docs/background-agent/api/endpoints)Report this listing
Log in to report this listing.