/ Diretório / Playground / mcp_flutter
● Comunidade Arenukvern ⚡ Instantâneo

mcp_flutter

por 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.

Por que usar

Principais recursos

Demo ao vivo

Como fica na prática

flutter.replay ▶ pronto
0/0

Instalar

Escolha seu cliente

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "flutter": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/Arenukvern/mcp_flutter"
      ],
      "_inferred": true
    }
  }
}

Abra Claude Desktop → Settings → Developer → Edit Config. Reinicie após salvar.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "flutter": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/Arenukvern/mcp_flutter"
      ],
      "_inferred": true
    }
  }
}

Cursor usa o mesmo esquema mcpServers que o Claude Desktop. Config de projeto vence a global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "flutter": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/Arenukvern/mcp_flutter"
      ],
      "_inferred": true
    }
  }
}

Clique no ícone MCP Servers na barra lateral do Cline, depois "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "flutter": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/Arenukvern/mcp_flutter"
      ],
      "_inferred": true
    }
  }
}

Mesmo formato do Claude Desktop. Reinicie o Windsurf para aplicar.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "flutter",
      "command": "TODO",
      "args": [
        "See README: https://github.com/Arenukvern/mcp_flutter"
      ]
    }
  ]
}

O Continue usa um array de objetos de servidor em vez de um map.

~/.config/zed/settings.json
{
  "context_servers": {
    "flutter": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/Arenukvern/mcp_flutter"
        ]
      }
    }
  }
}

Adicione em context_servers. Zed recarrega automaticamente ao salvar.

claude mcp add flutter -- TODO 'See README: https://github.com/Arenukvern/mcp_flutter'

Uma linha só. Verifique com claude mcp list. Remova com claude mcp remove.

Casos de uso

Usos do mundo real: mcp_flutter

Debug a Flutter render error with AI eyes on the running app

👤 Flutter devs ⏱ ~15 min intermediate

Quando usar: You're iterating on UI and something broke. Instead of describing it, let the AI see the screenshot + errors.

Pré-requisitos
  • 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
Fluxo
  1. Connect
    Connect to my running Flutter app (VM port 8181) via mcp_flutter.✓ Copiado
    → Tools list now includes get_app_errors, view_screenshot
  2. Capture state
    Take a screenshot of the current view. Also pull any errors from the last 60 seconds.✓ Copiado
    → Screenshot + error log
  3. Suggest fix
    Based on this error and screenshot, what's wrong and how do I fix it?✓ Copiado
    → Code diff proposal

Resultado: Tight debug loop where the AI can verify each fix by looking at the next screenshot.

Armadilhas
  • 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

Expose your app's test harness as MCP tools

👤 Flutter devs building QA workflows ⏱ ~30 min intermediate

Quando usar: Your app has debug-only seeders / state toggles you want AI to call during dev.

Fluxo
  1. 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.✓ Copiado
    → Dart snippet registering tools
  2. Drive from Claude
    Seed 10 users, flip feature flag 'new_checkout' to true, take screenshot of checkout screen.✓ Copiado
    → Multi-step tool call sequence with final screenshot

Resultado: Faster manual QA via chat-driven state manipulation.

Armadilhas
  • Tools shipped to release mode accidentally — Gate registration with kDebugMode — release builds don't see them

Understand a confusing widget tree

👤 Flutter devs inheriting someone else's code ⏱ ~20 min intermediate

Quando usar: You're trying to understand why a screen renders a certain way and the code has 8 levels of nested Builders.

Fluxo
  1. Get view details
    get_view_details for the current screen and summarize the widget hierarchy.✓ Copiado
    → Widget tree summary
  2. Ask why
    Why does this text overflow? Reference specific widgets in the tree.✓ Copiado
    → Layout reasoning grounded in actual tree

Resultado: Faster onboarding to unfamiliar Flutter code.

Armadilhas
  • Big widget trees blow up token budget — Ask for a depth-limited summary first, then drill in

Combinações

Combine com outros MCPs para 10× de alavancagem

flutter + git-2

Debug → fix → commit loop

Screenshot, diagnose, have me apply the fix, then git_commit with message describing the fix.✓ Copiado

Ferramentas

O que este MCP expõe

FerramentaEntradasQuando chamarCusto
get_app_errors since?: int (seconds) After triggering a bug in the running app free
view_screenshot Visual verification; requires --images flag tokens per image
get_view_details Understand layout / screen geometry free
<custom> Varies per app registration Whatever you register via mcp_toolkit free

Custo e limites

O que custa rodar

Cota de API
None
Tokens por chamada
Screenshots are large (~1-3k vision tokens); widget trees 500-5k
Monetário
Free, MIT
Dica
Disable screenshots (remove --images) when debugging non-visual issues — widget tree + errors are much cheaper.

Segurança

Permissões, segredos, alcance

Armazenamento de credenciais: None — connects to local Dart VM service
Saída de dados: Local only in typical use; screenshots go to your LLM provider
Nunca conceda: Expose VM service port to the network in release builds

Solução de problemas

Erros comuns e correções

Cannot connect to Dart VM

Start your Flutter app first, then the MCP server. Confirm VM port (usually 8181) matches config.

Verificar: 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.

Alternativas

mcp_flutter vs. outros

AlternativaQuando usarTroca
Flutter DevTools MCPYou want the official Flutter toolingDoesn't exist yet as an MCP; this is the closest

Mais

Recursos

📖 Leia o README oficial no GitHub

🐙 Ver issues abertas

🔍 Ver todos os 400+ servidores MCP e Skills