keryx 0.37.0 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/util/mcpServer.ts +11 -0
package/package.json
CHANGED
package/util/mcpServer.ts
CHANGED
|
@@ -534,8 +534,19 @@ function registerTools(mcpServer: McpServer) {
|
|
|
534
534
|
})
|
|
535
535
|
: JSON.stringify(response);
|
|
536
536
|
|
|
537
|
+
// Promote plain object responses to structuredContent so MCP Apps can
|
|
538
|
+
// bind without JSON.parse (same shape UIResponse already provides).
|
|
539
|
+
const structuredContent =
|
|
540
|
+
format === MCP_RESPONSE_FORMAT.JSON &&
|
|
541
|
+
response !== null &&
|
|
542
|
+
typeof response === "object" &&
|
|
543
|
+
!Array.isArray(response)
|
|
544
|
+
? (response as Record<string, unknown>)
|
|
545
|
+
: undefined;
|
|
546
|
+
|
|
537
547
|
return {
|
|
538
548
|
content: [{ type: "text" as const, text }],
|
|
549
|
+
...(structuredContent ? { structuredContent } : {}),
|
|
539
550
|
};
|
|
540
551
|
} finally {
|
|
541
552
|
connection.destroy();
|