@hypothesi/tauri-mcp-server 0.7.0 → 0.8.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.
- package/README.md +31 -24
- package/dist/driver/scripts/aria-api-loader.js +29 -0
- package/dist/driver/scripts/aria-api.bundle.js +1295 -0
- package/dist/driver/scripts/dom-snapshot.js +536 -0
- package/dist/driver/scripts/find-element.js +10 -2
- package/dist/driver/scripts/focus.js +17 -4
- package/dist/driver/scripts/get-styles.js +23 -4
- package/dist/driver/scripts/index.js +1 -0
- package/dist/driver/scripts/interact.js +20 -9
- package/dist/driver/scripts/wait-for.js +15 -2
- package/dist/driver/session-manager.js +2 -2
- package/dist/driver/webview-executor.js +5 -5
- package/dist/driver/webview-interactions.js +39 -3
- package/dist/prompts-registry.js +5 -5
- package/dist/tools-registry.js +65 -35
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -65,59 +65,66 @@ The MCP server supports connecting to multiple Tauri apps simultaneously. Each a
|
|
|
65
65
|
**Example Usage:**
|
|
66
66
|
```javascript
|
|
67
67
|
// Connect to first app
|
|
68
|
-
await
|
|
68
|
+
await driver_session({ action: "start", port: 9223 })
|
|
69
69
|
|
|
70
70
|
// Connect to second app
|
|
71
|
-
await
|
|
71
|
+
await driver_session({ action: "start", port: 9224 })
|
|
72
72
|
|
|
73
73
|
// Check status - shows both apps with default indicator
|
|
74
|
-
await
|
|
74
|
+
await driver_session({ action: "status" })
|
|
75
75
|
|
|
76
76
|
// Use default app (most recent - port 9224)
|
|
77
|
-
await
|
|
77
|
+
await webview_screenshot()
|
|
78
78
|
|
|
79
79
|
// Target specific app by port
|
|
80
|
-
await
|
|
80
|
+
await webview_screenshot({ appIdentifier: 9223 })
|
|
81
81
|
|
|
82
82
|
// Stop specific app
|
|
83
|
-
await
|
|
83
|
+
await driver_session({ action: "stop", appIdentifier: 9223 })
|
|
84
84
|
|
|
85
85
|
// Stop all apps
|
|
86
|
-
await
|
|
86
|
+
await driver_session({ action: "stop" })
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
## Available Tools (
|
|
89
|
+
## Available Tools (18 total)
|
|
90
|
+
|
|
91
|
+
### Setup & Configuration
|
|
92
|
+
|
|
93
|
+
| Tool | Description |
|
|
94
|
+
|------|-------------|
|
|
95
|
+
| `get_setup_instructions` | Get setup/update instructions for the MCP Bridge plugin |
|
|
90
96
|
|
|
91
97
|
### UI Automation
|
|
92
98
|
|
|
93
99
|
| Tool | Description |
|
|
94
100
|
|------|-------------|
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
101
|
+
| `driver_session` | Start/stop/status automation session |
|
|
102
|
+
| `webview_find_element` | Find elements by CSS selector, XPath, text, or ref ID |
|
|
103
|
+
| `read_logs` | Read console, Android, iOS, or system logs |
|
|
104
|
+
| `webview_interact` | Click, scroll, swipe, focus, long-press |
|
|
105
|
+
| `webview_screenshot` | Capture webview screenshots (JPEG default) |
|
|
106
|
+
| `webview_keyboard` | Type text or send key events |
|
|
107
|
+
| `webview_wait_for` | Wait for elements, text, or events |
|
|
108
|
+
| `webview_get_styles` | Get computed CSS styles |
|
|
109
|
+
| `webview_execute_js` | Execute JavaScript in webview |
|
|
110
|
+
| `webview_dom_snapshot` | Get structured DOM snapshot (accessibility or structure) |
|
|
111
|
+
| `manage_window` | List windows, get info, or resize |
|
|
105
112
|
|
|
106
113
|
### IPC & Plugin
|
|
107
114
|
|
|
108
115
|
| Tool | Description |
|
|
109
116
|
|------|-------------|
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
117
|
+
| `ipc_execute_command` | Execute Tauri IPC commands |
|
|
118
|
+
| `ipc_get_backend_state` | Get app metadata and state |
|
|
119
|
+
| `ipc_monitor` | Start/stop IPC monitoring |
|
|
120
|
+
| `ipc_get_captured` | Get captured IPC traffic |
|
|
121
|
+
| `ipc_emit_event` | Emit custom events |
|
|
115
122
|
|
|
116
123
|
### Mobile Development
|
|
117
124
|
|
|
118
125
|
| Tool | Description |
|
|
119
126
|
|------|-------------|
|
|
120
|
-
| `
|
|
127
|
+
| `list_devices` | List Android devices and iOS simulators |
|
|
121
128
|
|
|
122
129
|
## Links
|
|
123
130
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* aria-api library loader
|
|
3
|
+
*
|
|
4
|
+
* Bundles aria-api for browser injection. Provides comprehensive W3C-compliant
|
|
5
|
+
* accessibility computation including:
|
|
6
|
+
* - WAI-ARIA 1.3 role computation
|
|
7
|
+
* - HTML-AAM 1.0 implicit role mappings
|
|
8
|
+
* - Accessible Name and Description Computation 1.2
|
|
9
|
+
* - aria-owns relationship handling
|
|
10
|
+
*/
|
|
11
|
+
import { readFileSync } from 'fs';
|
|
12
|
+
import { dirname, join } from 'path';
|
|
13
|
+
import { fileURLToPath } from 'url';
|
|
14
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
let ariaApiSource = null;
|
|
16
|
+
/** Script ID used for the aria-api library in the script registry. */
|
|
17
|
+
export const ARIA_API_SCRIPT_ID = '__mcp_aria_api__';
|
|
18
|
+
/**
|
|
19
|
+
* Get the aria-api library source code.
|
|
20
|
+
* Loaded lazily and cached.
|
|
21
|
+
*/
|
|
22
|
+
export function getAriaApiSource() {
|
|
23
|
+
if (ariaApiSource === null) {
|
|
24
|
+
// Load pre-bundled aria-api (created by build script)
|
|
25
|
+
const bundlePath = join(currentDir, 'aria-api.bundle.js');
|
|
26
|
+
ariaApiSource = readFileSync(bundlePath, 'utf-8');
|
|
27
|
+
}
|
|
28
|
+
return ariaApiSource;
|
|
29
|
+
}
|