From bd666227c8f7557483f7e24fb8544fc0456600dc Mon Sep 17 00:00:00 2001 From: Fahad Date: Sat, 4 Oct 2025 23:22:26 +0400 Subject: [PATCH] docs: instructions for OpenCode --- README.md | 24 ------------------------ docs/getting-started.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 8ec78e5..fb140c5 100644 --- a/README.md +++ b/README.md @@ -152,30 +152,6 @@ cd zen-mcp-server } ``` -**For Qwen Code CLI:** -Edit `~/.qwen/settings.json` and register Zen as an MCP server: - -```json -{ - "mcpServers": { - "zen": { - "command": "bash", - "args": [ - "-c", - "for p in $(which uvx 2>/dev/null) $HOME/.local/bin/uvx /opt/homebrew/bin/uvx /usr/local/bin/uvx uvx; do [ -x \"$p\" ] && exec \"$p\" --from git+https://github.com/BeehiveInnovations/zen-mcp-server.git zen-mcp-server; done; echo 'uvx not found' >&2; exit 1" - ], - "cwd": "/path/to/zen-mcp-server", - "env": { - "PATH": "/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:~/.local/bin", - "GEMINI_API_KEY": "your_api_key_here" - } - } - } -} -``` - -Update the `env` block with the API keys you use (Gemini, OpenAI, OpenRouter, etc.). - **3. Start Using!** ``` "Use zen to analyze this code for security issues with gemini pro" diff --git a/docs/getting-started.md b/docs/getting-started.md index 5e48fdf..5627cce 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -172,6 +172,31 @@ Create or edit `~/.qwen/settings.json`: Replace the placeholder API key with the providers you use (Gemini, OpenAI, OpenRouter, etc.). +**For OpenCode CLI:** +Edit `~/.config/opencode/opencode.json`: + +```json +{ + "$schema": "https://opencode.ai/config.json", + "mcp": { + "zen": { + "type": "local", + "command": [ + "/path/to/zen-mcp-server/.zen_venv/bin/python", + "/path/to/zen-mcp-server/server.py" + ], + "cwd": "/path/to/zen-mcp-server", + "enabled": true, + "environment": { + "GEMINI_API_KEY": "your_api_key_here" + } + } + } +} +``` + +Add any other API keys you rely on (`OPENAI_API_KEY`, `OPENROUTER_API_KEY`, etc.). + #### IDE Clients (Cursor & VS Code) Zen works in GUI IDEs that speak MCP. The configuration mirrors the CLI examples above—point the client at the `uvx` launcher and set any required environment variables. @@ -293,6 +318,11 @@ CUSTOM_MODEL_NAME=llama3.2 # Default model name 2. Run `qwen mcp list --scope user` and confirm `zen` shows `CONNECTED`. 3. Try: `"/mcp"` to inspect available tools or `"Use zen to analyze this repo"`. +### For OpenCode CLI: +1. Restart OpenCode (or run `OpenCode: Reload Config`). +2. Open **Settings › Tools › MCP** and confirm `zen` is enabled. +3. Start a new chat and try: `"Use zen to list available models"`. + ### For Codex CLI: 1. Restart Codex CLI if running 2. Open a new conversation