Skip to main content
Guide · AI & LLM

The Dart and Flutter MCP Server: What It Does and How to Set It Up in Cursor, Copilot, Antigravity and More

A deep dive on the official Dart and Flutter MCP server: the 24 tools it exposes grouped by job, which ones are off by default and how to enable them, the config for Antigravity, Cursor, GitHub Copilot, Gemini CLI, Cline, Zed and Windsurf, the SDK floor, and fixes for the most common setup problems.

Afaq Zahir, author

Afaq Zahir

Flutter mobile product engineer

Published Updated 14 min read

On this page
  1. How does the Dart and Flutter MCP server work?
  2. What tools does the Dart and Flutter MCP server provide?
  3. Enabling run_tests and launch_app
  4. How do I set up the Dart MCP server in each AI agent?
  5. Which Dart or Flutter version do I need?
  6. How does the MCP server connect to a running Flutter app?
  7. How do I fix common Dart MCP server setup problems?
  8. Should I install the Flutter agent skills and rules too?
  9. Frequently Asked Questions

Quick answer

The Dart and Flutter MCP server, maintained in the dart-lang/ai GitHub repo, gives AI agents analyzer diagnostics, pub.dev search, tests and live app control such as hot reload. The manual configs in the Flutter docs all run it as the command dart with the argument mcp-server. Cursor and Antigravity install it through a plugin; Copilot uses .vscode/mcp.json with a servers key.

Key takeaways

  • The official server connects an AI agent to the Dart SDK over stdio: analyzer diagnostics, symbol resolution, pub.dev search, tests and runtime inspection of a running app.
  • The README lists 24 tools, but only 14 are on by default. run_tests, launch_app and the other CLI and app lifecycle tools need --enable.
  • The manual configs in the Flutter docs all run dart with the argument mcp-server. The file and the top-level key change per client (mcpServers, servers in VS Code, context_servers in Zed).
  • Hot reload, runtime errors and the widget inspector need a Dart Tooling Daemon (DTD) connection, which Flutter debug and profile runs register automatically.
  • The official README requires Dart 3.9 or later; the server now ships on pub.dev as dart_mcp_server, with 1.2.1 published October 16, 2026.
  • The old --experimental-mcp-server flag is no longer needed on Dart 3.9 or later, and since 1.0.0 the roots fallback is always enabled.

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 format rules.
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
How a request flows: the agent calls a tool over stdio, and the server answers from the analyzer, pub, or the running app through the Dart Tooling Daemon (DTD).

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.

ToolWhat it does--enable categoryDefault
analyze_filesAnalyzes specific paths, or the whole project, for errorsanalysisOn
create_projectCreates a new Dart or Flutter projectcliOff
dart_fixRuns dart fix --applycliOff
dart_formatRuns dart format .cliOff
dtdFinds Dart Tooling Daemon URIs and connects to running appsdart_tooling_daemonOn
flutter_driver_commandRuns a Flutter Driver commandflutter_driverOn
get_active_locationReads the cursor position in the connected editordart_tooling_daemonOff
get_app_logsReturns logs for an app started by launch_appflutter, flutter_app_lifecycleOff
get_runtime_errorsReads the most recent runtime errors from the active appdart_tooling_daemonOn
hot_reloadHot reloads the active Flutter appflutterOn
hot_restartHot restarts the active Flutter app, resetting app stateflutterOn
launch_appLaunches a Flutter app and returns its DTD URIflutter, flutter_app_lifecycleOff
list_devicesLists available Flutter devicesflutter, flutter_app_lifecycle, cliOff
list_running_appsLists apps started by launch_app and their DTD URIsflutter, flutter_app_lifecycleOff
lspTalks to the Dart Language Server: hover, signatureHelp, resolveWorkspaceSymbolanalysisOn
pubRuns pub commands such as dart pub get or flutter pub addcli, package_depsOn
pub_dev_searchSearches pub.dev and returns downloads, description, topics, license and publisherpackage_depsOn
read_package_urisReads package: and package-root: URIs inside your dependenciespackage_depsOn
rip_grep_packagesGreps your dependencies with ripgrep, which must already be installedpackage_depsOn
rootsManages project rootsNoneOn
run_testsRuns Dart or Flutter tests "with an agent centric UX"cliOff
stop_appKills a Flutter process started by launch_appflutter, flutter_app_lifecycleOff
vm_serviceConnects through a VM service URI, so hot reload works on apps not launched through DTDdart_tooling_daemonOn
widget_inspectorTalks to the Flutter widget inspector in the active appflutterOn

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.

ClientHow to installConfig fileTop-level key
Antigravity IDESettings, Customizations, Build with Google Plugins, Download "Dart and Flutter"Managed by the pluginn/a
Antigravity CLI (agy)Manual entry.agents/mcp_config.json or ~/.gemini/config/mcp_config.jsonmcpServers
CursorDart and Flutter pluginManaged by the pluginn/a
GitHub Copilot (VS Code)Manual entry, or Dart-Code setting.vscode/mcp.jsonservers
Gemini CLIManual entry.gemini/settings.json or ~/.gemini/settings.jsonmcpServers
ClineManual entrycline_mcp_settings.jsonmcpServers
Windsurf (Devin Desktop docs)Manual entry~/.config/devin/mcp_config.json (macOS/Linux)mcpServers
ZedManual entryZed settings filecontext_servers
Claude Code, CodexOfficial dart-flutter pluginManaged by the pluginn/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 mcpServers in the project .gemini/settings.json or the global ~/.gemini/settings.json. In Gemini Code Assist Agent mode, type /mcp in 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, and CLINE_MCP_SETTINGS_PATH overrides that. Cline also supports disabled and autoApprove; Cline's own docs advise limiting autoApprove to 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.json on macOS and Linux or %APPDATA%\devin\mcp_config.json on Windows, under mcpServers. 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 under context_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_app and the other default-off tools need --enable, as shown above.
  • Server not listed in VS Code: check that you used servers, not mcpServers, and that MCP is not blocked by your organization.
  • "Flutter SDK not found": pass --flutter-sdk or set the FLUTTER_ROOT environment variable (the server's arg parser defaults to FLUTTER_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_SDK or 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 --observe for pure Dart.
  • rip_grep_packages fails: 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-file with 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.

Afaq Zahir

Written by

Afaq Zahir

Flutter mobile product engineer with 4+ years shipping 20+ apps to the App Store and Google Play. Led Flutter teams at Metasense and Apptex.

GitHub ↗LinkedIn ↗Last reviewed
Book a call