summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--packages/opencode/src/mcp/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/opencode/src/mcp/index.ts b/packages/opencode/src/mcp/index.ts
index 6b153e39d..d6de4a59b 100644
--- a/packages/opencode/src/mcp/index.ts
+++ b/packages/opencode/src/mcp/index.ts
@@ -242,8 +242,8 @@ export namespace MCP {
continue
}
for (const [toolName, tool] of Object.entries(tools)) {
- const sanitizedClientName = clientName.replace(/\s+/g, "_")
- const sanitizedToolName = toolName.replace(/[-\s]+/g, "_")
+ const sanitizedClientName = clientName.replace(/[^a-zA-Z0-9_-]/g, "_")
+ const sanitizedToolName = toolName.replace(/[^a-zA-Z0-9_-]/g, "_")
result[sanitizedClientName + "_" + sanitizedToolName] = tool
}
}