Dart MCP Server

by egyleader

Not rated
GitHub

About

An MCP server that exposes Dart SDK commands for AI-powered development.

Details

Author
egyleader
Categories
Developer Tools

Setup

Install Dart MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/egyleader/dart-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

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).

This MCP server provides seamless access to the following Dart SDK commands:

- 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

- Node.js: 18.x or higher
- Dart SDK: 3.0 or higher installed and available in your PATH

To install Dart MCP Server for Claude Desktop automatically viaSmithery:

npx -y @smithery/cli install @egyleader/dart-mcp --client claude

The server can be run directly without installation using npx:

For easier access, you can install the server globally:

npm install -g @egyleader/dart-mcp-server
# Clone the repository git clone https://github.com/egyleader/dart-mcp-server.git cd dart-mcp-server # Install dependencies npm install # Build the project npm run build # Run the server node dist/index.js

To use this MCP server with Windsurf or Codeium IDE, add the following to yourmcp_config.jsonfile (typically located at~/.codeium/windsurf/mcp_config.json):

{ "mcpServers": { "dart": { "command": "npx", "args": [ "-y", "@egyleader/dart-mcp-server" ] } } }

- DART_MCP_VERBOSE: Set to any value to enable verbose logging for debugging

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.

Analyze Dart code for errors, warnings, and lints:

{ "path": "lib/main.dart", "options": ["--fatal-infos", "--fatal-warnings"] }
{ "path": "lib/main.dart", "format": "exe", "output": "build/app", "options": ["--verbose"] }

Supported formats:exe,aot-snapshot,jit-snapshot,kernel,js

Create a new Dart project from a template:

{ "projectName": "my_awesome_app", "template": "console", "output": "projects/my_awesome_app", "options": ["--force"] }

- If onlyprojectNameis provided, it's used as the directory name where the project is created.
- Ifoutputis 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

Generate API documentation for a Dart project:

{ "path": ".", "output": "doc", "options": ["--exclude", "lib/generated"] }

Apply automated fixes to Dart source code:

{ "path": "lib", "apply": true, "options": ["--pedantic"] }

Format Dart source code according to style guidelines:

{ "paths": ["lib/main.dart", "lib/models"], "setExitIfChanged": true, "options": ["--line-length=100"] }

Show diagnostic information about the installed Dart tooling:

{ "options": ["--verbose"] }
{ "command": "get", "workingDir": ".", "args": ["--offline"] }

Supported commands:get,upgrade,outdated,add,remove,publish,deps,downgrade,cache,run,global

Run Dart programs with support for passing arguments:

{ "script": "bin/server.dart", "workingDir": ".", "args": ["--port=8080", "--mode=production"] }

Run tests with support for filtering and reporting options:

{ "path": "test", "workingDir": ".", "options": ["--name=login", "--platform=chrome"] }

This project is licensed under the MIT License - see theLICENSEfile for details.

Contributions are welcome! Please feel free to submit a Pull Request.

Analyze Dart code in a directory or file.

{ path?: string; // Directory or file to analyze options?: string[]; // Additional options for the dart analyze command }
{ path: "lib", options: ["--fatal-infos", "--fatal-warnings"] }
{ format: 'exe' | 'aot-snapshot' | 'jit-snapshot' | 'kernel' | 'js'; // Output format path: string; // Path to the Dart file to compile output?: string; // Output file path options?: string[]; // Additional compilation options }
{ format: "exe", path: "bin/main.dart", output: "bin/app" }
{ template: 'console' | 'package' | 'server-shelf' | 'web'; // Project template projectName: string; // Name of the project to create output?: string; // Directory where to create the project options?: string[]; // Additional project creation options }

- Ifoutputis provided, the project will be created in that directory.
- If onlyprojectNameis provided, it will be used as the directory name.
- The actual Dart package name is derived from the final directory name.

{ template: "package", projectName: "my_dart_library", output: "projects/my_dart_library" }

Generate API documentation for Dart projects.

{ path?: string; // Directory containing the Dart package to document output?: string; // Output directory for the generated documentation options?: string[]; // Additional documentation options }
{ path: ".", output: "doc/api" }

Apply automated fixes to Dart source code.

{ path?: string; // Directory or file to apply fixes to apply?: boolean; // Whether to apply the suggested fixes (default: true) options?: string[]; // Additional fix options }
{ path: "lib", apply: true, options: ["--pedantic"] }
{ paths: string[]; // Files or directories to format setExitIfChanged?: boolean; // Return exit code 1 if there are formatting changes (default: false) options?: string[]; // Additional format options }
{ paths: ["lib", "test"], setExitIfChanged: true, options: ["--line-length=80"] }

Show diagnostic information about the installed tooling.

{ options?: string[]; // Additional info options }
{ command: 'get' | 'upgrade' | 'outdated' | 'add' | 'remove' | 'publish' | 'deps' | 'downgrade' | 'cache' | 'run' | 'global'; // Pub subcommand args?: string[]; // Arguments for the pub subcommand workingDir?: string; // Working directory for the command }
// Add a package { command: "add", args: ["rxdart"], workingDir: "my_project" } // Get dependencies { command: "get", workingDir: "my_project" }
{ script: string; // Path to the Dart script to run args?: string[]; // Arguments to pass to the script workingDir?: string; // Working directory for the command }
{ script: "bin/main.dart", args: ["--verbose"], workingDir: "my_project" }
{ path?: string; // Path to the test file or directory options?: string[]; // Additional test options workingDir?: string; // Working directory for the command }
{ path: "test", options: ["--coverage", "--name=auth"], workingDir: "my_project" }
# Watch mode for development pnpm run dev # Build for production pnpm run build

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

Please seeCONTRIBUTING.mdfor detailed contribution guidelines.

<type>[optional scope]: [JIRA-123(optional)] <description>
feat(tools): [DART-456] add support for dart test tags

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

Local stdio MCP server that lets AI coding agents read and maintain structured architecture, rules, and decisions directly from your repository.

Official Context7 MCP server that brings up-to-date, version-specific library documentation and code examples into AI coding prompts.

Remote, no-auth MCP server providing AI-powered codebase context and answers

Instead of direct calling MCP tools, mcpcode server transforms MCP tool calls into TypeScript programs, enabling smarter, lower-latency orchestration by LLMs.

Help agents automatically write and test stories for your UI components

Official Svelte MCP server, provides docs and suggestions on the generated code.

Supercharge your Agent with Semantic Code Intelligence and save 💰 in the process!

Execute any LLM-generated code in the YepCode secure and scalable sandbox environment and create your own MCP tools using JavaScript or Python, with full support for NPM and PyPI packages

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.