Dart MCP Server
Dart MCP サーバー
AIを活用した開発向けにDart SDKコマンドを公開する、分散型モデルコンテキストプロトコル(MCP)サーバーです。このサーバーは、モデルコンテキストプロトコル(MCP)を実装することで、AIコーディングアシスタントとDart/Flutter開発ワークフロー間のギャップを埋めます。
特徴
この MCP サーバーは、次の Dart SDK コマンドへのシームレスなアクセスを提供します。
指示 | 説明 |
| Dart コードのエラー、警告、および lint を分析する |
| Dart をさまざまな形式 (exe、AOT/JIT スナップショット、JavaScript) にコンパイルします。 |
| テンプレートから新しい Dart プロジェクトを作成する |
| DartプロジェクトのAPIドキュメントを生成する |
| Dartソースコードに自動修正を適用する |
| Dartソースコードをスタイルガイドラインに従ってフォーマットする |
| インストールされている Dart ツールに関する診断情報を表示します |
| パッケージの操作 (取得、追加、アップグレード、古いパッケージなど) |
| 引数渡しをサポートしたDartプログラムを実行する |
| フィルタリングとレポートオプションをサポートしたテストを実行する |
主なメリット
インテリジェントなパス処理: 相対パスを絶対パスに自動的に解決し、作業ディレクトリに関係なくコマンドが正しく動作することを保証します。
プロジェクトの自動検出: ホームディレクトリやワークスペースなどの一般的な場所にある Dart/Flutter プロジェクトを識別します。
クロスプラットフォームサポート:macOS、Linux、Windowsで動作
ゼロ構成: 適切なデフォルト設定ですぐに使用可能
MCP 統合: Windsurf、Cline、その他のモデル コンテキスト プロトコル実装を含む、あらゆる MCP クライアントと互換性があります。
Related MCP server: dbt CLI MCP Server
前提条件
Node.js : 18.x 以上
Dart SDK : 3.0 以上がインストールされ、PATH で利用可能
インストール
Smithery経由でインストール
Smithery経由で Claude Desktop 用の Dart MCP Server を自動的にインストールするには:
npx -y @smithery/cli install @egyleader/dart-mcp --client claudenpx の使用(推奨)
npx を使用すると、インストールせずにサーバーを直接実行できます。
npx @egyleader/dart-mcp-serverグローバルインストール
アクセスを容易にするために、サーバーをグローバルにインストールできます。
npm install -g @egyleader/dart-mcp-server次に、次のコマンドを使用して実行します。
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.jsMCPクライアントとの統合
Windsurf / Codeium IDE の設定
この MCP サーバーを Windsurf または Codeium IDE で使用するには、 mcp_config.jsonファイル (通常は~/.codeium/windsurf/mcp_config.jsonにあります) に次のコードを追加します。
{
"mcpServers": {
"dart": {
"command": "npx",
"args": [
"-y",
"@egyleader/dart-mcp-server"
]
}
}
}環境変数
DART_MCP_VERBOSE: デバッグのための詳細なログを有効にするには任意の値を設定します。
MCPツールの使用例
サーバーが提供するMCPツールの使用方法の例を以下に示します。これらの例では、各ツールに渡すことができるパラメータを示しています。
ダーツ分析
Dart コードのエラー、警告、および lint を分析します。
{
"path": "lib/main.dart",
"options": ["--fatal-infos", "--fatal-warnings"]
}ダートコンパイル
Dart コードをさまざまな形式にコンパイルします。
{
"path": "lib/main.dart",
"format": "exe",
"output": "build/app",
"options": ["--verbose"]
}サポートされている形式: exe 、 aot-snapshot 、 jit-snapshot 、 kernel 、 js
ダーツ作成
テンプレートから新しい Dart プロジェクトを作成します。
{
"projectName": "my_awesome_app",
"template": "console",
"output": "projects/my_awesome_app",
"options": ["--force"]
}projectName と出力に関する注意:
projectNameのみが指定されている場合は、プロジェクトが作成されるディレクトリ名として使用されます。outputが指定されている場合は、プロジェクトが作成されるディレクトリとして使用されます。Dart の実際のパッケージ/プロジェクト名は、Dart CLI によって最終的なディレクトリ名から派生されます。
サポートされているテンプレート: console 、 package 、 server-shelf 、 web
ダーツドキュメント
Dart プロジェクトの API ドキュメントを生成します。
{
"path": ".",
"output": "doc",
"options": ["--exclude", "lib/generated"]
}ダーツフィックス
Dart ソース コードに自動修正を適用します。
{
"path": "lib",
"apply": true,
"options": ["--pedantic"]
}ダーツ形式
Dart ソース コードをスタイル ガイドラインに従ってフォーマットします。
{
"paths": ["lib/main.dart", "lib/models"],
"setExitIfChanged": true,
"options": ["--line-length=100"]
}ダーツ情報
インストールされている Dart ツールに関する診断情報を表示します。
{
"options": ["--verbose"]
}ダーツパッケージ
パッケージを操作する (pub コマンド):
{
"command": "get",
"workingDir": ".",
"args": ["--offline"]
}サポートされているコマンド: get 、 upgrade 、 outdated 、 add 、 remove 、 publish 、 deps 、 downgrade 、 cache 、 run 、 global
ダートラン
引数の受け渡しをサポートする Dart プログラムを実行します。
{
"script": "bin/server.dart",
"workingDir": ".",
"args": ["--port=8080", "--mode=production"]
}ダーツテスト
フィルタリングとレポートのオプションをサポートしたテストを実行します。
{
"path": "test",
"workingDir": ".",
"options": ["--name=login", "--platform=chrome"]
}ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
ツールAPIリファレンス
ダーツ分析
ディレクトリまたはファイル内の Dart コードを分析します。
{
path?: string; // Directory or file to analyze
options?: string[]; // Additional options for the dart analyze command
}例:
{
path: "lib",
options: ["--fatal-infos", "--fatal-warnings"]
}ダートコンパイル
Dart をさまざまな形式にコンパイルします。
{
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"
}ダーツ作成
新しい Dart プロジェクトを作成します。
{
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
}注記:
outputが指定されている場合、そのディレクトリにプロジェクトが作成されます。projectNameのみが指定されている場合は、それがディレクトリ名として使用されます。実際の Dart パッケージ名は、最終的なディレクトリ名から派生されます。
例:
{
template: "package",
projectName: "my_dart_library",
output: "projects/my_dart_library"
}ダーツドキュメント
Dart プロジェクトの API ドキュメントを生成します。
{
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"
}ダーツフィックス
Dart ソース コードに自動修正を適用します。
{
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"]
}ダーツ形式
Dart ソース コードを慣用的にフォーマットします。
{
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"]
}ダーツ情報
インストールされているツールに関する診断情報を表示します。
{
options?: string[]; // Additional info options
}例:
{
options: ["--verbose"]
}ダーツパッケージ
パッケージを操作します (pub コマンド)。
{
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"
}ダートラン
Dart プログラムを実行します。
{
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エラー処理
サーバーは包括的なエラー処理を実装します。
コマンド実行エラーは適切にキャプチャされフォーマットされます
パス解決の問題は詳細な診断とともに報告されます
長時間実行操作のタイムアウト処理
Dartコマンドからの適切な終了コードの伝播
貢献
詳細な貢献ガイドラインについては、 CONTRIBUTING.md を参照してください。
コミット形式は次のとおりです:
<type>[optional scope]: [JIRA-123(optional)] <description>例:
feat(tools): [DART-456] add support for dart test tagsライセンス
マサチューセッツ工科大学
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/egyleader/dart-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server