@hypothesi/tauri-mcp-server 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ import { listDevices, launchEmulator, ListDevicesSchema, LaunchEmulatorSchema }
8
8
  import { manageDriverSession, ManageDriverSessionSchema, } from './driver/session-manager.js';
9
9
  import { readLogs, ReadLogsSchema } from './monitor/logs.js';
10
10
  import { getDocs, GetDocsSchema } from './manager/docs.js';
11
- import { executeIPCCommand, getWindowInfo, manageIPCMonitoring, getIPCEvents, emitTestEvent, getBackendState, ExecuteIPCCommandSchema, GetWindowInfoSchema, ManageIPCMonitoringSchema, GetIPCEventsSchema, EmitTestEventSchema, GetBackendStateSchema, } from './driver/plugin-commands.js';
11
+ import { executeIPCCommand, getWindowInfo, manageIPCMonitoring, getIPCEvents, emitTestEvent, getBackendState, listWindows, ExecuteIPCCommandSchema, GetWindowInfoSchema, ManageIPCMonitoringSchema, GetIPCEventsSchema, EmitTestEventSchema, GetBackendStateSchema, ListWindowsSchema, } from './driver/plugin-commands.js';
12
12
  import { interact, screenshot, keyboard, waitFor, getStyles, executeJavaScript, focusElement, findElement, getConsoleLogs, InteractSchema, ScreenshotSchema, KeyboardSchema, WaitForSchema, GetStylesSchema, ExecuteJavaScriptSchema, FocusElementSchema, FindElementSchema, GetConsoleLogsSchema, } from './driver/webview-interactions.js';
13
13
  /**
14
14
  * Tool categories for organization
@@ -27,9 +27,19 @@ export const TOOLS = [
27
27
  // Project Management Tools
28
28
  {
29
29
  name: 'tauri_run_command',
30
- description: 'Run any Tauri CLI command with full flexibility',
30
+ description: '[Tauri Desktop/Mobile Apps Only] Run Tauri CLI commands (dev, build, init, etc.). ' +
31
+ 'Use ONLY for projects with a src-tauri/ directory and tauri.conf.json. ' +
32
+ 'Do NOT use for regular web apps, Electron apps, or browser-based projects. ' +
33
+ 'Check for tauri.conf.json before using this tool.',
31
34
  category: TOOL_CATEGORIES.PROJECT_MANAGEMENT,
32
35
  schema: RunCommandSchema,
36
+ annotations: {
37
+ title: 'Run Tauri CLI Command',
38
+ readOnlyHint: false,
39
+ destructiveHint: false,
40
+ idempotentHint: false,
41
+ openWorldHint: false,
42
+ },
33
43
  handler: async (args) => {
34
44
  const parsed = RunCommandSchema.parse(args);
35
45
  return await runTauriCommand(parsed.command, parsed.cwd, parsed.args || [], parsed.timeout);
@@ -37,9 +47,16 @@ export const TOOLS = [
37
47
  },
38
48
  {
39
49
  name: 'tauri_read_config',
40
- description: 'Read Tauri configuration files (including platform-specific configs)',
50
+ description: '[Tauri Desktop/Mobile Apps Only] Read tauri.conf.json or platform-specific configs. ' +
51
+ 'Use ONLY for Tauri v2 projects (look for src-tauri/ directory). ' +
52
+ 'For regular web apps or Electron, use standard file reading tools instead.',
41
53
  category: TOOL_CATEGORIES.PROJECT_MANAGEMENT,
42
54
  schema: ReadConfigSchema,
55
+ annotations: {
56
+ title: 'Read Tauri Config',
57
+ readOnlyHint: true,
58
+ openWorldHint: false,
59
+ },
43
60
  handler: async (args) => {
44
61
  const parsed = ReadConfigSchema.parse(args);
45
62
  return await readConfig(parsed.projectPath, parsed.file);
@@ -47,9 +64,17 @@ export const TOOLS = [
47
64
  },
48
65
  {
49
66
  name: 'tauri_write_config',
50
- description: 'Write to Tauri configuration files with validation',
67
+ description: '[Tauri Desktop/Mobile Apps Only] Modify tauri.conf.json with validation. ' +
68
+ 'Use ONLY for Tauri v2 projects. Validates JSON structure before writing. ' +
69
+ 'For other frameworks, use standard file editing tools.',
51
70
  category: TOOL_CATEGORIES.PROJECT_MANAGEMENT,
52
71
  schema: WriteConfigSchema,
72
+ annotations: {
73
+ title: 'Write Tauri Config',
74
+ readOnlyHint: false,
75
+ destructiveHint: true,
76
+ openWorldHint: false,
77
+ },
53
78
  handler: async (args) => {
54
79
  const parsed = WriteConfigSchema.parse(args);
55
80
  return await writeConfig(parsed.projectPath, parsed.file, parsed.content);
@@ -57,9 +82,16 @@ export const TOOLS = [
57
82
  },
58
83
  {
59
84
  name: 'tauri_get_docs',
60
- description: 'Get Tauri documentation (LLM Cheat Sheet)',
85
+ description: '[Tauri Desktop/Mobile Apps Only] Fetch Tauri v2 documentation and API reference. ' +
86
+ 'Use when working on Tauri projects and need framework-specific guidance. ' +
87
+ 'Not useful for Electron, React Native, or web-only projects.',
61
88
  category: TOOL_CATEGORIES.PROJECT_MANAGEMENT,
62
89
  schema: GetDocsSchema,
90
+ annotations: {
91
+ title: 'Get Tauri Documentation',
92
+ readOnlyHint: true,
93
+ openWorldHint: true,
94
+ },
63
95
  handler: async (args) => {
64
96
  const parsed = GetDocsSchema.parse(args);
65
97
  return await getDocs(parsed.projectPath);
@@ -68,9 +100,16 @@ export const TOOLS = [
68
100
  // Mobile Development Tools
69
101
  {
70
102
  name: 'tauri_list_devices',
71
- description: 'List Android devices and iOS simulators',
103
+ description: '[Tauri Mobile Apps Only] List Android emulators/devices and iOS simulators. ' +
104
+ 'Use for Tauri mobile development (tauri android dev, tauri ios dev). ' +
105
+ 'Not needed for desktop-only Tauri apps or web projects.',
72
106
  category: TOOL_CATEGORIES.MOBILE_DEVELOPMENT,
73
107
  schema: ListDevicesSchema,
108
+ annotations: {
109
+ title: 'List Mobile Devices',
110
+ readOnlyHint: true,
111
+ openWorldHint: false,
112
+ },
74
113
  handler: async () => {
75
114
  const devices = await listDevices();
76
115
  return `Android Devices:\n${devices.android.join('\n') || 'None'}\n\niOS Booted Simulators:\n${devices.ios.join('\n') || 'None'}`;
@@ -78,9 +117,17 @@ export const TOOLS = [
78
117
  },
79
118
  {
80
119
  name: 'tauri_launch_emulator',
81
- description: 'Launch Android AVD or iOS Simulator',
120
+ description: '[Tauri Mobile Apps Only] Launch Android AVD or iOS Simulator for Tauri mobile testing. ' +
121
+ 'Use when developing Tauri apps for mobile platforms. ' +
122
+ 'Not applicable for desktop-only apps or web projects.',
82
123
  category: TOOL_CATEGORIES.MOBILE_DEVELOPMENT,
83
124
  schema: LaunchEmulatorSchema,
125
+ annotations: {
126
+ title: 'Launch Mobile Emulator',
127
+ readOnlyHint: false,
128
+ destructiveHint: false,
129
+ openWorldHint: false,
130
+ },
84
131
  handler: async (args) => {
85
132
  const parsed = LaunchEmulatorSchema.parse(args);
86
133
  return await launchEmulator(parsed.platform, parsed.name);
@@ -89,9 +136,20 @@ export const TOOLS = [
89
136
  // UI Automation Tools
90
137
  {
91
138
  name: 'tauri_driver_session',
92
- description: 'Manage automation session (start or stop). Supports remote device connections via host parameter.',
139
+ description: '[Tauri Apps Only] Start/stop automation session to connect to a RUNNING Tauri app. ' +
140
+ 'REQUIRED before using other tauri_webview_* or tauri_plugin_* tools. ' +
141
+ 'Connects via WebSocket to the MCP Bridge plugin in the Tauri app. ' +
142
+ 'For browser automation, use Chrome DevTools MCP instead. ' +
143
+ 'For Electron apps, this tool will NOT work.',
93
144
  category: TOOL_CATEGORIES.UI_AUTOMATION,
94
145
  schema: ManageDriverSessionSchema,
146
+ annotations: {
147
+ title: 'Manage Tauri Session',
148
+ readOnlyHint: false,
149
+ destructiveHint: false,
150
+ idempotentHint: true,
151
+ openWorldHint: false,
152
+ },
95
153
  handler: async (args) => {
96
154
  const parsed = ManageDriverSessionSchema.parse(args);
97
155
  return await manageDriverSession(parsed.action, parsed.host, parsed.port);
@@ -99,29 +157,58 @@ export const TOOLS = [
99
157
  },
100
158
  {
101
159
  name: 'tauri_webview_find_element',
102
- description: 'Find elements',
160
+ description: '[Tauri Apps Only] Find DOM elements in a running Tauri app\'s webview. ' +
161
+ 'Requires active tauri_driver_session. ' +
162
+ 'For browser pages or documentation sites, use Chrome DevTools MCP instead.',
103
163
  category: TOOL_CATEGORIES.UI_AUTOMATION,
104
164
  schema: FindElementSchema,
165
+ annotations: {
166
+ title: 'Find Element in Tauri Webview',
167
+ readOnlyHint: true,
168
+ openWorldHint: false,
169
+ },
105
170
  handler: async (args) => {
106
171
  const parsed = FindElementSchema.parse(args);
107
- return await findElement(parsed.selector, parsed.strategy);
172
+ return await findElement({
173
+ selector: parsed.selector,
174
+ strategy: parsed.strategy,
175
+ windowId: parsed.windowId,
176
+ });
108
177
  },
109
178
  },
110
179
  {
111
180
  name: 'tauri_driver_get_console_logs',
112
- description: 'Get console logs',
181
+ description: '[Tauri Apps Only] Get JavaScript console logs from a running Tauri app. ' +
182
+ 'Requires active tauri_driver_session. Use for debugging Tauri webview issues. ' +
183
+ 'For browser console logs, use Chrome DevTools MCP instead.',
113
184
  category: TOOL_CATEGORIES.UI_AUTOMATION,
114
185
  schema: GetConsoleLogsSchema,
186
+ annotations: {
187
+ title: 'Get Tauri Console Logs',
188
+ readOnlyHint: true,
189
+ openWorldHint: false,
190
+ },
115
191
  handler: async (args) => {
116
192
  const parsed = GetConsoleLogsSchema.parse(args);
117
- return await getConsoleLogs(parsed.filter, parsed.since);
193
+ return await getConsoleLogs({
194
+ filter: parsed.filter,
195
+ since: parsed.since,
196
+ windowId: parsed.windowId,
197
+ });
118
198
  },
119
199
  },
120
200
  {
121
201
  name: 'tauri_read_platform_logs',
122
- description: 'Read platform logs (Android logcat, iOS device logs, or system logs)',
202
+ description: '[Tauri Mobile Apps] Read Android logcat or iOS device logs for Tauri mobile apps. ' +
203
+ 'Also reads system logs on desktop. ' +
204
+ 'Use for debugging native/platform-level issues in Tauri apps.',
123
205
  category: TOOL_CATEGORIES.UI_AUTOMATION,
124
206
  schema: ReadLogsSchema,
207
+ annotations: {
208
+ title: 'Read Platform Logs',
209
+ readOnlyHint: true,
210
+ openWorldHint: false,
211
+ },
125
212
  handler: async (args) => {
126
213
  const parsed = ReadLogsSchema.parse(args);
127
214
  return await readLogs(parsed.source, parsed.lines, parsed.filter, parsed.since);
@@ -130,9 +217,17 @@ export const TOOLS = [
130
217
  // WebView Interaction Tools
131
218
  {
132
219
  name: 'tauri_webview_interact',
133
- description: 'Perform gestures (click, double-click, long-press, swipe) or scroll',
220
+ description: '[Tauri Apps Only] Click, scroll, swipe, or perform gestures in a Tauri app webview. ' +
221
+ 'Requires active tauri_driver_session. ' +
222
+ 'For browser interaction, use Chrome DevTools MCP instead.',
134
223
  category: TOOL_CATEGORIES.UI_AUTOMATION,
135
224
  schema: InteractSchema,
225
+ annotations: {
226
+ title: 'Interact with Tauri Webview',
227
+ readOnlyHint: false,
228
+ destructiveHint: false,
229
+ openWorldHint: false,
230
+ },
136
231
  handler: async (args) => {
137
232
  const parsed = InteractSchema.parse(args);
138
233
  return await interact(parsed);
@@ -140,75 +235,155 @@ export const TOOLS = [
140
235
  },
141
236
  {
142
237
  name: 'tauri_webview_screenshot',
143
- description: 'Take a screenshot of the current viewport (visible area) of the webview. ' +
144
- '**Important**: This only captures what is currently visible. ' +
145
- 'Scroll content into view before taking screenshots if you need to capture specific elements.',
238
+ description: '[Tauri Apps Only] Screenshot a running Tauri app\'s webview. ' +
239
+ 'Requires active tauri_driver_session. Captures only visible viewport. ' +
240
+ 'For browser screenshots, use Chrome DevTools MCP instead. ' +
241
+ 'For Electron apps, this will NOT work.',
146
242
  category: TOOL_CATEGORIES.UI_AUTOMATION,
147
243
  schema: ScreenshotSchema,
244
+ annotations: {
245
+ title: 'Screenshot Tauri Webview',
246
+ readOnlyHint: true,
247
+ openWorldHint: false,
248
+ },
148
249
  handler: async (args) => {
149
250
  const parsed = ScreenshotSchema.parse(args);
150
- return await screenshot(parsed.quality, parsed.format);
251
+ return await screenshot({
252
+ quality: parsed.quality,
253
+ format: parsed.format,
254
+ windowId: parsed.windowId,
255
+ });
151
256
  },
152
257
  },
153
258
  {
154
259
  name: 'tauri_webview_keyboard',
155
- description: 'Type text or simulate keyboard events',
260
+ description: '[Tauri Apps Only] Type text or send keyboard events in a Tauri app. ' +
261
+ 'Requires active tauri_driver_session. ' +
262
+ 'For browser keyboard input, use Chrome DevTools MCP instead.',
156
263
  category: TOOL_CATEGORIES.UI_AUTOMATION,
157
264
  schema: KeyboardSchema,
265
+ annotations: {
266
+ title: 'Keyboard Input in Tauri',
267
+ readOnlyHint: false,
268
+ destructiveHint: false,
269
+ openWorldHint: false,
270
+ },
158
271
  handler: async (args) => {
159
272
  const parsed = KeyboardSchema.parse(args);
160
273
  if (parsed.action === 'type') {
161
- return await keyboard(parsed.action, parsed.selector, parsed.text);
274
+ return await keyboard({
275
+ action: parsed.action,
276
+ selectorOrKey: parsed.selector,
277
+ textOrModifiers: parsed.text,
278
+ windowId: parsed.windowId,
279
+ });
162
280
  }
163
- return await keyboard(parsed.action, parsed.key, parsed.modifiers);
281
+ return await keyboard({
282
+ action: parsed.action,
283
+ selectorOrKey: parsed.key,
284
+ textOrModifiers: parsed.modifiers,
285
+ windowId: parsed.windowId,
286
+ });
164
287
  },
165
288
  },
166
289
  {
167
290
  name: 'tauri_webview_wait_for',
168
- description: 'Wait for elements, text, or events',
291
+ description: '[Tauri Apps Only] Wait for elements, text, or IPC events in a Tauri app. ' +
292
+ 'Requires active tauri_driver_session. ' +
293
+ 'For browser waits, use Chrome DevTools MCP instead.',
169
294
  category: TOOL_CATEGORIES.UI_AUTOMATION,
170
295
  schema: WaitForSchema,
296
+ annotations: {
297
+ title: 'Wait for Condition in Tauri',
298
+ readOnlyHint: true,
299
+ openWorldHint: false,
300
+ },
171
301
  handler: async (args) => {
172
302
  const parsed = WaitForSchema.parse(args);
173
- return await waitFor(parsed.type, parsed.value, parsed.timeout);
303
+ return await waitFor({
304
+ type: parsed.type,
305
+ value: parsed.value,
306
+ timeout: parsed.timeout,
307
+ windowId: parsed.windowId,
308
+ });
174
309
  },
175
310
  },
176
311
  {
177
312
  name: 'tauri_webview_get_styles',
178
- description: 'Get computed CSS styles',
313
+ description: '[Tauri Apps Only] Get computed CSS styles from elements in a Tauri app. ' +
314
+ 'Requires active tauri_driver_session. ' +
315
+ 'For browser style inspection, use Chrome DevTools MCP instead.',
179
316
  category: TOOL_CATEGORIES.UI_AUTOMATION,
180
317
  schema: GetStylesSchema,
318
+ annotations: {
319
+ title: 'Get Styles in Tauri Webview',
320
+ readOnlyHint: true,
321
+ openWorldHint: false,
322
+ },
181
323
  handler: async (args) => {
182
324
  const parsed = GetStylesSchema.parse(args);
183
- return await getStyles(parsed.selector, parsed.properties, parsed.multiple);
325
+ return await getStyles({
326
+ selector: parsed.selector,
327
+ properties: parsed.properties,
328
+ multiple: parsed.multiple,
329
+ windowId: parsed.windowId,
330
+ });
184
331
  },
185
332
  },
186
333
  {
187
334
  name: 'tauri_webview_execute_js',
188
- description: 'Execute JavaScript in webview',
335
+ description: '[Tauri Apps Only] Execute JavaScript in a Tauri app\'s webview context. ' +
336
+ 'Requires active tauri_driver_session. Has access to window.__TAURI__. ' +
337
+ 'For browser JS execution, use Chrome DevTools MCP instead.',
189
338
  category: TOOL_CATEGORIES.UI_AUTOMATION,
190
339
  schema: ExecuteJavaScriptSchema,
340
+ annotations: {
341
+ title: 'Execute JS in Tauri Webview',
342
+ readOnlyHint: false,
343
+ destructiveHint: false,
344
+ openWorldHint: false,
345
+ },
191
346
  handler: async (args) => {
192
347
  const parsed = ExecuteJavaScriptSchema.parse(args);
193
- return await executeJavaScript(parsed.script, parsed.args);
348
+ return await executeJavaScript({
349
+ script: parsed.script,
350
+ args: parsed.args,
351
+ windowId: parsed.windowId,
352
+ });
194
353
  },
195
354
  },
196
355
  {
197
356
  name: 'tauri_webview_focus_element',
198
- description: 'Focus on specific elements',
357
+ description: '[Tauri Apps Only] Focus a DOM element in a Tauri app\'s webview. ' +
358
+ 'Requires active tauri_driver_session. ' +
359
+ 'For browser focus, use Chrome DevTools MCP instead.',
199
360
  category: TOOL_CATEGORIES.UI_AUTOMATION,
200
361
  schema: FocusElementSchema,
362
+ annotations: {
363
+ title: 'Focus Element in Tauri',
364
+ readOnlyHint: false,
365
+ destructiveHint: false,
366
+ openWorldHint: false,
367
+ },
201
368
  handler: async (args) => {
202
369
  const parsed = FocusElementSchema.parse(args);
203
- return await focusElement(parsed.selector);
370
+ return await focusElement({ selector: parsed.selector, windowId: parsed.windowId });
204
371
  },
205
372
  },
206
373
  // IPC & Plugin Tools
207
374
  {
208
375
  name: 'tauri_plugin_execute_ipc',
209
- description: 'Execute Tauri IPC commands',
376
+ description: '[Tauri Apps Only] Execute Tauri IPC commands (invoke Rust backend functions). ' +
377
+ 'Requires active tauri_driver_session. This is Tauri-specific IPC, not browser APIs. ' +
378
+ 'For Electron IPC or browser APIs, use appropriate tools for those frameworks.',
210
379
  category: TOOL_CATEGORIES.IPC_PLUGIN,
211
380
  schema: ExecuteIPCCommandSchema,
381
+ annotations: {
382
+ title: 'Execute Tauri IPC Command',
383
+ readOnlyHint: false,
384
+ destructiveHint: false,
385
+ openWorldHint: false,
386
+ },
212
387
  handler: async (args) => {
213
388
  const parsed = ExecuteIPCCommandSchema.parse(args);
214
389
  return await executeIPCCommand(parsed.command, parsed.args);
@@ -216,19 +391,34 @@ export const TOOLS = [
216
391
  },
217
392
  {
218
393
  name: 'tauri_plugin_get_window_info',
219
- description: 'Get window information',
394
+ description: '[Tauri Apps Only] Get Tauri window information (size, position, state). ' +
395
+ 'Requires active tauri_driver_session. ' +
396
+ 'For browser window info, use Chrome DevTools MCP instead.',
220
397
  category: TOOL_CATEGORIES.IPC_PLUGIN,
221
398
  schema: GetWindowInfoSchema,
399
+ annotations: {
400
+ title: 'Get Tauri Window Info',
401
+ readOnlyHint: true,
402
+ openWorldHint: false,
403
+ },
222
404
  handler: async () => {
223
405
  return await getWindowInfo();
224
406
  },
225
407
  },
226
408
  {
227
409
  name: 'tauri_plugin_ipc_monitor',
228
- description: 'Start or stop IPC monitoring to capture Tauri command invocations. ' +
229
- 'Use "start" to begin capturing, then tauri_plugin_ipc_get_events to retrieve captured events.',
410
+ description: '[Tauri Apps Only] Monitor Tauri IPC calls between frontend and Rust backend. ' +
411
+ 'Requires active tauri_driver_session. Captures invoke() calls and responses. ' +
412
+ 'This is Tauri-specific; for browser network monitoring, use Chrome DevTools MCP.',
230
413
  category: TOOL_CATEGORIES.IPC_PLUGIN,
231
414
  schema: ManageIPCMonitoringSchema,
415
+ annotations: {
416
+ title: 'Monitor Tauri IPC',
417
+ readOnlyHint: false,
418
+ destructiveHint: false,
419
+ idempotentHint: true,
420
+ openWorldHint: false,
421
+ },
232
422
  handler: async (args) => {
233
423
  const parsed = ManageIPCMonitoringSchema.parse(args);
234
424
  return await manageIPCMonitoring(parsed.action);
@@ -236,11 +426,16 @@ export const TOOLS = [
236
426
  },
237
427
  {
238
428
  name: 'tauri_plugin_ipc_get_events',
239
- description: 'Retrieve IPC events captured since monitoring started. ' +
240
- 'Shows Tauri command invocations with their arguments and responses. ' +
241
- 'Requires tauri_plugin_ipc_monitor to be started first.',
429
+ description: '[Tauri Apps Only] Get captured Tauri IPC events (requires ipc_monitor started). ' +
430
+ 'Shows Tauri command invocations with arguments and responses. ' +
431
+ 'For browser network requests, use Chrome DevTools MCP instead.',
242
432
  category: TOOL_CATEGORIES.IPC_PLUGIN,
243
433
  schema: GetIPCEventsSchema,
434
+ annotations: {
435
+ title: 'Get Tauri IPC Events',
436
+ readOnlyHint: true,
437
+ openWorldHint: false,
438
+ },
244
439
  handler: async (args) => {
245
440
  const parsed = GetIPCEventsSchema.parse(args);
246
441
  return await getIPCEvents(parsed.filter);
@@ -248,10 +443,17 @@ export const TOOLS = [
248
443
  },
249
444
  {
250
445
  name: 'tauri_plugin_emit_event',
251
- description: 'Emit a custom Tauri event that can be listened to by the frontend or backend. ' +
252
- 'Useful for testing event handlers or triggering application behavior.',
446
+ description: '[Tauri Apps Only] Emit a Tauri event to test event handlers. ' +
447
+ 'Requires active tauri_driver_session. Events are Tauri-specific (not DOM events). ' +
448
+ 'For browser DOM events, use Chrome DevTools MCP instead.',
253
449
  category: TOOL_CATEGORIES.IPC_PLUGIN,
254
450
  schema: EmitTestEventSchema,
451
+ annotations: {
452
+ title: 'Emit Tauri Event',
453
+ readOnlyHint: false,
454
+ destructiveHint: false,
455
+ openWorldHint: false,
456
+ },
255
457
  handler: async (args) => {
256
458
  const parsed = EmitTestEventSchema.parse(args);
257
459
  return await emitTestEvent(parsed.eventName, parsed.payload);
@@ -259,13 +461,37 @@ export const TOOLS = [
259
461
  },
260
462
  {
261
463
  name: 'tauri_plugin_get_backend_state',
262
- description: 'Get comprehensive backend state including app metadata, Tauri version, environment info, and window list',
464
+ description: '[Tauri Apps Only] Get Tauri backend state: app metadata, Tauri version, environment. ' +
465
+ 'Requires active tauri_driver_session. ' +
466
+ 'Use to verify you\'re connected to a Tauri app and get app info.',
263
467
  category: TOOL_CATEGORIES.IPC_PLUGIN,
264
468
  schema: GetBackendStateSchema,
469
+ annotations: {
470
+ title: 'Get Tauri Backend State',
471
+ readOnlyHint: true,
472
+ openWorldHint: false,
473
+ },
265
474
  handler: async () => {
266
475
  return await getBackendState();
267
476
  },
268
477
  },
478
+ // Window Management Tools
479
+ {
480
+ name: 'tauri_list_windows',
481
+ description: '[Tauri Apps Only] List all Tauri webview windows (labels, titles, URLs, state). ' +
482
+ 'Requires active tauri_driver_session. Use to discover windows before targeting them. ' +
483
+ 'For browser tabs/windows, use Chrome DevTools MCP instead.',
484
+ category: TOOL_CATEGORIES.UI_AUTOMATION,
485
+ schema: ListWindowsSchema,
486
+ annotations: {
487
+ title: 'List Tauri Windows',
488
+ readOnlyHint: true,
489
+ openWorldHint: false,
490
+ },
491
+ handler: async () => {
492
+ return await listWindows();
493
+ },
494
+ },
269
495
  ];
270
496
  /**
271
497
  * Get tools grouped by category
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Window type definitions for multi-webview support.
3
+ */
4
+ export {};
package/package.json CHANGED
@@ -1,60 +1,60 @@
1
1
  {
2
- "name": "@hypothesi/tauri-mcp-server",
3
- "version": "0.1.2",
4
- "description": "A Model Context Protocol server for Tauri v2 development",
5
- "type": "module",
6
- "bin": {
7
- "mcp-server-tauri": "./dist/index.js"
8
- },
9
- "scripts": {
10
- "build": "tsc && cp -r src/driver/scripts/*.js dist/driver/scripts/ && chmod +x dist/index.js",
11
- "start": "node dist/index.js",
12
- "test": "vitest run",
13
- "test:unit": "vitest run --config vitest.config.unit.ts",
14
- "test:e2e": "vitest run --config vitest.config.ts",
15
- "dev": "tsc --watch",
16
- "generate:docs": "tsx scripts/generate-tools-docs.ts",
17
- "prepublishOnly": "npm run build"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/hypothesi/mcp-server-tauri.git",
22
- "directory": "packages/mcp-server"
23
- },
24
- "files": [
25
- "dist",
26
- "package.json",
27
- "README.md",
28
- "LICENSE"
29
- ],
30
- "author": "hypothesi",
31
- "license": "MIT",
32
- "keywords": [
33
- "mcp",
34
- "model-context-protocol",
35
- "tauri",
36
- "automation",
37
- "testing",
38
- "debugging",
39
- "cursor",
40
- "windsurf",
41
- "vscode"
42
- ],
43
- "dependencies": {
44
- "@modelcontextprotocol/sdk": "0.6.1",
45
- "execa": "9.6.0",
46
- "html2canvas": "1.4.1",
47
- "ws": "8.18.3",
48
- "zod": "3.25.76",
49
- "zod-to-json-schema": "3.25.0"
50
- },
51
- "devDependencies": {
52
- "@types/html2canvas": "0.5.35",
53
- "@types/node": "22.19.1",
54
- "@types/ws": "8.18.1",
55
- "vitest": "4.0.13"
56
- },
57
- "publishConfig": {
58
- "access": "public"
59
- }
2
+ "name": "@hypothesi/tauri-mcp-server",
3
+ "version": "0.2.0",
4
+ "description": "A Model Context Protocol server for Tauri v2 development",
5
+ "type": "module",
6
+ "bin": {
7
+ "mcp-server-tauri": "./dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc && cp -r src/driver/scripts/*.js dist/driver/scripts/ && chmod +x dist/index.js",
11
+ "start": "node dist/index.js",
12
+ "test": "vitest run",
13
+ "test:unit": "vitest run --config vitest.config.unit.ts",
14
+ "test:e2e": "vitest run --config vitest.config.ts",
15
+ "dev": "tsc --watch",
16
+ "generate:docs": "tsx scripts/generate-tools-docs.ts",
17
+ "prepublishOnly": "npm run build"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/hypothesi/mcp-server-tauri.git",
22
+ "directory": "packages/mcp-server"
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "package.json",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "author": "hypothesi",
31
+ "license": "MIT",
32
+ "keywords": [
33
+ "mcp",
34
+ "model-context-protocol",
35
+ "tauri",
36
+ "automation",
37
+ "testing",
38
+ "debugging",
39
+ "cursor",
40
+ "windsurf",
41
+ "vscode"
42
+ ],
43
+ "dependencies": {
44
+ "@modelcontextprotocol/sdk": "0.6.1",
45
+ "execa": "9.6.0",
46
+ "html2canvas": "1.4.1",
47
+ "ws": "8.18.3",
48
+ "zod": "3.25.76",
49
+ "zod-to-json-schema": "3.25.0"
50
+ },
51
+ "devDependencies": {
52
+ "@types/html2canvas": "0.5.35",
53
+ "@types/node": "22.19.1",
54
+ "@types/ws": "8.18.1",
55
+ "vitest": "4.0.13"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public"
59
+ }
60
60
  }