Security fix for MCP

This commit is contained in:
2026-10-12 14:47:50 +02:00
parent 73eacb09c2
commit 24fa3fdcdf
6 changed files with 20 additions and 6 deletions
+5 -1
View File
@@ -187,7 +187,11 @@ export function createMcpRoute(args: CreateMcpRouteArgs) {
if (p.name === 'get_page') {return rpcResult(id, toolText(await getPage(toolArgs)))}
return rpcResult(id, toolText(`Unknown tool: ${p.name}`, true))
} catch (err) {
return rpcResult(id, toolText(err instanceof Error ? err.message : 'Tool error', true))
// Log the real error server-side; return a GENERIC message to the
// (anonymous) caller so internal details — DB schema, host, stack —
// never leak over a public endpoint.
console.warn('[ipal] createMcpRoute: tool execution failed:', err)
return rpcResult(id, toolText('Tool execution failed.', true))
}
}
case 'tools/list':