tweak: sanitize mcp server names (#831)

This commit is contained in:
Aiden Cline
2025-08-01 09:11:40 -05:00
committed by GitHub
parent 4172e3ad28
commit 022c979d28

View File

@@ -115,7 +115,8 @@ export namespace MCP {
const result: Record<string, Tool> = {}
for (const [clientName, client] of Object.entries(await clients())) {
for (const [toolName, tool] of Object.entries(await client.tools())) {
result[clientName + "_" + toolName] = tool
const sanitizedClientName = clientName.replace(/\s+/g, "_")
result[sanitizedClientName + "_" + toolName] = tool
}
}
return result