Debug a Flutter render error with AI eyes on the running app
When to use: You're iterating on UI and something broke. Instead of describing it, let the AI see the screenshot + errors.
Prerequisites
- Flutter app with
mcp_toolkitpackage — Add to pubspec.yaml and initialize in main() - Running in debug mode — flutter run — the server connects to Dart VM service
Flow
-
ConnectConnect to my running Flutter app (VM port 8181) via mcp_flutter.✓ Copied→ Tools list now includes get_app_errors, view_screenshot
-
Capture stateTake a screenshot of the current view. Also pull any errors from the last 60 seconds.✓ Copied→ Screenshot + error log
-
Suggest fixBased on this error and screenshot, what's wrong and how do I fix it?✓ Copied→ Code diff proposal
Outcome: Tight debug loop where the AI can verify each fix by looking at the next screenshot.
Pitfalls
- Screenshot tool disabled by default — Start the server with
--imagesflag - VM port conflicts when running multiple apps — Specify
--vm-service-portper app; default 8181