Dart and Flutter MCP Server with Agent Skills
Ask a coding agent to update a Flutter screen and it often guesses file layouts, emits outdated state-management boilerplate, and still leaves you running flutter analyze and hot reload by hand. Google now ships the official Dart and Flutter MCP Server directly inside the Dart SDK (dart mcp-server, Dart SDK 3.9+) alongside the flutter/agent-plugins and dart-lang/skills repositories.
Wiring these into Claude Code, Cursor, or Google Antigravity follows one clean division: the MCP server gives agents real toolchain and runtime visibility, while Agent Skills teach idiomatic modern Dart 3 and Flutter patterns (see Flutter AI Tooling Docs).
Four Closed-Loop Capabilities in dart mcp-server
Rather than letting agents parse raw terminal output with regexes, dart mcp-server talks directly to Dart’s official tooling engines:
- Real static analysis & packages: Uses the Dart Analysis Server for diagnostics, symbol resolution,
dart format, andpubspec.yaml/pub.devinspection. - Test execution: Runs Flutter and Dart tests directly and feeds structured failure traces back into the agent loop.
- Runtime introspection (DTD): Connects through the Dart Tooling Daemon (DTD)—the same backend powering Flutter DevTools—to inspect live widget trees, read runtime console errors, evaluate expressions, and capture screenshots.
- Automatic hot reload: Pushes edits to a running debug session without manual terminal keypresses.
Client Setup and FVM Pinning
Claude Code
Register the built-in server over stdio (see MCP Model Context Protocol Guide):
claude mcp add --transport stdio dart -- dart mcp-serverStandard JSON MCP Clients (e.g., Cursor)
Add the entry to .cursor/mcp.json:
{
"mcpServers": {
"dart": {
"command": "dart",
"args": ["mcp-server"]
}
}
}Pinning SDK Paths with FVM
When a repository uses FVM (Flutter Version Management), invoking the global dart mcp-server can analyze against the wrong SDK version. Pass --flutter-sdk pointing to .fvm/flutter_sdk (or the absolute FVM cache path if symlinks are disabled):
{
"mcpServers": {
"dart": {
"command": "dart",
"args": ["mcp-server", "--flutter-sdk", ".fvm/flutter_sdk"]
}
}
}Pairing Tools with Official Agent Skills
MCP gives the agent tools, while flutter/agent-plugins and dart-lang/skills supply up-to-date procedural guidance:
- Modern Dart 3 idioms: Sealed classes, pattern matching, and records instead of verbose legacy boilerplate.
- Architecture & routing: Feature-first / layer-first layouts, Riverpod and BLoC/Cubit conventions, and declarative
go_routernavigation. - Verification workflows: Widget previews, widget tests, and integration testing (
flutter_driver).
Dart packages can also ship local skills/ folders so dependencies expose usage guidance directly to coding agents.
Going Full-Stack with Genkit Dart
For in-app and backend AI orchestration in pure Dart, Google’s open-source Genkit (Genkit Dart) complements the same workflow:
- Unified model layer: Switch between Gemini, Claude, OpenAI, and local models without rewriting application flows.
- Shared type safety (
schemantic): Define schemas once in Dart for both structured LLM outputs and client-server contracts—pairing naturally with Generative UI in Flutter with A2UI. - Up-to-date agent skill: Run
npx skills add genkit-ai/skillsso your coding assistant tracks current Genkit APIs accurately.
Adoption Checklist
- Verify Dart SDK 3.9+ first: Confirm
dart --versionanddart mcp-server --help, and always pass--flutter-sdkon FVM repositories. - Encode verify-after-edit in repo rules: Instruct agents in
AGENTS.mdorCLAUDE.mdto run MCP static analysis and targeted tests after edits before full builds. - Keep DTD local: Enable runtime widget inspection and hot reload only on local dev sessions, never exposed to untrusted networks.