Skip to content

Commit b97b154

Browse files
author
tornado404
authored
Merge pull request #5 from tornado404/opencode/tidy-panda
feat: add MCP server and one-click install script
2 parents 5c57a3a + fad165a commit b97b154

4 files changed

Lines changed: 1037 additions & 1 deletion

File tree

oho/README.md

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ In Linux environments, oho can provide capabilities that OpenCode CLI doesn't cu
5454

5555
## Installation
5656

57+
### Quick Install (Recommended)
58+
59+
```bash
60+
# Download and run the installer
61+
curl -sSL https://raw.githubusercontent.com/tornado404/opencode_cli/master/oho/install.sh | bash
62+
63+
# Or with wget
64+
wget -qO- https://raw.githubusercontent.com/tornado404/opencode_cli/master/oho/install.sh | bash
65+
```
66+
67+
### Build from Source
68+
5769
### Build from Source
5870

5971
```bash
@@ -314,7 +326,102 @@ oho/
314326
│ ├── types/ # Type definitions
315327
│ └── util/ # Utility functions
316328
├── Makefile
317-
├── build.sh
329+
```
330+
331+
## MCP Server
332+
333+
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):
412+
413+
```json
414+
{
415+
"mcpServers": {
416+
"oho": {
417+
"command": "oho",
418+
"args": ["mcpserver"]
419+
}
420+
}
421+
}
422+
```
423+
424+
## License
318425
└── README.md
319426
```
320427

oho/cmd/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/anomalyco/oho/cmd/global"
1717
"github.com/anomalyco/oho/cmd/lsp"
1818
"github.com/anomalyco/oho/cmd/mcp"
19+
"github.com/anomalyco/oho/cmd/mcpserver"
1920
"github.com/anomalyco/oho/cmd/message"
2021
"github.com/anomalyco/oho/cmd/project"
2122
"github.com/anomalyco/oho/cmd/provider"
@@ -102,6 +103,7 @@ func main() {
102103
lsp.Cmd,
103104
formatter.Cmd,
104105
mcp.Cmd,
106+
mcpserver.Cmd,
105107
tui.Cmd,
106108
auth.Cmd,
107109
)

0 commit comments

Comments
 (0)