Commit 595bcab
fix(cursor-agent): inject --approve-mcps --force for headless MCP/tool access
The previous commit (1c55988) wired up ``-p --trust`` so the CLI launches
in headless mode without the Workspace Trust prompt, but that alone is
not enough to let ``specify workflow run`` drive a real speckit feature
end-to-end with cursor-agent on Windows. Two more flags are required:
* ``--approve-mcps``: without it, every MCP server configured in
``.cursor/mcp.json`` stays ``not loaded (needs approval)``, and any
tool call against them is silently dropped. We hit this immediately
trying to read a DingTalk PRD from a remote MCP server during the
``/speckit-specify`` step.
* ``--force``: without it, the agent halts on the first tool-call
approval prompt (the tool call gets rejected and the workflow exits
non-zero with a misleading message). With ``--force`` cursor-agent
matches the implicit "trusted environment" semantics that ``claude -p``
and ``codex --exec`` already have by default -- which is the right
semantics for an unattended ``specify workflow run`` invocation.
Verified end-to-end on Windows 10 + cursor-agent 2026.05.16-0338208:
* ``cursor-agent -p --trust --approve-mcps --force --output-format text``
+ a ``/speckit-specify`` prompt that included a DingTalk URL produced
a full spec.md (31.5 KB) plus checklists/requirements.md in ~10.7 min,
reading the source PRD through the ``dingtalk-doc`` remote MCP server,
deciding the ``specs/`` subpath itself, and updating
``.specify/feature.json`` and ``specs/menu-dictionary.md`` along the
way -- no human-in-the-loop, no source PRD ever touched the filesystem.
* Without ``--approve-mcps`` the same prompt errors with the tool call
rejected message; without ``--force`` the agent stops at the first
non-MCP tool call.
Tests:
* ``test_build_exec_args_*`` updated to pin the new four-flag prefix.
* New ``test_build_exec_args_contains_mandatory_headless_flags`` asserts
the four flags are always present together.
* ``test_dispatch_command_resolves_cmd_shim_for_subprocess`` updated to
match the new argv layout.
* All 43 cursor-agent tests pass; no other tests touched.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 454d3d0 commit 595bcab
2 files changed
Lines changed: 46 additions & 10 deletions
File tree
- src/specify_cli/integrations/cursor_agent
- tests/integrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
48 | 64 | | |
49 | 65 | | |
50 | 66 | | |
51 | | - | |
| 67 | + | |
52 | 68 | | |
53 | 69 | | |
54 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
133 | | - | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
142 | | - | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
151 | | - | |
| 155 | + | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
155 | 175 | | |
156 | 176 | | |
157 | 177 | | |
| |||
189 | 209 | | |
190 | 210 | | |
191 | 211 | | |
192 | | - | |
| 212 | + | |
193 | 213 | | |
194 | 214 | | |
195 | 215 | | |
| |||
0 commit comments