Skip to content

Commit 8d6a468

Browse files
committed
docs: update README with MCP tool bridge section, fix roadmap and architecture diagram
1 parent cfe8985 commit 8d6a468

File tree

1 file changed

+60
-8
lines changed

1 file changed

+60
-8
lines changed

README.md

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,52 @@ opencode run "your prompt" --model cursor-acp/auto
141141
opencode run "your prompt" --model cursor-acp/sonnet-4.5
142142
```
143143

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+
144190
## Architecture
145191

146192
```mermaid
@@ -161,9 +207,14 @@ flowchart TB
161207
OC -->|"execute tool locally"| TOOLRUN["OpenCode tool runtime"]
162208
TOOLRUN -->|"next request includes role:tool result"| SDK
163209
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
164215
```
165216

166-
Default mode: `CURSOR_ACP_TOOL_LOOP_MODE=opencode`. Legacy `proxy-exec` still available. Details: [docs/architecture/runtime-tool-loop.md](docs/architecture/runtime-tool-loop.md).
217+
Default mode: `CURSOR_ACP_TOOL_LOOP_MODE=opencode`. Details: [docs/architecture/runtime-tool-loop.md](docs/architecture/runtime-tool-loop.md).
167218

168219
## Alternatives
169220
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.
@@ -176,7 +227,8 @@ THERE is currently not a single perfect plugin for cursor in opencode, my advice
176227
| **Error Parsing** | ✓ (quota/auth/model) ||| Debug logging |
177228
| **Installer** | ✓ TUI + one-liner ||||
178229
| **OAuth Flow** | ✓ OpenCode integration | ✓ Native | Browser login | Keychain |
179-
| **Tool Calling** | ✓ OpenCode-owned loop + proxy-exec | ✓ Native | ✓ Experimental ||
230+
| **Tool Calling** | ✓ OpenCode-owned loop | ✓ Native | ✓ Experimental ||
231+
| **MCP Bridge** | ✓ mcptool CLI (any MCP server) ||||
180232
| **Stability** | Stable (uses official CLI) | Experimental | Stable | Experimental |
181233
| **Dependencies** | bun, cursor-agent | npm | bun, cursor-agent | Node.js 18+ |
182234
| **Port** | 32124 | 18741 | 32123 | 4141 |
@@ -194,20 +246,20 @@ Debug logging: `CURSOR_ACP_LOG_LEVEL=debug opencode run "your prompt" --model cu
194246

195247
```mermaid
196248
flowchart LR
197-
P1[/Stabilise/] --> P2[/MCP Server/] --> P3[/Simplify/] --> P4[/ACP + MCP/]
198-
249+
P1[/Stabilise/] --> P2[/MCP Bridge/] --> P3[/Simplify/] --> P4[/ACP + MCP/]
250+
199251
style P1 fill:#264653,stroke:#1d3557,color:#fff
200252
style P2 fill:#264653,stroke:#1d3557,color:#fff
201253
style P3 fill:#495057,stroke:#343a40,color:#adb5bd
202254
style P4 fill:#495057,stroke:#343a40,color:#adb5bd
203255
```
204256

205-
[X] **Stabilise** — Clean up dead code, fix test isolation
206-
[ ] **MCP Server**Expose OpenCode tools via stdio transport
207-
[ ] **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
208260
[ ] **ACP + MCP** — Structured protocols end-to-end
209261

210-
`Future Architecture` - Long-term direction is to replace the current custom proxy and provider-boundary approach with `OpenCode -> Cursor ACP -> MCP`, using official Cursor ACP as the backend so tool ownership stays agent-side and the eventual OpenCode integration can remain small. `Status` - Deferred: this is the preferred path, but it is currently blocked because official Cursor ACP does not yet reliably propagate MCP servers during ACP session setup. `Details` - See [docs/architecture/cursor-acp-mcp-future.md](docs/architecture/cursor-acp-mcp-future.md).
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).
211263

212264
## License
213265

0 commit comments

Comments
 (0)