
FlutterSDK Artisan
io.github.fluttersdk由 GitHub 帳號 fluttersdk 發布v0.0.15更新於 Oct 24, 2026
CLI framework and stdio MCP server for Flutter: scaffolding, hot reload, REPL, codegen.
概覽
透過 stdio 向 AI 助理暴露 Flutter/Dart CLI 框架,讓它能建立專案、管理外掛並驅動執行中的應用程式。
- 可以做什麼
- Artisan 是一套 Dart CLI 框架,同一個執行檔也透過 stdio JSON-RPC 提供 Model Context Protocol 工具。它提供十個常駐基礎工具,涵蓋應用程式生命週期(start、stop、status、logs、restart、reload、hot restart),以及 doctor、list 和 tinker,還有已安裝外掛貢獻的工具。指令涵蓋樣板產生、程式碼產生、外掛安裝與移除,以及針對執行中 Flutter VM 的連線式 REPL。
- 適用情境
- 適合助理需要直接操作 Flutter 或 Dart 專案時:啟動應用程式、熱重載、讀取日誌、在執行中的 VM 求值運算式,或產生指令與外掛骨架。適合已在使用 Artisan CLI、希望把同一套能力開放給助理的團隊。
- 執行需求
- 在使用者機器上以本機程序執行,僅支援桌面端,沒有網頁可執行版本。需要 Dart 3.4+ 工具鏈,生命週期指令還需要 PATH 中有 Flutter;框架核心不依賴 Flutter 執行環境。透過 dart pub add 與樣板步驟安裝,接著 mcp:install 會寫入用戶端設定項目。部分工具需要執行中的 VM Service 工作階段。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 FlutterSDK Artisan,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Artisan
Composable CLI framework and stdio MCP server for Flutter and Dart.
Scaffolding, code generation, transactional plugin installs, hot reload orchestration, REPL, and AI agent tool surfaces in one binary.
[pub package] [CI] [License: MIT] [pub points] [GitHub stars]
Documentation · pub.dev · Issues
Why Artisan?
Dart's CLI surface is fragmented. Every package invents its own install ritual, its own scaffold script, its own hand-edited entry point. A team that adopts five tools ends up with five bin/*.dart wrappers, five README install sections, and five chances for a bad merge to silently break the build. AI agents that want to drive the running app reach for ad hoc shell scripts because there is no shared tool surface.
Artisan fixes this. One binary registers every command, one protocol describes every plugin install, and one stdio MCP server exposes the whole stack to AI agents.
If you know php artisan, you already know the verb shape. The implementation is pure Dart 3.4+, no Flutter runtime dependency in the framework core.
Features
Quick Start
1. Install and scaffold
install writes bin/dispatcher.dart (the consumer entry that calls runArtisan(...)) plus barrels (lib/app/_plugins.g.dart, lib/app/commands/_index.g.dart), then auto-chains make:fast-cli so bin/fsa is ready immediately. Re-running is idempotent, pass --force to overwrite.
After scaffold, run any built-in command via the consumer wrapper:
2. Install a plugin
Plugins ship either an install.yaml manifest (declarative, walked by ManifestInstaller) or a procedural ArtisanInstallCommand subclass that drives PluginInstaller directly. Either way, the registry records every applied operation so a future plugin:uninstall can reverse them safely.
Plugin commands surface automatically. After installing fluttersdk_dusk, dart run artisan list shows the new dusk:* entries under their own namespace section.
3. Wire the MCP server for your AI agent
mcp:install writes (or updates) the mcpServers.fluttersdk entry in .mcp.json. After install, reconnect the MCP client once (for Claude Code: /mcp reconnect fluttersdk). The server boots in stdio JSON-RPC mode and exposes 10 substrate tools (artisan_start, artisan_stop, artisan_status, artisan_logs, artisan_restart, artisan_reload, artisan_hot_restart, artisan_doctor, artisan_list, artisan_tinker) plus any plugin-contributed tools.
Read the full setup walkthrough at MCP setup guide.
Commands
Artisan ships 22 built-in commands across 6 namespaces. Every command is a final class X extends ArtisanCommand with a signature string and a handle() method.
Highlights:
Full command catalog and per-command flag reference at commands catalog.
Writing your own command
make:command scaffolds a final class extending ArtisanCommand and auto-registers it in the nearest service provider. The signature DSL parses arguments and flags from one string, the handle() method receives a typed ArtisanContext:
For cases the signature DSL cannot express (positional rest, mutually exclusive flag groups), override void configure(ArgParser parser) and read from context.input.results directly. Signature DSL grammar at signature DSL reference.
Plugin Protocol
Artisan plugins declare their install footprint in install.yaml, a declarative manifest walked by ManifestInstaller. The manifest supports publish (files to copy), magic.provider plus magic.configFactory plus magic.routes (framework wiring), native.android (permissions, metaData, gradle plugins, gradle dependencies), native.ios and native.macos (plist entries, pod entries), native.web (head injections, meta tags), env (environment variable declarations with defaults), prompts (interactive install prompts), placeholders (token resolution from prompt answers), and bootstrap_command (post-install hint). Schema reference at install.yaml schema.
A minimal install.yaml looks like this:
For plugins that need runtime branching the YAML schema cannot express, subclass ArtisanInstallCommand and drive PluginInstaller directly. The DSL exposes file operations (writeFile, publishConfig, mergeJson), source-injection operations (injectImport, injectBefore, injectAfter, injectProvider, injectConfigFactory, injectRoute), native operations (injectAndroidPermission, injectIosPlistEntry, and friends), and environment operations (injectEnvVar). Every operation is deferred and batched, nothing writes until commit(dryRun:, force:) fires:
Full DSL reference at PluginInstaller DSL reference.
Operations are idempotent (lookahead-anchored regex skips when the target code is already present), atomic (every write goes through .tmp plus atomic rename so concurrent readers never see partial state), and reversible (each applied operation is recorded under .artisan/installed/<plugin>.json with a content hash for tamper detection on uninstall).
MCP Server
The same binary that runs CLI commands also serves Model Context Protocol tools over stdio JSON-RPC. No separate process, no extra package. The server is built on the official dart_mcp SDK and surfaces two tool layers.
Substrate tools (10 always-on). A curated subset of the artisan CLI surfaces as MCP tools so an AI agent can bootstrap the Flutter app without leaving the chat: artisan_start, artisan_stop, artisan_status, artisan_logs, artisan_restart, artisan_reload, artisan_hot_restart, artisan_doctor, artisan_list, artisan_tinker. Dispatch runs in-process via the registry; only artisan_tinker requires a running VM Service. Per-command inputSchema is byte-verified against the underlying command's configure(ArgParser) so the wire contract cannot drift from the CLI surface.
Plugin tools. Contributed by ArtisanServiceProvider.mcpTools() overrides. Dispatch routes through ext.* VM Service extensions. The official sibling plugins maintain their own MCP tool catalogs on dedicated reference pages:
A three-layer filter pipeline (.artisan/mcp.json file, ARTISAN_MCP_* env vars, CLI flags on mcp:serve) lets operators allow or deny tools and packages with Cargo-style precedence, deny wins at every layer. Worked example:
Result: the Telescope package is removed by the file, also denied by the env (union is idempotent), and artisan_stop is removed by the CLI flag for this session.
After mcp:install writes the client config entry, every MCP-capable agent can spawn the server on demand:
When bin/fsa is absent (or the host is Windows, where the POSIX shim never applies), mcp:install writes {"command": "dart", "args": ["run", ":dispatcher", "mcp:serve"]} instead. Pass --invocation=<executable> to override the fallback entry point: mcp:install then writes {"command": "dart", "args": ["run", "<executable>", "mcp:serve"]}, which is the correct shape when the consumer's entry point is a plugin wrapper rather than the generic :dispatcher (for example, dart run fluttersdk_artisan mcp:install --invocation=fluttersdk_dusk). Precedence: if the host is POSIX and bin/fsa is present then bin/fsa wins, otherwise --invocation wins when supplied, otherwise the :dispatcher default applies.
When no session is recorded for the project at initialize time (no Flutter app running), the server stays online with the 10 substrate tools available and 0 plugin tools registered. On the next tools/call requiring VM Service, the server lazy-reconnects via a memoized in-flight future so MCP clients survive the natural dev cycle of starting and stopping the Flutter app without reconnecting.
Setup walkthrough at MCP setup guide. Full tool reference at tool reference.
Architecture
Artisan is subsystem-first under lib/src/, every directory owns a single concern:
Flow at boot:
Every public type is a final class. Sealed dispatch over Dart 3 exhaustiveness wherever an op set or result set is closed (InstallOperation has 28 sealed subclasses, TransactionResult has 4). New ops or result variants force every dispatcher to update, no silent drift.
AI Agent Integration
Use Artisan with AI coding assistants like Claude Code, Cursor, or GitHub Copilot. The MCP server gives the agent direct tool access: start the Flutter app, drive widget interactions over Dusk, inspect HTTP traffic over Telescope, evaluate Dart expressions over Tinker, all without spawning shells or pattern-matching log output.
A typical agent session looks like this:
See each plugin's MCP tool reference for the current tool catalog (fluttersdk_dusk, fluttersdk_telescope).
For agents that read structured project context at attach time, the canonical entry point is llms.txt at the repo root (also published at https://fluttersdk.com/artisan/llms.txt). It enumerates the command surface, the plugin protocol, and the MCP tool catalog in agent-readable form.
Skill files and per-agent setup recipes: fluttersdk/ai.
Documentation
Full docs with live examples at fluttersdk.com/artisan.
Contributing
The baseline is roughly 1070 tests green on the touched-files scope. New behavior ships with the matching test (red, green, refactor). dart format lib/ test/ bin/ must produce no diff and dart analyze must report zero issues across lib/, test/, and bin/.
Before opening a pull request, also run:
The publish archive must stay under 500 KB compressed. The .pubignore excludes example/, example_magic/, build/, coverage/, and editor scaffolding from the pub archive, extend it if you add new top-level directories that should not ship.
Report a bug · Request a feature
License
MIT, see LICENSE for details.
Built with care by FlutterSDK
If Artisan saves you time, give it a star, it helps others discover it.
來源:README.md,提交 d8e0c52
工具
0版本歷史
1- v0.0.15最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分