You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(cursor): add MCP usage and --workspace / approval quirks
Document how MCP servers are configured in cursor-agent ACP mode:
- The `--workspace` flag determines which `.cursor/mcp.json` is
loaded and which approvals slug is used — explicit is safer than
relying on cwd auto-detection.
- `--approve-mcps` does NOT apply in ACP mode (interactive CLI only);
MCP load gating uses an approval file at
.cursor/projects/<slug>/mcp-approvals.json.
- Two paths to approve: pre-create the file, or approve once
interactively so Cursor persists it.
- openab auto-replies session/request_permission with allow_always,
so once loaded, subsequent tool calls pass without prompting.
- Verify with `cursor-agent mcp list`.
Part of PR #301 polish.
Copy file name to clipboardExpand all lines: docs/cursor.md
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,60 @@ In ACP mode, `--model` can be appended after `acp`. If omitted, the account defa
95
95
96
96
To verify which model is active, ask the agent "who are you" — the underlying model will typically self-identify (e.g. "I am Gemini, a large language model built by Google.").
97
97
98
+
## MCP Usage (ACP mode caveats)
99
+
100
+
Cursor Agent CLI supports MCP servers configured via `.cursor/mcp.json` in the active workspace directory. **Which directory counts as the workspace is determined by the `--workspace` flag** — if omitted, cursor-agent auto-detects from `cwd`, which is usually `/home/agent` in OpenAB containers via the Dockerfile `WORKDIR` directive but can drift in interactive or local runs. For reproducible MCP loading, pass `--workspace` explicitly:
Without `--workspace`, a different cwd would produce a different slug and cursor-agent would not find previously saved approvals.
113
+
114
+
### Example MCP config
115
+
116
+
```json
117
+
{
118
+
"mcpServers": {
119
+
"playwright": {
120
+
"command": "/usr/bin/npx",
121
+
"args": ["-y", "@playwright/mcp@latest"]
122
+
}
123
+
}
124
+
}
125
+
```
126
+
127
+
### Approval quirk in ACP mode
128
+
129
+
Cursor's `--approve-mcps` flag **does not apply in ACP mode** — it only affects the interactive CLI. In ACP mode, MCP servers are gated by an approval file. Two options:
130
+
131
+
1.**Pre-create the approvals file** at `<workspace>/.cursor/projects/<slug>/mcp-approvals.json`:
132
+
```json
133
+
["<server-name>-<sha256_hash>"]
134
+
```
135
+
Hash is derived from workspace path + server config.
136
+
137
+
2.**Approve once interactively**, then let Cursor persist the approval:
# invoke an MCP tool, approve the prompt; approval is saved
141
+
```
142
+
143
+
OpenAB itself auto-responds to ACP `session/request_permission` with `allow_always` (see `src/acp/connection.rs`), so once an MCP server is *loaded*, subsequent tool calls pass without prompting. The approval file only gates the initial load.
144
+
145
+
### Verifying MCP is loaded
146
+
147
+
```bash
148
+
kubectl exec deployment/openab-cursor -- cursor-agent mcp list
149
+
# Expected: "<server-name>: ready"
150
+
```
151
+
98
152
## Known Limitations
99
153
100
154
- Cursor Agent CLI is a separate distribution from Cursor Desktop — they are not the same binary
0 commit comments