An MCP (Model Context Protocol) server providing tools for Flutter and Dart development. This server integrates with Claude and other AI assistants supporting the MCP protocol to enable Flutter/Dart development capabilities.
npx mcp-server-flutter <path-to-flutter-project>
- Node.js >= 18.0.0
- Flutter SDK installed and available in PATH
- A Flutter project directory
Run a Flutter application.
{
target?: string; // Target file to run (default: lib/main.dart)
device?: string; // Target device ID
mode?: "debug" | "profile" | "release"; // Build mode
webPort?: number; // Port to use for web server
verbose?: boolean; // Enable verbose logging
}
Manage Flutter packages.
{
command: "get" | "upgrade" | "outdated" | "add" | "remove"; // Package management command
package?: string; // Package name for add/remove operations
version?: string; // Package version constraint
}
Generate Dart files using build_runner.
{
watch?: boolean; // Watch for changes and rebuild automatically
deleteConflicting?: boolean; // Delete conflicting outputs
}
Automatically fix Dart style issues.
{
folder?: string; // Target folder (default: lib)
dryRun?: boolean; // Show proposed changes without applying
}
Run a Dart file.
{
file: string; // Dart file to run
args?: string[]; // Command line arguments
}
Build a Flutter application.
{
platform: "apk" | "ios" | "web" | "macos" | "windows" | "linux"; // Target platform
release?: boolean; // Build in release mode
splitDebugInfo?: boolean; // Split debug info
obfuscate?: boolean; // Enable code obfuscation
}
Run Flutter analyzer to find issues.
{
fatal?: string[]; // Treat specific issue levels as fatal
directory?: string; // Directory to analyze
}
Run Flutter tests.
{
test?: string; // Specific test file to run
tags?: string[]; // Run only tests with these tags
exclude?: string[]; // Exclude tests with these tags
coverage?: boolean; // Collect coverage information
}
Check Flutter development environment.
{
verbose?: boolean; // Show detailed information
}
Clean Flutter project build and cache.
List available devices.
Manage Flutter SDK version.
{
channel?: "stable" | "beta" | "dev" | "master"; // Flutter channel to use
version?: string; // Specific Flutter version to use
}
The server handles common Flutter/Dart errors and categorizes them into:
- BUILD: Build-related errors
- RUNTIME: Runtime execution errors
- DEPENDENCY: Package dependency issues
- CONFIGURATION: Setup and configuration problems
- UNKNOWN: Uncategorized errors
Each error response includes:
- Category: The type of error
- Message: A human-readable error description
- Details: Additional error information (when available)
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode with watch
npm run dev
# Clean build artifacts
npm run clean
# Rebuild the project
npm run rebuild
MIT