diff options
| author | Dmytro Tiapukhin <[email protected]> | 2025-11-03 22:19:49 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-03 15:19:49 -0600 |
| commit | e5a651eef780576da1fbeca816535700772d734a (patch) | |
| tree | faa4a96339410dcbdd0e9311b0bbf25911a67553 /packages | |
| parent | d26605aa56d4a4443ee46f95274be70a7645a127 (diff) | |
| download | opencode-e5a651eef780576da1fbeca816535700772d734a.tar.gz opencode-e5a651eef780576da1fbeca816535700772d734a.zip | |
fix: better mcp sanitization (#3842)
Co-authored-by: Aiden Cline <[email protected]>
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/mcp/index.ts | 4 |
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 } } |
