cursor_request
Run a Cursor Agent request from MCP: choose plan or ask mode, select a model, resume a session, and target a workspace.
Instructions
Run a Cursor Agent request synchronously (auto-defers to a pollable job past the sync deadline when async jobs are enabled; otherwise runs to completion). Default cli uses headless print mode (cursor-agent --print); gated acp uses native cursor-agent acp and accepts prompt, model, a gateway ACP session, and a registered workspace alias.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Cursor execution mode: plan (read-only planning) or ask (Q&A/read-only) | |
| force | No | Emit --force (Cursor yolo mode; auto-allows commands unless explicitly denied) | |
| model | No | Model name or alias passed via --model | |
| trust | No | Trust the workspace in headless mode (--trust) | |
| addDir | No | Additional workspace root directories (--add-dir, repeatable). | |
| prompt | Yes | Prompt text for Cursor Agent CLI | |
| sandbox | No | Cursor sandbox mode override (--sandbox enabled|disabled) | |
| sessionId | No | On transport=cli, Cursor chat/session ID to resume (emits --resume <id>); gateway gw-* tracking ids are not CLI session ids. On transport=acp, gateway-owned ACP session ID returned by an earlier ACP call; Cursor-native and CLI session ids are rejected. | |
| transport | No | Transport selector. Default `cli` uses cursor-agent --print. `acp` uses native cursor-agent acp and fails closed unless [acp].enabled plus [acp.providers.cursor].enabled and runtime_enabled are true. ACP accepts prompt, model, a gateway ACP sessionId, and a registered workspace alias; Cursor CLI-only controls are rejected. | cli |
| workspace | No | Workspace directory or saved workspace name (--workspace) on transport=cli. transport=acp requires a registered gateway workspace alias. Remote HTTP/OAuth callers must pass an alias; local callers may pass local Cursor workspace paths only on transport=cli. | |
| autoReview | No | Emit --auto-review (Cursor Smart Auto classifier for tool calls) | |
| workingDir | No | Local Cursor Agent process working directory. Distinct from --workspace, which selects a Cursor workspace or saved workspace name; this sets the process cwd. Passing both an absolute workspace path and a different workingDir is rejected rather than silently ranked. Stdio/local callers may pass local paths directly. Remote HTTP/OAuth callers must use relative paths inside a selected registered workspace. Do not call workspace_* tools to fix stdio/local provider path access. | |
| forceRefresh | No | Bypass dedup and force a fresh CLI run even if a recent identical request exists | |
| outputFormat | No | Cursor --output-format for --print mode | text |
| resumeLatest | No | Resume the latest Cursor chat (--continue) on transport=cli. true is rejected on transport=acp. | |
| correlationId | No | Request trace ID (auto if omitted) | |
| idleTimeoutMs | No | Total-runtime bound, not an idle timer: this provider emits no output until it exits, so the child is killed after this duration even while healthy. Min 30s, max 1h, omit=1h default. Cursor only: this holds for the default text invocation; with outputFormat stream-json the CLI streams incrementally, so the same timer behaves as a genuine idle window. | |
| providerFlags | No | Flags passed to the provider binary verbatim, keyed exactly as the binary spells them (e.g. {"--best-of-n": "3", "--verbatim": true, "--rules": ["a", "b"]}). Use this for any flag your installed CLI accepts that this schema does not name: the binary decides what it supports, not the gateway. true emits the flag alone; a list REPEATS the flag once per item (pass a joined string if your CLI wants a comma-separated value). Values may not start with '-', and a flag the gateway is already emitting for this request is refused rather than duplicated. LOCAL stdio callers only: remote HTTP/OAuth callers are refused every flag here and should use this tool's declared parameters, which carry their own host-path and approval gates. | |
| approvalPolicy | No | On transport=cli, approvalPolicy has no effect because mcp_managed is unavailable. On transport=acp, supplying approvalPolicy is rejected because ACP has its own permission bridge. | |
| optimizePrompt | No | Optimize prompt before execution | |
| approvalStrategy | No | Approval strategy. legacy is the only executable CLI strategy; mcp_managed is rejected before Cursor launches because the CLI adapter cannot isolate ambient MCP configuration. transport=acp has its own permission bridge and also rejects mcp_managed. | legacy |
| compressResponse | No | Compress the response display text via the native compressor (default: [compression].enabled in config.toml, off unless opted in). Skipped for structured output. | |
| createNewSession | No | Force a new session on transport=cli. true is rejected on transport=acp. | |
| optimizeResponse | No | Optimize response output |