flutter-skill-mcp 0.2.13 → 0.2.14
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 +288 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,70 +1,320 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Flutter Skill
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **Give your AI Agent eyes and hands inside your Flutter app.**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
**Flutter Skill** is a bridge that connects AI Agents (like Claude Code, Cursor, Windsurf) directly to running Flutter applications via the MCP (Model Context Protocol). It provides 30+ tools for UI automation, inspection, and testing.
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
### 1. Install (choose one)
|
|
9
15
|
|
|
10
16
|
```bash
|
|
17
|
+
# npm (recommended - includes native binary for instant startup)
|
|
11
18
|
npm install -g flutter-skill-mcp
|
|
12
|
-
# or use directly with npx
|
|
13
|
-
npx flutter-skill-mcp
|
|
14
|
-
```
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
# Homebrew (macOS/Linux)
|
|
21
|
+
brew tap ai-dashboad/flutter-skill
|
|
22
|
+
brew install flutter-skill
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
# Dart
|
|
25
|
+
dart pub global activate flutter_skill
|
|
26
|
+
|
|
27
|
+
# IDE Extensions
|
|
28
|
+
# - VSCode: Search "Flutter Skill" in Extensions
|
|
29
|
+
# - IntelliJ/Android Studio: Search "Flutter Skill" in Plugins
|
|
30
|
+
```
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
### 2. Configure AI Agent
|
|
21
33
|
|
|
34
|
+
Add to your AI agent's MCP config:
|
|
35
|
+
|
|
36
|
+
**Claude Code** (`~/.claude/settings.json`):
|
|
22
37
|
```json
|
|
23
38
|
{
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"flutter-skill": {
|
|
41
|
+
"command": "flutter-skill",
|
|
42
|
+
"args": ["server"]
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
45
|
}
|
|
29
46
|
```
|
|
30
47
|
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
**Cursor** (`~/.cursor/mcp.json`):
|
|
33
49
|
```json
|
|
34
50
|
{
|
|
35
|
-
"
|
|
36
|
-
"
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"flutter-skill": {
|
|
53
|
+
"command": "flutter-skill",
|
|
54
|
+
"args": ["server"]
|
|
55
|
+
}
|
|
37
56
|
}
|
|
38
57
|
}
|
|
39
58
|
```
|
|
40
59
|
|
|
60
|
+
### 3. Use
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
// Option 1: Launch app with environment variables
|
|
64
|
+
flutter-skill.launch_app({
|
|
65
|
+
project_path: "/path/to/flutter/project",
|
|
66
|
+
dart_defines: ["ENV=staging", "DEBUG=true"],
|
|
67
|
+
flavor: "staging"
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// Option 2: Connect to already running app (auto-detect)
|
|
71
|
+
flutter-skill.scan_and_connect()
|
|
72
|
+
|
|
73
|
+
// Now use any tool
|
|
74
|
+
flutter-skill.screenshot()
|
|
75
|
+
flutter-skill.tap({ text: "Login" })
|
|
76
|
+
flutter-skill.inspect()
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
41
81
|
## Features
|
|
42
82
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
83
|
+
### App Lifecycle Management
|
|
84
|
+
| Tool | Description |
|
|
85
|
+
|------|-------------|
|
|
86
|
+
| `launch_app` | Launch Flutter app with dart_defines, flavor, target, extra_args |
|
|
87
|
+
| `scan_and_connect` | Auto-scan ports and connect to first running Flutter app |
|
|
88
|
+
| `list_running_apps` | List all running Flutter apps (VM Services) |
|
|
89
|
+
| `connect_app` | Connect to specific VM Service URI |
|
|
90
|
+
| `stop_app` | Stop the currently running app |
|
|
91
|
+
| `disconnect` | Disconnect without stopping the app |
|
|
92
|
+
| `get_connection_status` | Get connection info and suggestions |
|
|
93
|
+
| `hot_reload` | Fast reload (keeps state) |
|
|
94
|
+
| `hot_restart` | Full restart (resets state) |
|
|
95
|
+
|
|
96
|
+
### UI Inspection
|
|
97
|
+
| Tool | Description |
|
|
98
|
+
|------|-------------|
|
|
99
|
+
| `inspect` | Get interactive elements (buttons, text fields, etc.) |
|
|
100
|
+
| `get_widget_tree` | Get widget tree structure with depth control |
|
|
101
|
+
| `get_widget_properties` | Get properties of a widget (size, position, visibility) |
|
|
102
|
+
| `get_text_content` | Extract all visible text from the screen |
|
|
103
|
+
| `find_by_type` | Find widgets by type (e.g., ElevatedButton) |
|
|
104
|
+
|
|
105
|
+
### Interactions
|
|
106
|
+
| Tool | Description |
|
|
107
|
+
|------|-------------|
|
|
108
|
+
| `tap` | Tap a widget by Key or Text |
|
|
109
|
+
| `double_tap` | Double tap a widget |
|
|
110
|
+
| `long_press` | Long press with configurable duration |
|
|
111
|
+
| `swipe` | Swipe gesture (up/down/left/right) |
|
|
112
|
+
| `drag` | Drag from one element to another |
|
|
113
|
+
| `scroll_to` | Scroll to make an element visible |
|
|
114
|
+
| `enter_text` | Enter text into a text field |
|
|
115
|
+
|
|
116
|
+
### State & Validation
|
|
117
|
+
| Tool | Description |
|
|
118
|
+
|------|-------------|
|
|
119
|
+
| `get_text_value` | Get current value of a text field |
|
|
120
|
+
| `get_checkbox_state` | Get checked state of a checkbox/switch |
|
|
121
|
+
| `get_slider_value` | Get current value of a slider |
|
|
122
|
+
| `wait_for_element` | Wait for an element to appear (with timeout) |
|
|
123
|
+
| `wait_for_gone` | Wait for an element to disappear |
|
|
124
|
+
|
|
125
|
+
### Screenshots
|
|
126
|
+
| Tool | Description |
|
|
127
|
+
|------|-------------|
|
|
128
|
+
| `screenshot` | Take full app screenshot (returns base64) |
|
|
129
|
+
| `screenshot_element` | Take screenshot of specific element |
|
|
130
|
+
|
|
131
|
+
### Navigation
|
|
132
|
+
| Tool | Description |
|
|
133
|
+
|------|-------------|
|
|
134
|
+
| `get_current_route` | Get the current route name |
|
|
135
|
+
| `go_back` | Navigate back |
|
|
136
|
+
| `get_navigation_stack` | Get the navigation stack |
|
|
137
|
+
|
|
138
|
+
### Debug & Logs
|
|
139
|
+
| Tool | Description |
|
|
140
|
+
|------|-------------|
|
|
141
|
+
| `get_logs` | Get application logs |
|
|
142
|
+
| `get_errors` | Get application errors |
|
|
143
|
+
| `clear_logs` | Clear logs and errors |
|
|
144
|
+
| `get_performance` | Get performance metrics |
|
|
145
|
+
|
|
146
|
+
### Utilities
|
|
147
|
+
| Tool | Description |
|
|
148
|
+
|------|-------------|
|
|
149
|
+
| `pub_search` | Search Flutter packages on pub.dev |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Installation Methods
|
|
154
|
+
|
|
155
|
+
| Method | Command | Auto-Update | Native Binary |
|
|
156
|
+
|--------|---------|-------------|---------------|
|
|
157
|
+
| npm | `npm install -g flutter-skill-mcp` | Manual | Auto-download |
|
|
158
|
+
| Homebrew | `brew install ai-dashboad/flutter-skill/flutter-skill` | `brew upgrade` | Pre-compiled |
|
|
159
|
+
| VSCode | Extensions → "Flutter Skill" | Auto | Auto-download |
|
|
160
|
+
| IntelliJ | Plugins → "Flutter Skill" | Auto | Auto-download |
|
|
161
|
+
| pub.dev | `dart pub global activate flutter_skill` | Manual | Dart runtime |
|
|
162
|
+
|
|
163
|
+
### Native Binary Performance
|
|
164
|
+
| Version | Startup Time |
|
|
165
|
+
|---------|--------------|
|
|
166
|
+
| Dart JIT | ~1 second |
|
|
167
|
+
| Native Binary | ~0.01 second |
|
|
168
|
+
|
|
169
|
+
Native binaries are automatically downloaded on first use for supported platforms:
|
|
170
|
+
- macOS (Apple Silicon & Intel)
|
|
171
|
+
- Linux (x64)
|
|
172
|
+
- Windows (x64)
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Flutter App Setup
|
|
177
|
+
|
|
178
|
+
For the MCP tools to work, your Flutter app needs the `flutter_skill` package:
|
|
179
|
+
|
|
180
|
+
### Automatic Setup (Recommended)
|
|
181
|
+
```bash
|
|
182
|
+
flutter-skill launch /path/to/project
|
|
183
|
+
# Automatically adds dependency and initializes
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Manual Setup
|
|
187
|
+
1. Add dependency:
|
|
188
|
+
```yaml
|
|
189
|
+
dependencies:
|
|
190
|
+
flutter_skill: ^0.2.13
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
2. Initialize in main.dart:
|
|
194
|
+
```dart
|
|
195
|
+
import 'package:flutter_skill/flutter_skill.dart';
|
|
196
|
+
|
|
197
|
+
void main() {
|
|
198
|
+
FlutterSkillBinding.ensureInitialized();
|
|
199
|
+
runApp(MyApp());
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Example Workflows
|
|
206
|
+
|
|
207
|
+
### E2E Testing with Environment Variables
|
|
208
|
+
```javascript
|
|
209
|
+
// Launch staging environment
|
|
210
|
+
flutter-skill.launch_app({
|
|
211
|
+
project_path: "./",
|
|
212
|
+
dart_defines: ["ENV=staging", "API_URL=https://staging.api.com"],
|
|
213
|
+
flavor: "staging",
|
|
214
|
+
target: "lib/main_staging.dart"
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
// Wait for app to load
|
|
218
|
+
flutter-skill.wait_for_element({ text: "Welcome" })
|
|
219
|
+
|
|
220
|
+
// Take screenshot
|
|
221
|
+
flutter-skill.screenshot()
|
|
222
|
+
|
|
223
|
+
// Perform login
|
|
224
|
+
flutter-skill.tap({ text: "Login" })
|
|
225
|
+
flutter-skill.enter_text({ key: "email_field", text: "test@example.com" })
|
|
226
|
+
flutter-skill.enter_text({ key: "password_field", text: "password123" })
|
|
227
|
+
flutter-skill.tap({ text: "Submit" })
|
|
228
|
+
|
|
229
|
+
// Verify success
|
|
230
|
+
flutter-skill.wait_for_element({ text: "Dashboard" })
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Connect to Running App
|
|
234
|
+
```javascript
|
|
235
|
+
// List all running Flutter apps
|
|
236
|
+
flutter-skill.list_running_apps()
|
|
237
|
+
// Returns: { apps: ["ws://127.0.0.1:50123/ws", ...], count: 2 }
|
|
238
|
+
|
|
239
|
+
// Auto-connect to first one
|
|
240
|
+
flutter-skill.scan_and_connect()
|
|
241
|
+
|
|
242
|
+
// Or connect to specific one
|
|
243
|
+
flutter-skill.connect_app({ uri: "ws://127.0.0.1:50123/ws" })
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Debug a UI Issue
|
|
247
|
+
```javascript
|
|
248
|
+
// Get widget tree
|
|
249
|
+
flutter-skill.get_widget_tree({ max_depth: 5 })
|
|
250
|
+
|
|
251
|
+
// Find specific widgets
|
|
252
|
+
flutter-skill.find_by_type({ type: "ElevatedButton" })
|
|
253
|
+
|
|
254
|
+
// Inspect interactive elements
|
|
255
|
+
flutter-skill.inspect()
|
|
256
|
+
|
|
257
|
+
// Check if element is visible
|
|
258
|
+
flutter-skill.wait_for_element({ key: "submit_button", timeout: 3000 })
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## IDE Extensions
|
|
264
|
+
|
|
265
|
+
### VSCode Extension
|
|
266
|
+
- Auto-detects Flutter projects
|
|
267
|
+
- Prompts to add `flutter_skill` dependency
|
|
268
|
+
- Auto-downloads native binary
|
|
269
|
+
- Status bar shows connection state
|
|
270
|
+
- Commands: Launch, Inspect, Screenshot
|
|
271
|
+
|
|
272
|
+
### IntelliJ/Android Studio Plugin
|
|
273
|
+
- Same features as VSCode
|
|
274
|
+
- Integrates with IDE notifications
|
|
275
|
+
- Tool window for status
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Troubleshooting
|
|
280
|
+
|
|
281
|
+
### "Not connected to Flutter app"
|
|
282
|
+
```javascript
|
|
283
|
+
// Check status and get suggestions
|
|
284
|
+
flutter-skill.get_connection_status()
|
|
285
|
+
|
|
286
|
+
// This returns:
|
|
287
|
+
// - Current connection state
|
|
288
|
+
// - List of available apps
|
|
289
|
+
// - Actionable suggestions
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### "Unknown method ext.flutter.flutter_skill.xxx"
|
|
293
|
+
Your Flutter app doesn't have the `flutter_skill` package. Add it:
|
|
294
|
+
```bash
|
|
295
|
+
flutter pub add flutter_skill
|
|
296
|
+
```
|
|
297
|
+
Then restart the app (hot reload is not enough).
|
|
298
|
+
|
|
299
|
+
### MCP server slow to start
|
|
300
|
+
The native binary should auto-download. If not:
|
|
301
|
+
```bash
|
|
302
|
+
# For npm
|
|
303
|
+
npm update -g flutter-skill-mcp
|
|
304
|
+
|
|
305
|
+
# For Homebrew
|
|
306
|
+
brew upgrade flutter-skill
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
---
|
|
62
310
|
|
|
63
311
|
## Links
|
|
64
312
|
|
|
65
313
|
- [GitHub](https://github.com/ai-dashboad/flutter-skill)
|
|
66
314
|
- [pub.dev](https://pub.dev/packages/flutter_skill)
|
|
67
|
-
- [
|
|
315
|
+
- [npm](https://www.npmjs.com/package/flutter-skill-mcp)
|
|
316
|
+
- [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=ai-dashboad.flutter-skill)
|
|
317
|
+
- [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/PLUGIN_ID)
|
|
68
318
|
|
|
69
319
|
## License
|
|
70
320
|
|