diff --git a/src/lib/mcp.ts b/src/lib/mcp.ts
index 738a87f..e8cf6ed 100644
--- a/src/lib/mcp.ts
+++ b/src/lib/mcp.ts
@@ -4,6 +4,7 @@ import { listen } from '@tauri-apps/api/event';
import { get } from 'svelte/store';
import { createMcpWindowGate, mcpBusy, type McpFinish } from './utils/mcp-editor';
import type { VaultIdentity } from './types';
+import { isMobile } from './platform';
export type McpAccess = 'off' | 'read' | 'write';
export interface McpStatus { mode: McpAccess; ready: boolean; error?: string | null }
@@ -12,6 +13,8 @@ export const setMcpAccess = (vault: VaultIdentity, mode: McpAccess) => invoke invoke>('mcp_client_config', { vault });
export async function installMcpWindow(ready: () => boolean): Promise<() => void> {
+ // Mobile binaries do not contain an MCP runtime or its native commands.
+ if (isMobile) return () => {};
let focused: HTMLElement | null = null;
const gate = createMcpWindowGate({ ready, reply: (id, accepted) => invoke('mcp_editor_ready', { id, accepted }),
busy(value) {
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index a9eb74d..ccbd98c 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -8,7 +8,6 @@
import { applyUiScale, defaultUiScale } from '$lib/ui-scale';
import { listen } from '@tauri-apps/api/event';
import { getCurrentWindow } from '@tauri-apps/api/window';
- import { installMcpWindow } from '$lib/mcp';
import { mcpBusy, mcpWindowReady } from '$lib/utils/mcp-editor';
import { t } from '$lib/i18n';
import VaultPicker from '$lib/components/VaultPicker.svelte';
@@ -165,6 +164,7 @@
if (!isMobile) {
try {
+ const { installMcpWindow } = await import('$lib/mcp');
const dispose = await installMcpWindow(() => !loading && (noteWindowPath ? !!$activeNotePath : !$vaultReady || mcpWindowReady()));
if (pageDisposed) dispose(); else removeMcp = dispose;
} catch (error) { console.error('MCP editor listener is unavailable:', error); }
diff --git a/tests/browser/McpSettingsHarness.svelte b/tests/browser/McpSettingsHarness.svelte
index 3b9525c..79250d0 100644
--- a/tests/browser/McpSettingsHarness.svelte
+++ b/tests/browser/McpSettingsHarness.svelte
@@ -1,6 +1,5 @@
-{#if narrow}{:else}true}/>{/if}
+{#if narrow}{#await import('../../src/lib/components/McpSettings.svelte') then {default:McpSettings}}{/await}{:else}true}/>{/if}