소스 검색

tweak: sanitize mcp server names (#831)

Aiden Cline 8 달 전
부모
커밋
022c979d28
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/opencode/src/mcp/index.ts

+ 2 - 1
packages/opencode/src/mcp/index.ts

@@ -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