docs/pages/documentation/guides/dart-mcp.mdx
import { Callout } from "nextra/components";
The Dart MCP server gives AI assistants
access to the Dart and Flutter toolchain. By default it finds Flutter from the
FLUTTER_SDK environment variable, or by searching up from the Dart SDK that
started it — usually the globally installed Flutter, not the version FVM pins for
your project.
When that happens, the server analyzes and runs against the wrong SDK, so its
results won't match what fvm flutter reports.
fvm use creates a .fvm/flutter_sdk symlink that always points to the SDK
pinned in your .fvmrc. Pass it to the server with --flutter-sdk:
{
"mcpServers": {
"dart": {
"command": "dart",
"args": ["mcp-server", "--flutter-sdk", ".fvm/flutter_sdk"]
}
}
}
The server then uses the same Flutter SDK as your editor and fvm flutter. Run
fvm use before starting the server so the symlink exists.
FVM skips the symlink when it can't create one — for example, on Windows without
Developer Mode or administrator rights (privilegedAccess: false). Point
--flutter-sdk at the SDK's absolute path in the FVM cache instead; run
fvm list to find it:
{
"mcpServers": {
"dart": {
"command": "dart",
"args": ["mcp-server", "--flutter-sdk", "C:\\Users\\you\\fvm\\versions\\3.x.x"]
}
}
}