fix(desktop): add tauri-plugin-mcp setupPluginListeners() for dev debugging
The tauri-plugin-mcp was registered in Rust but the frontend never called setupPluginListeners(), causing all DOM-related MCP operations (execute_js, query_page, type_text) to timeout. This fix enables proper dev debugging via tauri-mcp tools.
This commit is contained in:
@@ -5,6 +5,7 @@ import './index.css';
|
|||||||
import { ToastProvider } from './components/ui/Toast';
|
import { ToastProvider } from './components/ui/Toast';
|
||||||
import { GlobalErrorBoundary } from './components/ui/ErrorBoundary';
|
import { GlobalErrorBoundary } from './components/ui/ErrorBoundary';
|
||||||
import { initWebMCPTools } from './lib/webmcp-tools';
|
import { initWebMCPTools } from './lib/webmcp-tools';
|
||||||
|
import { setupPluginListeners } from 'tauri-plugin-mcp';
|
||||||
|
|
||||||
// Global error handler for uncaught errors
|
// Global error handler for uncaught errors
|
||||||
const handleGlobalError = (error: Error, errorInfo: React.ErrorInfo) => {
|
const handleGlobalError = (error: Error, errorInfo: React.ErrorInfo) => {
|
||||||
@@ -29,6 +30,13 @@ const handleGlobalReset = () => {
|
|||||||
// Initialize WebMCP debugging tools (dev mode only, Chrome 146+)
|
// Initialize WebMCP debugging tools (dev mode only, Chrome 146+)
|
||||||
initWebMCPTools();
|
initWebMCPTools();
|
||||||
|
|
||||||
|
// Initialize tauri-plugin-mcp event listeners (dev mode only)
|
||||||
|
if (import.meta.env.DEV) {
|
||||||
|
setupPluginListeners().catch((err) => {
|
||||||
|
console.warn('[MCP] Failed to setup plugin listeners:', err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<GlobalErrorBoundary
|
<GlobalErrorBoundary
|
||||||
|
|||||||
Reference in New Issue
Block a user