● Сообщество
Arenukvern
⚡ Сразу
mcp_flutter
автор Arenukvern · Arenukvern/mcp_flutter
Let Claude (or Cursor) inspect your running Flutter app — errors, screenshots, widget tree — via the Dart VM service, with dynamic custom tools you register in-app.
mcp_flutter pairs an MCP server with a mcp_toolkit Dart package that runs inside your Flutter app in debug mode. Together they expose app errors, screenshots, view details, and any custom tools your app registers at runtime — directly to AI coding assistants.
Зачем использовать
Ключевые функции
get_app_errors — condensed error info from the running appview_screenshot — real screenshots (enable with --images)get_view_details — screen size, pixel ratio, widget info- Dynamic tool registration — your app registers bespoke tools at runtime
- Works with Cursor, Claude (Desktop/Code), Cline, Windsurf via stdio
Живое демо
Как выглядит на практике
Сценарии использования
Реальные сценарии: mcp_flutter
Когда использовать: You're iterating on UI and something broke. Instead of describing it, let the AI see the screenshot + errors.
Предварительные требования
- Flutter app with
mcp_toolkit package — Add to pubspec.yaml and initialize in main() - Running in debug mode — flutter run — the server connects to Dart VM service
Поток
-
Connect
Connect to my running Flutter app (VM port 8181) via mcp_flutter.✓ Скопировано
→ Tools list now includes get_app_errors, view_screenshot
-
Capture state
Take a screenshot of the current view. Also pull any errors from the last 60 seconds.✓ Скопировано
→ Screenshot + error log
-
Suggest fix
Based on this error and screenshot, what's wrong and how do I fix it?✓ Скопировано
→ Code diff proposal
Итог: Tight debug loop where the AI can verify each fix by looking at the next screenshot.
Подводные камни
- Screenshot tool disabled by default — Start the server with
--images flag - VM port conflicts when running multiple apps — Specify
--vm-service-port per app; default 8181
Когда использовать: Your app has debug-only seeders / state toggles you want AI to call during dev.
Поток
-
Register tools in Dart
Using mcp_toolkit, register tools seed_users(count: int) and set_feature_flag(name: str, value: bool) in my app's debug initializer.✓ Скопировано
→ Dart snippet registering tools
-
Drive from Claude
Seed 10 users, flip feature flag 'new_checkout' to true, take screenshot of checkout screen.✓ Скопировано
→ Multi-step tool call sequence with final screenshot
Итог: Faster manual QA via chat-driven state manipulation.
Подводные камни
- Tools shipped to release mode accidentally — Gate registration with
kDebugMode — release builds don't see them
Когда использовать: You're trying to understand why a screen renders a certain way and the code has 8 levels of nested Builders.
Поток
-
Get view details
get_view_details for the current screen and summarize the widget hierarchy.✓ Скопировано
→ Widget tree summary
-
Ask why
Why does this text overflow? Reference specific widgets in the tree.✓ Скопировано
→ Layout reasoning grounded in actual tree
Итог: Faster onboarding to unfamiliar Flutter code.
Подводные камни
- Big widget trees blow up token budget — Ask for a depth-limited summary first, then drill in
Комбинации
Сочетайте с другими MCP — эффект x10
Debug → fix → commit loop
Screenshot, diagnose, have me apply the fix, then git_commit with message describing the fix.✓ Скопировано
Стоимость и лимиты
Во что обходится
- Квота API
- None
- Токенов на вызов
- Screenshots are large (~1-3k vision tokens); widget trees 500-5k
- Деньги
- Free, MIT
- Совет
- Disable screenshots (remove --images) when debugging non-visual issues — widget tree + errors are much cheaper.
Безопасность
Права, секреты, радиус поражения
Хранение учётных данных: None — connects to local Dart VM service
Исходящий трафик: Local only in typical use; screenshots go to your LLM provider
Никогда не давайте: Expose VM service port to the network in release builds
- Only works in debug/profile mode — release builds lock down the VM service.
- Tested on macOS/iOS; Android and desktop support is marked 'not tested' in the README.
Устранение неполадок
Частые ошибки и исправления
Cannot connect to Dart VM
Start your Flutter app first, then the MCP server. Confirm VM port (usually 8181) matches config.
Проверить: curl http://127.0.0.1:8181/
Screenshots return 404
Server started without --images flag. Restart with the flag.
Custom tools not showing up
mcp_toolkit must be initialized after runApp; verify kDebugMode gate isn't false in your build.
Альтернативы
mcp_flutter в сравнении
| Альтернатива | Когда использовать | Компромисс |
| Flutter DevTools MCP | You want the official Flutter tooling | Doesn't exist yet as an MCP; this is the closest |