Connecting...
;
+ }
+
+ return (
+
+
MCP UI Client (React)
+
+
+
+
+
+
+
+
+
+
+
+ {toolResults.length > 0 && (
+
+
Tool Results:
+ {toolResults.map((result, i) => (
+
+ isError: {String(result.isError ?? false)}
+
+ content: {JSON.stringify(result.content)}
+
+ {result.structuredContent && (
+ <>
+ structuredContent:{" "}
+ {JSON.stringify(result.structuredContent)}
+ >
+ )}
+
+ ))}
+
+ )}
+
+ {messages.length > 0 && (
+
+
Messages:
+ {messages.map((msg, i) => (
+
+ {msg}
+
+ ))}
+
+ )}
+
+ );
+}
+
+window.addEventListener("load", () => {
+ const root = document.getElementById("root");
+ if (!root) {
+ throw new Error("Root element not found");
+ }
+
+ createRoot(root).render(