mirror of
https://github.com/aljazceru/opencode.git
synced 2026-02-04 07:34:59 +01:00
fix: better mcp sanitization (#3842)
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user