flan_mcp
The MCP server component of Flan. Connects AI coding agents (Cursor, Claude Code, Copilot, Gemini CLI, etc.) to running Flutter applications.
This package provides the MCP server that translates agent tool calls into Flutter VM service extension calls. It's the bridge between your AI tool and your running app.
For the full documentation, including the in-app command center, widget inspector, annotations, and the developer-agent feedback loop, see the main README.
Installation
Activate as a global tool (recommended):
dart pub global activate flan_mcp
Or add as a dev-dependency:
dart pub add dev:flan_mcp
Configuration
Add to your AI tool's MCP configuration:
Cursor
{
"mcpServers": {
"flan": {
"command": "flan_mcp",
"args": []
}
}
}
Claude Code
claude mcp add --transport stdio flan -- flan_mcp
Copilot
{
"servers": {
"flan": {
"command": "flan_mcp",
"args": []
}
}
}
Gemini CLI
{
"mcpServers": {
"flan": {
"command": "flan_mcp",
"args": []
}
}
}
Available Tools
Connection
| Tool | Description |
|---|---|
connect |
Connect to a Flutter app via VM service URI |
disconnect |
Disconnect from the app |
Interaction
| Tool | Description |
|---|---|
tap |
Tap an element by key, text, widget type, or coordinates |
enter_text |
Type into a text field |
scroll_to |
Scroll until an element is visible |
Inspection
| Tool | Description |
|---|---|
get_interactive_elements |
List all interactive UI elements on screen |
take_screenshots |
Capture screenshots of all views |
get_logs |
Retrieve application logs |
inspect_widget_at |
Inspect a widget at specific coordinates |
get_inspector_selection |
Get the currently selected widget's details |
Inspector & Annotations
| Tool | Description |
|---|---|
enable_inspector / disable_inspector |
Toggle widget inspector mode |
enable_annotations / disable_annotations |
Toggle annotation mode |
get_annotations |
Retrieve all annotations |
add_annotation |
Create an annotation programmatically |
clear_annotations |
Remove all annotations |
User Communication
| Tool | Description |
|---|---|
get_user_message |
Retrieve queued messages from the app user |
watch_flan |
Block and wait for the next user message |
Development
| Tool | Description |
|---|---|
hot_reload |
Apply code changes without losing state |
hot_restart |
Full restart, resets all state |
Requirements
- Dart SDK >= 3.10
- The Flutter app must include
flan_flutterand initializeFlanBinding
License
Apache License 2.0 - see the LICENSE file for details.