Dart MCP Server
A distributable Model Context Protocol (MCP) server that exposes Dart SDK commands for AI-powered development. This server bridges the gap between AI coding assistants and Dart/Flutter development workflows by implementing the Model Context Protocol (MCP).
Features
This MCP server provides seamless access to the following Dart SDK commands:
Command | Description |
---|---|
dart-analyze | Analyze Dart code for errors, warnings, and lints |
dart-compile | Compile Dart to various formats (exe, AOT/JIT snapshots, JavaScript) |
dart-create | Create new Dart projects from templates |
dart-doc | Generate API documentation for Dart projects |
dart-fix | Apply automated fixes to Dart source code |
dart-format | Format Dart source code according to style guidelines |
dart-info | Show diagnostic information about the installed Dart tooling |
dart-package | Work with packages (get, add, upgrade, outdated, etc.) |
dart-run | Run Dart programs with support for passing arguments |
dart-test | Run tests with support for filtering and reporting options |
Key Benefits
- Intelligent Path Handling: Automatically resolves relative paths to absolute paths, ensuring commands work correctly regardless of working directory
- Project Auto-Detection: Identifies Dart/Flutter projects in common locations like home directories and workspaces
- Cross-Platform Support: Works on macOS, Linux, and Windows
- Zero Configuration: Works out of the box with sensible defaults
- MCP Integration: Compatible with any MCP client, including Windsurf, Cline, and other Model Context Protocol implementations
Prerequisites
- Node.js: 18.x or higher
- Dart SDK: 3.0 or higher installed and available in your PATH
Installation
Installing via Smithery
To install Dart MCP Server for Claude Desktop automatically via Smithery:
Using npx (recommended)
The server can be run directly without installation using npx:
Global Installation
For easier access, you can install the server globally:
Then run it using:
From Source
Integration with MCP Clients
Windsurf / Codeium IDE Configuration
To use this MCP server with Windsurf or Codeium IDE, add the following to your mcp_config.json
file (typically located at ~/.codeium/windsurf/mcp_config.json
):
Environment Variables
DART_MCP_VERBOSE
: Set to any value to enable verbose logging for debugging
MCP Tool Usage Examples
Here are examples of how to use the MCP tools provided by the server. These examples show the parameters that can be passed to each tool.
dart-analyze
Analyze Dart code for errors, warnings, and lints:
dart-compile
Compile Dart code to various formats:
Supported formats: exe
, aot-snapshot
, jit-snapshot
, kernel
, js
dart-create
Create a new Dart project from a template:
Note on projectName and output:
- If only
projectName
is provided, it's used as the directory name where the project is created. - If
output
is provided, it's used as the directory where the project is created. - The actual package/project name in Dart is derived from the final directory name by the Dart CLI.
Supported templates: console
, package
, server-shelf
, web
dart-doc
Generate API documentation for a Dart project:
dart-fix
Apply automated fixes to Dart source code:
dart-format
Format Dart source code according to style guidelines:
dart-info
Show diagnostic information about the installed Dart tooling:
dart-package
Work with packages (pub commands):
Supported commands: get
, upgrade
, outdated
, add
, remove
, publish
, deps
, downgrade
, cache
, run
, global
dart-run
Run Dart programs with support for passing arguments:
dart-test
Run tests with support for filtering and reporting options:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Tool API Reference
dart-analyze
Analyze Dart code in a directory or file.
Example:
dart-compile
Compile Dart to various formats.
Example:
dart-create
Create a new Dart project.
Note:
- If
output
is provided, the project will be created in that directory. - If only
projectName
is provided, it will be used as the directory name. - The actual Dart package name is derived from the final directory name.
Example:
dart-doc
Generate API documentation for Dart projects.
Example:
dart-fix
Apply automated fixes to Dart source code.
Example:
dart-format
Idiomatically format Dart source code.
Example:
dart-info
Show diagnostic information about the installed tooling.
Example:
dart-package
Work with packages (pub commands).
Examples:
dart-run
Run a Dart program.
Example:
dart-test
Run tests for a project.
Example:
Development
Error Handling
The server implements comprehensive error handling:
- Command execution errors are captured and formatted appropriately
- Path resolution issues are reported with detailed diagnostics
- Timeout handling for long-running operations
- Proper exit code propagation from Dart commands
Contributing
Please see CONTRIBUTING.md for detailed contribution guidelines.
Our commit format follows:
Example:
License
MIT
local-only server
The server can only run on the client's local machine because it depends on local resources.
AI 기반 개발을 위한 Dart SDK 명령을 제공하는 배포 가능한 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 모델 컨텍스트 프로토콜(MCP)을 구현하여 AI 코딩 어시스턴트와 Dart/Flutter 개발 워크플로 간의 격차를 해소합니다.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Dart-based MCP server implementation that enables AI-assisted task management, document handling, and workspace organization through standardized tools and seamless Dart integration.Last updated -108153JavaScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that wraps the dbt CLI tool, enabling AI coding agents to interact with dbt projects through standardized MCP tools. Developed by Mammoth Growth.Last updated -915PythonMIT License
- AsecurityAlicenseAqualityAn official AI Model Context Protocol server that enables AI assistants to interact with Dart project management by creating/managing tasks and documents through prompts and tools.Last updated -16815110TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server that implements AI-First Development framework principles, allowing LLMs to interact with context-first documentation tools and workflows for preserving knowledge and intent alongside code.Last updated -333PythonAGPL 3.0