The Dart and Flutter MCP server (the dart_mcp_server package, run as dart mcp-server) is the official Model Context Protocol server for Dart and Flutter. It gives AI coding agents analyzer diagnostics, symbol resolution, pub.dev search, tests and live control of a running Flutter app, including hot reload and the widget inspector. I am a Flutter mobile product engineer in Peshawar, Pakistan, with 4+ years of Flutter and 20+ shipped apps. This guide lists all 24 tools in one table, shows which ones are off by default, and gives the exact config for Antigravity, Cursor, GitHub Copilot, Gemini CLI, Cline, Windsurf, Zed, Claude Code and Codex. It does not cover JetBrains IDEs (Android Studio, IntelliJ) or Claude Desktop.
How does the Dart and Flutter MCP server work?
Model Context Protocol (MCP) is, in the words of modelcontextprotocol.io, "an open-source standard for connecting AI applications to external systems." The Dart and Flutter MCP server is the MCP server maintained in the dart-lang/ai GitHub repo. You will see it called the Dart MCP server, the Dart and Flutter MCP server, dart_mcp_server (the pub.dev package) and dart-mcp-server (the name the official plugin registers). They are all the same server.
In the Flutter docs' words, it connects your AI assistant to the Dart SDK, giving it real-time access to analyzer diagnostics, symbol resolution, test runners and runtime inspection. It talks to the agent over standard I/O (stdio). Instead of shelling out and parsing text, the agent calls typed tools: analyze these files, search pub.dev, hot reload the running app, read the widget tree. The Flutter AI tools overview groups them into five jobs:
- Static analysis and diagnostics: inspect and fix analyzer errors and warnings across your project.
- Symbol resolution: resolve symbols to their definitions, signatures and documentation.
- Runtime introspection: query the state of a running Flutter app during active debugging sessions.
- Package management: search pub.dev and manage dependencies in
pubspec.yaml. - Testing and formatting: run unit and widget tests and format code with
dart formatrules.
AI agent (Cursor, Copilot, Antigravity, ...)
|
| MCP over stdio
v
dart mcp-server
|-- analyzer / LSP -> diagnostics, symbols
|-- pub / pub.dev -> packages
'-- DTD / VM service -> your running Flutter app
The Dart team announced the server on July 23, 2025. Its README still calls it experimental and likely to evolve quickly, so expect tool names and defaults to change. The older setup pages at docs.flutter.dev/ai/mcp-server and dart.dev/tools/mcp-server now redirect to docs.flutter.dev/ai/get-started, which is the current official page.
What tools does the Dart and Flutter MCP server provide?
The README's tool table lists 24 tools, but only 14 are enabled by default. The other 10, including run_tests and launch_app, stay hidden until you pass --enable. The categories below are the README's own, and they are the names --enable and --disable accept.
| Tool | What it does | --enable category | Default |
|---|---|---|---|
analyze_files | Analyzes specific paths, or the whole project, for errors | analysis | On |
create_project | Creates a new Dart or Flutter project | cli | Off |
dart_fix | Runs dart fix --apply | cli | Off |
dart_format | Runs dart format . | cli | Off |
dtd | Finds Dart Tooling Daemon URIs and connects to running apps | dart_tooling_daemon | On |
flutter_driver_command | Runs a Flutter Driver command | flutter_driver | On |
get_active_location | Reads the cursor position in the connected editor | dart_tooling_daemon | Off |
get_app_logs | Returns logs for an app started by launch_app | flutter, flutter_app_lifecycle | Off |
get_runtime_errors | Reads the most recent runtime errors from the active app | dart_tooling_daemon | On |
hot_reload | Hot reloads the active Flutter app | flutter | On |
hot_restart | Hot restarts the active Flutter app, resetting app state | flutter | On |
launch_app | Launches a Flutter app and returns its DTD URI | flutter, flutter_app_lifecycle | Off |
list_devices | Lists available Flutter devices | flutter, flutter_app_lifecycle, cli | Off |
list_running_apps | Lists apps started by launch_app and their DTD URIs | flutter, flutter_app_lifecycle | Off |
lsp | Talks to the Dart Language Server: hover, signatureHelp, resolveWorkspaceSymbol | analysis | On |
pub | Runs pub commands such as dart pub get or flutter pub add | cli, package_deps | On |
pub_dev_search | Searches pub.dev and returns downloads, description, topics, license and publisher | package_deps | On |
read_package_uris | Reads package: and package-root: URIs inside your dependencies | package_deps | On |
rip_grep_packages | Greps your dependencies with ripgrep, which must already be installed | package_deps | On |
roots | Manages project roots | None | On |
run_tests | Runs Dart or Flutter tests "with an agent centric UX" | cli | Off |
stop_app | Kills a Flutter process started by launch_app | flutter, flutter_app_lifecycle | Off |
vm_service | Connects through a VM service URI, so hot reload works on apps not launched through DTD | dart_tooling_daemon | On |
widget_inspector | Talks to the Flutter widget inspector in the active app | flutter | On |
The exact tool list depends on the version you have installed. A local dart mcp-server --help run for this guide, on an older install, listed flutter_driver_user_journey_test and had no vm_service. Treat dart mcp-server --help on your own machine as the source of truth for your version. Most live-app tools need a DTD connection, covered below.
Enabling run_tests and launch_app
Your agent cannot see them because they are disabled by default. In the same release, 0.1.3 (bundled with Dart SDK 3.12.0), the CHANGELOG records two changes: tools that are easy to do on the CLI, plus get_active_location, were turned off by default, and so were the app lifecycle tools, because "Agents tend to do better just using the CLI to manage the app lifecycle, and it is more flexible." You turn them back on with --enable, by tool name or by category.
To enable the lifecycle tools, add the flutter_app_lifecycle category, as the README shows. It turns on five tools: launch_app, list_devices, list_running_apps, get_app_logs and stop_app. Replace the args line inside your dart entry with:
"args": ["mcp-server", "--enable", "flutter_app_lifecycle"]
The CHANGELOG documents --enable cli and --enable <tool-name>. The cli category turns on the default-off create_project, dart_fix, dart_format, run_tests and list_devices (it also contains pub, which is on by default). Or enable a single tool by name. Again, each line replaces the args line inside your dart entry:
"args": ["mcp-server", "--enable", "cli"]
"args": ["mcp-server", "--enable", "run_tests"]
The rules, from the README: enabling a category also turns on its default-off tools. Disabling wins over enabling at the same level, and tool names win over categories. dart mcp-server --help prints every tool and category name. One trap: before version 1.2.1, the --enable help text wrongly said all features were on by default, so do not trust older help output on this point.
When launch_app is on, it accepts extra flutter run flags through its args parameter, such as --flavor and --dart-define. My practice is to leave the lifecycle tools off and run the app myself, which matches the maintainers' advice. I do turn on run_tests, because a test gate is what keeps agent changes honest.
How do I set up the Dart MCP server in each AI agent?
The manual configs the Flutter docs show (generic, Antigravity CLI and VS Code) all run the command dart with the argument mcp-server. What changes is where the config lives and which top-level key holds it. Cursor and Antigravity install it for you through the official Dart and Flutter plugin; most other clients need a JSON entry.
| Client | How to install | Config file | Top-level key |
|---|---|---|---|
| Antigravity IDE | Settings, Customizations, Build with Google Plugins, Download "Dart and Flutter" | Managed by the plugin | n/a |
Antigravity CLI (agy) | Manual entry | .agents/mcp_config.json or ~/.gemini/config/mcp_config.json | mcpServers |
| Cursor | Dart and Flutter plugin | Managed by the plugin | n/a |
| GitHub Copilot (VS Code) | Manual entry, or Dart-Code setting | .vscode/mcp.json | servers |
| Gemini CLI | Manual entry | .gemini/settings.json or ~/.gemini/settings.json | mcpServers |
| Cline | Manual entry | cline_mcp_settings.json | mcpServers |
| Windsurf (Devin Desktop docs) | Manual entry | ~/.config/devin/mcp_config.json (macOS/Linux) | mcpServers |
| Zed | Manual entry | Zed settings file | context_servers |
| Claude Code, Codex | Official dart-flutter plugin | Managed by the plugin | n/a |
The generic entry that most clients accept, as a complete file:
{
"mcpServers": {
"dart": {
"command": "dart",
"args": ["mcp-server"]
}
}
}
Antigravity
In the Antigravity IDE, open Settings (Cmd/Ctrl + ,), go to the Customizations tab, click Customize under Build with Google Plugins, then click Download next to Dart and Flutter. The Flutter docs suggest a check prompt: "Summarize the Dart and Flutter tools and skills available in this project." For the Antigravity CLI, put the generic mcpServers entry in .agents/mcp_config.json for one project, or ~/.gemini/config/mcp_config.json globally, then run agy in the project root. My Google Antigravity guide for Flutter covers the rest of the workflow.
Cursor
Install the Dart and Flutter plugin from the Cursor Marketplace "Add to Cursor" button, through Customize by searching "Dart and Flutter", or by typing /add-plugin dart-flutter in chat. The plugin configures the MCP server and discovers the bundled skills. Cursor uses file-scoped .mdc rules: download the official .mdc files into .cursor/rules/.
GitHub Copilot in VS Code
VS Code uses a servers key, not mcpServers. It is an easy key to get wrong when copying config between tools. Create .vscode/mcp.json:
{
"servers": {
"dart": {
"command": "dart",
"args": ["mcp-server"]
}
}
}
Alternatively, per the dart_mcp_server README, with the Dart-Code extension v3.114 or later, add "dart.mcpServer": true to user settings (or workspace settings for one workspace) and the Dart extension registers the server with VS Code. Enable AI features in VS Code first, and note that your organization can restrict which MCP servers are available. Workspace rules go in .github/copilot-instructions.md.
Gemini CLI, Cline, Windsurf and Zed
- Gemini CLI: per the dart_mcp_server README, the generic entry goes under
mcpServersin the project.gemini/settings.jsonor the global~/.gemini/settings.json. In Gemini Code Assist Agent mode, type/mcpin the chat window to verify it; the README notes Gemini Code Assist currently needs the Insiders channel. - Cline: per the Cline MCP docs, the generic entry goes in
cline_mcp_settings.json. The Cline CLI reads it from~/.cline/data/settings/cline_mcp_settings.json, andCLINE_MCP_SETTINGS_PATHoverrides that. Cline also supportsdisabledandautoApprove; Cline's own docs advise limitingautoApproveto safe tools. - Windsurf: the old Windsurf MCP docs URL now redirects to the Devin Desktop Cascade MCP docs, which put the config at
~/.config/devin/mcp_config.jsonon macOS and Linux or%APPDATA%\devin\mcp_config.jsonon Windows, undermcpServers. Cascade can use at most 100 tools at a time across all servers. - Zed: per the Zed MCP docs, Zed does not use
mcpServers. Open the settings file with "zed: open settings file" and add the server undercontext_servers, inside the top-level settings object:
"context_servers": {
"dart": {
"command": "dart",
"args": ["mcp-server"]
}
}
Claude Code and Codex
Both install the server through the official dart-flutter plugin from the flutter/agent-plugins marketplace. That plugin registers the server as dart-mcp-server, running dart mcp-server. These are the commands from the official Flutter setup page. In Claude Code:
claude plugin marketplace add flutter/agent-plugins
claude plugin install dart-flutter@dart-flutter
Check it with claude plugin marketplace list. In Codex:
codex plugin marketplace add flutter/agent-plugins
codex plugin add dart-flutter@dart-flutter
Check it with codex plugin list. Neither tool loads the plugin's rules automatically. For Claude Code, the Flutter docs say to add the rules you want to your project's CLAUDE.md. For Codex, download the .md rule files into .agent/rules/ or append them to CODEX.md. My Claude Code guide for Flutter developers covers the CLAUDE.md, skills and hooks around this server. If you are still choosing between agents, my Antigravity vs Claude Code vs Cursor comparison also covers when vibe coding is fine and how to give agents project rules through AGENTS.md.
Which Dart or Flutter version do I need?
The official README says every setup option needs Dart 3.9.0-163.0.dev or later, and the July 2025 launch post said Dart 3.9 or Flutter 3.35 beta. Treat Dart 3.9 as the floor; newer SDKs get more tools. Your client must also support stdio, plus MCP Tools and Resources for the full feature set, and ideally Roots.
How it ships has changed. Releases 0.1.0 to 0.1.3 came bundled with Dart SDK 3.9.0 through 3.12.0. Since 1.0.0 the server ships on pub.dev as dart_mcp_server from the verified publisher tools.dart.dev, and dart mcp-server keeps working as an alias that runs the pub package through dart run. As of October 24, 2026, the latest pub.dev release is 1.2.1 (published October 16, 2026).
How does the MCP server connect to a running Flutter app?
Through the Dart Tooling Daemon (DTD). Flutter apps register with DTD automatically when they run in debug or profile mode, unless you pass --no-dds. Pure Dart apps need the --observe flag. Once connected, the agent can hot reload, read runtime errors and inspect widgets.
Often you only need to ask: the README's examples are "connect to my flutter web app" or "connect to my web server". Both flutter run and dart accept --print-dtd, which prints the URI. For a Dart program, the flags must come before the script path:
dart --observe --print-dtd bin/main.dart
Hot reload from an AI agent
hot_reload and hot_restart are on by default and act on the active app once DTD is connected. The official flutter-hot-reload rule tells agents to connect with dtd after editing lib/**/*.dart, then call hot_reload for UI changes, or hot_restart when initState, global or static state, or main() changed.
The launch post shows the payoff with two workflows: asking the agent to "check for and fix static and runtime analysis issues" and fix a layout overflow using runtime errors plus the widget tree, and asking it to find a line chart package, which it does with pub_dev_search followed by pub get. In my view, runtime errors plus the widget tree is the most useful pairing, because the agent works from the same overflow you see instead of guessing. When it still cannot pin a bug down, the manual steps in my Flutter bug fixing guide still apply.
How do I fix common Dart MCP server setup problems?
Most setup problems come from four causes: tools that are off by default, the wrong top-level config key for your client, a missing Dart Tooling Daemon connection to the running app, or an SDK path the server cannot find. Check each of these before you reinstall anything.
- Tools missing:
run_tests,launch_appand the other default-off tools need--enable, as shown above. - Server not listed in VS Code: check that you used
servers, notmcpServers, and that MCP is not blocked by your organization. - "Flutter SDK not found": pass
--flutter-sdkor set theFLUTTER_ROOTenvironment variable (the server's arg parser defaults toFLUTTER_ROOT, then searches up from the Dart SDK). Since 1.2.1 the error says which Dart SDK the server is using and where that path came from (--dart-sdk,DART_ROOT,DART_SDKor the running executable). - Hot reload or runtime errors fail: there is no DTD connection. Ask the agent to connect, check you are not running with
--no-dds, and use--observefor pure Dart. rip_grep_packagesfails: install ripgrep.- Too many tools (Windsurf): trim with
--disable(short form-x) to stay under Cascade's 100-tool cap. - Need to see what is happening: add
--log-filewith a path to log all protocol traffic to a file, per the CHANGELOG.
One behavior to know: analysis server instances start lazily, on first use, and shut down after 10 minutes of inactivity.
Do I still need --experimental-mcp-server?
No. The README says --experimental-mcp-server can be removed on Dart 3.9.0 or later. The 1.0.0 CHANGELOG entry also reads: "Always enable roots fallback, and merge them with client roots that are set (if any)." --tools and --exclude-tool are deprecated in favor of --enable and --disable.
Should I install the Flutter agent skills and rules too?
Yes, if your agent supports them. The MCP server gives the agent tools; the official skills and rules tell it when to use them. The Cursor, Claude Code and Codex plugins bundle skills. For Antigravity CLI, Copilot and other clients, install them with npx; they land in .agents/skills.
npx skills add flutter/agent-plugins --skill '*' --agent universal --yes
npx skills add dart-lang/skills --skill '*' --agent universal --yes
Rules go in each tool's own file: .cursor/rules/, .github/copilot-instructions.md, .windsurfrules or .clinerules. My practice is to keep project rules in one shared file beside the official ones. For the full project workflow around these tools, read how to build a Flutter app with AI in 2026.
Frequently Asked Questions
What is the Dart and Flutter MCP server?
It is a Model Context Protocol server maintained in the dart-lang/ai GitHub repository and run with dart mcp-server. It runs locally over stdio and connects AI coding agents to the Dart SDK for analyzer diagnostics, symbol resolution, pub.dev search, tests and runtime inspection of a running app, including hot reload and the widget inspector.
Which Dart or Flutter version do I need for the Dart MCP server?
The official README requires Dart 3.9.0-163.0.dev or later, and the launch post named Dart 3.9 or Flutter 3.35 beta. Newer SDKs and pub releases add tools, so run a current stable SDK if you can. As of October 24, 2026, the latest pub.dev release is 1.2.1 (published October 16, 2026).
Why can't my AI agent see run_tests or launch_app?
Both are off by default. Add --enable cli (or --enable run_tests) to get the test runner, and --enable flutter_app_lifecycle to get launch_app, list_devices, list_running_apps, get_app_logs and stop_app. Put the flags after mcp-server in the args array.
Can an AI agent hot reload my running Flutter app?
Yes. Once the agent connects to your app through the Dart Tooling Daemon, it can call hot_reload for UI changes and hot_restart for changes to state initialization, global state or main(). Flutter apps in debug or profile mode register with DTD automatically.
Is the Dart MCP server free and official?
Yes. It is maintained in the official dart-lang/ai GitHub repository and published as dart_mcp_server on pub.dev by the verified publisher tools.dart.dev. It is open source under the BSD-3-Clause license.
What is the difference between the Dart MCP server and the Developer Knowledge MCP server?
The Dart and Flutter MCP server works on your local code and running app: analysis, tests, packages and runtime debugging. The Flutter AI tools overview describes the separate Developer Knowledge MCP server as a cloud-hosted documentation search server that connects assistants to Google's developer docs, including docs.flutter.dev and dart.dev. You can run both.
If you want your Flutter team set up with AI agents and the review habits that keep output shippable, see my Flutter AI development service or get in touch.