open_ui
Access the web-based UI in a locally hosted app to visualize Claude Code as Mermaid diagrams. Automatically opens the browser for quick interaction.
Instructions
Open the web-based user interface
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| autoOpen | No | Automatically open browser |
Implementation Reference
- src/mcp/server.ts:323-358 (handler)The main handler function for the 'open_ui' MCP tool. Constructs the UI URL based on environment and optionally opens the browser using platform-specific commands.private async openUI( autoOpen: boolean = true, ): Promise<{ url: string; message: string }> { const isProduction = process.env.NODE_ENV !== "development"; const url = isProduction ? `http://localhost:${this.httpPort}` : `http://localhost:5173`; const message = isProduction ? `Mindpilot UI is available at ${url}` : `Mindpilot UI is available at ${url} (development mode)`; if (autoOpen) { try { const platform = process.platform; let command: string; let args: string[]; if (platform === "darwin") { command = "open"; args = [url]; } else if (platform === "win32") { command = "cmd"; args = ["/c", "start", url]; } else { command = "xdg-open"; args = [url]; } spawn(command, args, { detached: true, stdio: "ignore" }).unref(); } catch (error) { logger.error("Failed to open browser", { error }); } } return { url, message };
- src/mcp/server.ts:148-157 (schema)Input schema defining the optional 'autoOpen' boolean parameter for the 'open_ui' tool.inputSchema: { type: "object", properties: { autoOpen: { type: "boolean", description: "Automatically open browser", default: true, }, }, },
- src/mcp/server.ts:145-158 (registration)Tool registration in the ListToolsRequestHandler, specifying name, description, and input schema for 'open_ui'.{ name: "open_ui", description: "Open the web-based user interface", inputSchema: { type: "object", properties: { autoOpen: { type: "boolean", description: "Automatically open browser", default: true, }, }, }, },
- src/mcp/server.ts:185-194 (handler)Dispatch logic in CallToolRequestHandler that calls the openUI handler and formats the response.case "open_ui": const uiResult = await this.openUI(args?.autoOpen as boolean); return { content: [ { type: "text", text: JSON.stringify(uiResult, null, 2), }, ], };