From b4d7d740658fe70602b4db8d62c15af5ecb34b28 Mon Sep 17 00:00:00 2001 From: BP602 <3460479+BP602@users.noreply.github.com> Date: Fri, 6 Feb 2026 15:43:56 +0100 Subject: [PATCH] fix: allow configuring MCP tool working directory via env var --- README.md | 1 + src/mcpTools.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 41dac75..7f0ee00 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ Now just run `oc` to start OpenCode with Claude Max. |---------------------|---------|-------------| | `CLAUDE_PROXY_PORT` | 3456 | Proxy server port | | `CLAUDE_PROXY_HOST` | 127.0.0.1 | Proxy server host | +| `CLAUDE_PROXY_WORKDIR` | (process cwd) | Base working directory used by MCP file/shell tools | ## How It Works diff --git a/src/mcpTools.ts b/src/mcpTools.ts index ed8b778..84b28f2 100644 --- a/src/mcpTools.ts +++ b/src/mcpTools.ts @@ -8,7 +8,7 @@ import { glob as globLib } from "glob" const execAsync = promisify(exec) -const getCwd = () => process.cwd() +const getCwd = () => process.env.CLAUDE_PROXY_WORKDIR || process.cwd() export const opencodeMcpServer = createSdkMcpServer({ name: "opencode",