@rama_nigg/open-cursor 2.3.15 → 2.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -23
- package/dist/cli/discover.js +30 -0
- package/dist/cli/mcptool.js +15187 -0
- package/dist/cli/opencode-cursor.js +30 -0
- package/dist/index.js +15646 -569
- package/dist/plugin-entry.js +15616 -539
- package/package.json +7 -5
- package/src/cli/mcptool.ts +133 -0
- package/src/mcp/client-manager.ts +166 -0
- package/src/mcp/config.ts +98 -0
- package/src/mcp/tool-bridge.ts +131 -0
- package/src/plugin.ts +124 -7
package/README.md
CHANGED
|
@@ -34,36 +34,48 @@ Add to `~/.config/opencode/opencode.json`:
|
|
|
34
34
|
"cursor-acp/auto": { "name": "Auto" },
|
|
35
35
|
"cursor-acp/composer-1.5": { "name": "Composer 1.5" },
|
|
36
36
|
"cursor-acp/composer-1": { "name": "Composer 1" },
|
|
37
|
+
"cursor-acp/opus-4.6-thinking": { "name": "Claude 4.6 Opus (Thinking)" },
|
|
38
|
+
"cursor-acp/opus-4.6": { "name": "Claude 4.6 Opus" },
|
|
39
|
+
"cursor-acp/sonnet-4.6": { "name": "Claude 4.6 Sonnet" },
|
|
40
|
+
"cursor-acp/sonnet-4.6-thinking": { "name": "Claude 4.6 Sonnet (Thinking)" },
|
|
41
|
+
"cursor-acp/opus-4.5": { "name": "Claude 4.5 Opus" },
|
|
42
|
+
"cursor-acp/opus-4.5-thinking": { "name": "Claude 4.5 Opus (Thinking)" },
|
|
43
|
+
"cursor-acp/sonnet-4.5": { "name": "Claude 4.5 Sonnet" },
|
|
44
|
+
"cursor-acp/sonnet-4.5-thinking": { "name": "Claude 4.5 Sonnet (Thinking)" },
|
|
45
|
+
"cursor-acp/gpt-5.4-high": { "name": "GPT-5.4 High" },
|
|
46
|
+
"cursor-acp/gpt-5.4-high-fast": { "name": "GPT-5.4 High Fast" },
|
|
47
|
+
"cursor-acp/gpt-5.4-xhigh": { "name": "GPT-5.4 Extra High" },
|
|
48
|
+
"cursor-acp/gpt-5.4-xhigh-fast": { "name": "GPT-5.4 Extra High Fast" },
|
|
49
|
+
"cursor-acp/gpt-5.4-medium": { "name": "GPT-5.4" },
|
|
50
|
+
"cursor-acp/gpt-5.4-medium-fast": { "name": "GPT-5.4 Fast" },
|
|
37
51
|
"cursor-acp/gpt-5.3-codex": { "name": "GPT-5.3 Codex" },
|
|
38
|
-
"cursor-acp/gpt-5.3-codex-low": { "name": "GPT-5.3 Codex Low" },
|
|
39
|
-
"cursor-acp/gpt-5.3-codex-high": { "name": "GPT-5.3 Codex High" },
|
|
40
|
-
"cursor-acp/gpt-5.3-codex-xhigh": { "name": "GPT-5.3 Codex Extra High" },
|
|
41
52
|
"cursor-acp/gpt-5.3-codex-fast": { "name": "GPT-5.3 Codex Fast" },
|
|
53
|
+
"cursor-acp/gpt-5.3-codex-low": { "name": "GPT-5.3 Codex Low" },
|
|
42
54
|
"cursor-acp/gpt-5.3-codex-low-fast": { "name": "GPT-5.3 Codex Low Fast" },
|
|
55
|
+
"cursor-acp/gpt-5.3-codex-high": { "name": "GPT-5.3 Codex High" },
|
|
43
56
|
"cursor-acp/gpt-5.3-codex-high-fast": { "name": "GPT-5.3 Codex High Fast" },
|
|
57
|
+
"cursor-acp/gpt-5.3-codex-xhigh": { "name": "GPT-5.3 Codex Extra High" },
|
|
44
58
|
"cursor-acp/gpt-5.3-codex-xhigh-fast": { "name": "GPT-5.3 Codex Extra High Fast" },
|
|
59
|
+
"cursor-acp/gpt-5.3-codex-spark-preview": { "name": "GPT-5.3 Codex Spark" },
|
|
45
60
|
"cursor-acp/gpt-5.2": { "name": "GPT-5.2" },
|
|
61
|
+
"cursor-acp/gpt-5.2-high": { "name": "GPT-5.2 High" },
|
|
46
62
|
"cursor-acp/gpt-5.2-codex": { "name": "GPT-5.2 Codex" },
|
|
47
|
-
"cursor-acp/gpt-5.2-codex-high": { "name": "GPT-5.2 Codex High" },
|
|
48
|
-
"cursor-acp/gpt-5.2-codex-low": { "name": "GPT-5.2 Codex Low" },
|
|
49
|
-
"cursor-acp/gpt-5.2-codex-xhigh": { "name": "GPT-5.2 Codex Extra High" },
|
|
50
63
|
"cursor-acp/gpt-5.2-codex-fast": { "name": "GPT-5.2 Codex Fast" },
|
|
51
|
-
"cursor-acp/gpt-5.2-codex-
|
|
64
|
+
"cursor-acp/gpt-5.2-codex-low": { "name": "GPT-5.2 Codex Low" },
|
|
52
65
|
"cursor-acp/gpt-5.2-codex-low-fast": { "name": "GPT-5.2 Codex Low Fast" },
|
|
66
|
+
"cursor-acp/gpt-5.2-codex-high": { "name": "GPT-5.2 Codex High" },
|
|
67
|
+
"cursor-acp/gpt-5.2-codex-high-fast": { "name": "GPT-5.2 Codex High Fast" },
|
|
68
|
+
"cursor-acp/gpt-5.2-codex-xhigh": { "name": "GPT-5.2 Codex Extra High" },
|
|
53
69
|
"cursor-acp/gpt-5.2-codex-xhigh-fast": { "name": "GPT-5.2 Codex Extra High Fast" },
|
|
54
70
|
"cursor-acp/gpt-5.1-codex-max": { "name": "GPT-5.1 Codex Max" },
|
|
55
71
|
"cursor-acp/gpt-5.1-codex-max-high": { "name": "GPT-5.1 Codex Max High" },
|
|
56
|
-
"cursor-acp/
|
|
57
|
-
"cursor-acp/sonnet-4.5-thinking": { "name": "Claude 4.5 Sonnet (Thinking)" },
|
|
58
|
-
"cursor-acp/gpt-5.2-high": { "name": "GPT-5.2 High" },
|
|
59
|
-
"cursor-acp/opus-4.6": { "name": "Claude 4.6 Opus" },
|
|
60
|
-
"cursor-acp/opus-4.5": { "name": "Claude 4.5 Opus" },
|
|
61
|
-
"cursor-acp/opus-4.5-thinking": { "name": "Claude 4.5 Opus (Thinking)" },
|
|
62
|
-
"cursor-acp/sonnet-4.5": { "name": "Claude 4.5 Sonnet" },
|
|
72
|
+
"cursor-acp/gpt-5.1-codex-mini": { "name": "GPT-5.1 Codex Mini" },
|
|
63
73
|
"cursor-acp/gpt-5.1-high": { "name": "GPT-5.1 High" },
|
|
74
|
+
"cursor-acp/gemini-3.1-pro": { "name": "Gemini 3.1 Pro" },
|
|
64
75
|
"cursor-acp/gemini-3-pro": { "name": "Gemini 3 Pro" },
|
|
65
76
|
"cursor-acp/gemini-3-flash": { "name": "Gemini 3 Flash" },
|
|
66
|
-
"cursor-acp/grok": { "name": "Grok" }
|
|
77
|
+
"cursor-acp/grok": { "name": "Grok" },
|
|
78
|
+
"cursor-acp/kimi-k2.5": { "name": "Kimi K2.5" }
|
|
67
79
|
}
|
|
68
80
|
}
|
|
69
81
|
}
|
|
@@ -129,6 +141,52 @@ opencode run "your prompt" --model cursor-acp/auto
|
|
|
129
141
|
opencode run "your prompt" --model cursor-acp/sonnet-4.5
|
|
130
142
|
```
|
|
131
143
|
|
|
144
|
+
## MCP Tool Bridge
|
|
145
|
+
|
|
146
|
+
The plugin bridges MCP (Model Context Protocol) servers into Cursor models via a `mcptool` CLI. Any MCP server configured in `opencode.json` becomes callable through cursor-agent's Shell tool.
|
|
147
|
+
|
|
148
|
+
### Configure MCP servers
|
|
149
|
+
|
|
150
|
+
Add to `~/.config/opencode/opencode.json`:
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"mcp": {
|
|
155
|
+
"hybrid-memory": {
|
|
156
|
+
"type": "local",
|
|
157
|
+
"command": ["node", "/path/to/mcp-server.js"],
|
|
158
|
+
"environment": {}
|
|
159
|
+
},
|
|
160
|
+
"playwright": {
|
|
161
|
+
"type": "local",
|
|
162
|
+
"command": ["npx", "-y", "@playwright/mcp", "--headless"],
|
|
163
|
+
"environment": {}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### mcptool CLI
|
|
170
|
+
|
|
171
|
+
Installed automatically with the plugin:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
mcptool servers # list configured servers
|
|
175
|
+
mcptool tools [server] # list available tools
|
|
176
|
+
mcptool call hybrid-memory memory_stats # call a tool
|
|
177
|
+
mcptool call playwright browser_navigate '{"url":"https://example.com"}'
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The model uses `mcptool` via Shell automatically — no manual intervention needed. The plugin injects usage instructions into the system prompt.
|
|
181
|
+
|
|
182
|
+
### Supported MCP servers
|
|
183
|
+
|
|
184
|
+
Any MCP server using stdio transport works. Tested with:
|
|
185
|
+
- **hybrid-memory** — persistent memory with semantic search
|
|
186
|
+
- **@modelcontextprotocol/server-filesystem** — file operations
|
|
187
|
+
- **@playwright/mcp** — headless browser automation
|
|
188
|
+
- **@modelcontextprotocol/server-everything** — MCP test/reference server
|
|
189
|
+
|
|
132
190
|
## Architecture
|
|
133
191
|
|
|
134
192
|
```mermaid
|
|
@@ -149,9 +207,14 @@ flowchart TB
|
|
|
149
207
|
OC -->|"execute tool locally"| TOOLRUN["OpenCode tool runtime"]
|
|
150
208
|
TOOLRUN -->|"next request includes role:tool result"| SDK
|
|
151
209
|
SDK -->|"TOOL_RESULT prompt block"| AGENT
|
|
210
|
+
|
|
211
|
+
AGENT -->|"Shell tool_call"| MCPTOOL["mcptool CLI"]
|
|
212
|
+
MCPTOOL -->|"stdio"| MCP["MCP Servers"]
|
|
213
|
+
MCP --> MCPTOOL
|
|
214
|
+
MCPTOOL --> AGENT
|
|
152
215
|
```
|
|
153
216
|
|
|
154
|
-
Default mode: `CURSOR_ACP_TOOL_LOOP_MODE=opencode`.
|
|
217
|
+
Default mode: `CURSOR_ACP_TOOL_LOOP_MODE=opencode`. Details: [docs/architecture/runtime-tool-loop.md](docs/architecture/runtime-tool-loop.md).
|
|
155
218
|
|
|
156
219
|
## Alternatives
|
|
157
220
|
THERE is currently not a single perfect plugin for cursor in opencode, my advice is stick with what is the LEAST worst option for you.
|
|
@@ -164,7 +227,8 @@ THERE is currently not a single perfect plugin for cursor in opencode, my advice
|
|
|
164
227
|
| **Error Parsing** | ✓ (quota/auth/model) | ✗ | ✗ | Debug logging |
|
|
165
228
|
| **Installer** | ✓ TUI + one-liner | ✗ | ✗ | ✗ |
|
|
166
229
|
| **OAuth Flow** | ✓ OpenCode integration | ✓ Native | Browser login | Keychain |
|
|
167
|
-
| **Tool Calling** | ✓ OpenCode-owned loop
|
|
230
|
+
| **Tool Calling** | ✓ OpenCode-owned loop | ✓ Native | ✓ Experimental | ✗ |
|
|
231
|
+
| **MCP Bridge** | ✓ mcptool CLI (any MCP server) | ✗ | ✗ | ✗ |
|
|
168
232
|
| **Stability** | Stable (uses official CLI) | Experimental | Stable | Experimental |
|
|
169
233
|
| **Dependencies** | bun, cursor-agent | npm | bun, cursor-agent | Node.js 18+ |
|
|
170
234
|
| **Port** | 32124 | 18741 | 32123 | 4141 |
|
|
@@ -182,20 +246,20 @@ Debug logging: `CURSOR_ACP_LOG_LEVEL=debug opencode run "your prompt" --model cu
|
|
|
182
246
|
|
|
183
247
|
```mermaid
|
|
184
248
|
flowchart LR
|
|
185
|
-
P1[/Stabilise/] --> P2[/MCP
|
|
186
|
-
|
|
249
|
+
P1[/Stabilise/] --> P2[/MCP Bridge/] --> P3[/Simplify/] --> P4[/ACP + MCP/]
|
|
250
|
+
|
|
187
251
|
style P1 fill:#264653,stroke:#1d3557,color:#fff
|
|
188
252
|
style P2 fill:#264653,stroke:#1d3557,color:#fff
|
|
189
253
|
style P3 fill:#495057,stroke:#343a40,color:#adb5bd
|
|
190
254
|
style P4 fill:#495057,stroke:#343a40,color:#adb5bd
|
|
191
255
|
```
|
|
192
256
|
|
|
193
|
-
[X] **Stabilise** — Clean up dead code, fix test isolation
|
|
194
|
-
[
|
|
195
|
-
[ ] **Simplify** — Rip out serialisation layers
|
|
257
|
+
[X] **Stabilise** — Clean up dead code, fix test isolation
|
|
258
|
+
[X] **MCP Bridge** — Bridge MCP servers into Cursor models via `mcptool` CLI
|
|
259
|
+
[ ] **Simplify** — Rip out serialisation layers
|
|
196
260
|
[ ] **ACP + MCP** — Structured protocols end-to-end
|
|
197
261
|
|
|
198
|
-
`Future Architecture`
|
|
262
|
+
`Future Architecture` — Long-term direction is `OpenCode -> Cursor ACP -> MCP`, using official Cursor ACP as the backend. Currently deferred: Cursor ACP does not yet reliably propagate MCP servers during ACP session setup. See [docs/architecture/cursor-acp-mcp-future.md](docs/architecture/cursor-acp-mcp-future.md).
|
|
199
263
|
|
|
200
264
|
## License
|
|
201
265
|
|
package/dist/cli/discover.js
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
13
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
21
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
22
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
4
34
|
var __returnValue = (v) => v;
|
|
5
35
|
function __exportSetter(name, newValue) {
|
|
6
36
|
this[name] = __returnValue.bind(null, newValue);
|