Symptoms:
get_extension_rpcsdoes not include:ext.mcp.toolkit.app_errorsext.mcp.toolkit.view_detailsext.mcp.toolkit.view_screenshotsext.mcp.toolkit.inspect_widget_at_point
get_screenshots,get_view_details, orget_app_errorsfail even though VM connection works.
Fix:
- Ensure app dependency:
flutter pub add mcp_toolkit - Ensure initialization runs before
runApp:
dart
MCPToolkitBinding.instance
..initialize()
..initializeFlutterToolkit();- Restart app in debug mode and re-run
get_extension_rpcs. - Retry runtime tools only after extension RPCs appear.
If the app cannot be modified, state that Flutter MCP cannot attach toolkit extensions to this app and do not claim screenshot/layout/error inspection succeeded.
Cause: multiple debug targets found.
Fix:
- Read
availableTargetsfrom the response. - Retry with:
json
{
"arguments": {
"connection": {
"targetId": "ws://127.0.0.1:59490/<token>/ws"
}
}
}Cause: targetId does not match discovered targets for this moment.
Fix:
- Prefer
connection.uriwith exact machineapp.debugPort.wsUri. - Or refresh
discover_debug_apps/availableTargetsand copy onetargetIdexactly. - Never use plain
host:portastargetId.
Example retry:
json
{
"arguments": {
"connection": {
"uri": "ws://127.0.0.1:59490/<token>/ws"
}
}
}Cause: discovery scans processes named dart/flutter. A desktop app hosts its
VM service inside its own native process (my_app, Runner.exe), and an app
started with --no-dds has no Dart process at all, so neither shows up.
Fix:
- Start the app on a known port, for example
flutter run -d macos --device-vmservice-port=8765. - Pass that port to the server or CLI:
--scan-ports=8765(lists and ranges work too:--scan-ports=8765-8767,9100). - Re-run
discover_debug_apps; probed ports are verified like any other candidate, so only real Flutter VM services are listed.
Machine discovery (--flutter-project-dir) and an explicit
connection.uri remain available when ports are unknown.
- Restart the AI client after MCP config changes.
- Ensure JSON syntax is valid.
- Verify
commandpoints to existing compiled binary. - Confirm Flutter app is running in debug mode.
- Run
flutter-mcp-toolkit doctor --jsonto check environment prerequisites.
- Ensure
--imagesis enabled. - For clients with limited resource support, use
--no-resourcesand call tool variants. - For file-based image workflows (for example RooCode), use
--save-images. - Verify toolkit extension
ext.mcp.toolkit.view_screenshotsis present.
- Ensure
--resourcesis enabled (or callget_view_detailstool variant). - Verify toolkit extension
ext.mcp.toolkit.view_detailsis present. - If multiple apps are running, pin target with
arguments.connection.uri. - Retry after hot restart if the app was just instrumented.
- Verify toolkit extension
ext.mcp.toolkit.inspect_widget_at_pointis present. - Retry with explicit target selection (
arguments.connection.targetIdorarguments.connection.uri). - Confirm provided
xandyare global logical coordinates.
- Verify
MCPToolkitBinding.instance.addEntries(...)is called. - Hot reload or restart the Flutter app.
- Use
fmt_list_client_tools_and_resourcesto verify registration.
