You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: phoenix-builder-mcp/mcp-tools.js
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -340,6 +340,37 @@ export function registerTools(server, processManager, wsControlServer, phoenixDe
340
340
}
341
341
);
342
342
343
+
server.tool(
344
+
"exec_js_in_live_preview",
345
+
"Execute JavaScript in the live preview iframe (the page being previewed), NOT in Phoenix itself. "+
346
+
"Auto-opens the live preview panel if it is not already visible. "+
347
+
"Code is evaluated via eval() in the global scope of the previewed page. "+
348
+
"Note: eval() is synchronous — async/await is NOT supported. "+
349
+
"Use this to inspect or manipulate the user's live-previewed web page (e.g. document.title, DOM queries).",
350
+
{
351
+
code: z.string().describe("JavaScript code to execute in the live preview iframe"),
352
+
instance: z.string().optional().describe("Target a specific Phoenix instance by name (e.g. 'Phoenix-a3f2'). Required when multiple instances are connected.")
0 commit comments