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
oho can be used as an MCP (Model Context Protocol) server, allowing external MCP clients (like Claude Desktop, Cursor, etc.) to call OpenCode API through MCP protocol.
334
+
335
+
### Start MCP Server
336
+
337
+
```bash
338
+
# Start the MCP server (stdio mode)
339
+
oho mcpserver
340
+
```
341
+
342
+
The MCP server uses stdio transport, which is the standard mode for local MCP clients.
343
+
344
+
### Available MCP Tools
345
+
346
+
The following tools are available via MCP:
347
+
348
+
| Tool | Description |
349
+
|------|-------------|
350
+
|`session_list`| List all sessions |
351
+
|`session_create`| Create a new session |
352
+
|`session_get`| Get session details |
353
+
|`session_delete`| Delete a session |
354
+
|`session_status`| Get all session statuses |
355
+
|`message_list`| List messages in a session |
356
+
|`message_add`| Send a message to a session |
357
+
|`config_get`| Get OpenCode configuration |
358
+
|`project_list`| List all projects |
359
+
|`project_current`| Get current project |
360
+
|`provider_list`| List AI providers |
361
+
|`file_list`| List files in a directory |
362
+
|`file_content`| Read file content |
363
+
|`find_text`| Search text in project |
364
+
|`find_file`| Find files by name |
365
+
|`global_health`| Check server health |
366
+
367
+
### MCP Client Configuration
368
+
369
+
#### Claude Desktop (macOS/Windows)
370
+
371
+
Add to `claude_desktop_config.json`:
372
+
373
+
```json
374
+
{
375
+
"mcpServers": {
376
+
"oho": {
377
+
"command": "oho",
378
+
"args": ["mcpserver"],
379
+
"env": {
380
+
"OPENCODE_SERVER_HOST": "127.0.0.1",
381
+
"OPENCODE_SERVER_PORT": "4096",
382
+
"OPENCODE_SERVER_PASSWORD": "your-password"
383
+
}
384
+
}
385
+
}
386
+
}
387
+
```
388
+
389
+
#### Cursor
390
+
391
+
Add to Cursor settings (JSON mode):
392
+
393
+
```json
394
+
{
395
+
"mcpServers": {
396
+
"oho": {
397
+
"command": "oho",
398
+
"args": ["mcpserver"],
399
+
"env": {
400
+
"OPENCODE_SERVER_HOST": "127.0.0.1",
401
+
"OPENCODE_SERVER_PORT": "4096",
402
+
"OPENCODE_SERVER_PASSWORD": "your-password"
403
+
}
404
+
}
405
+
}
406
+
}
407
+
```
408
+
409
+
#### VS Code (with Copilot Free)
410
+
411
+
VS Code doesn't have native MCP support. Use the [MCP VS Code extension](https://github.com/modelcontextprotocol/servers):
0 commit comments