McpInstallCommand class
artisan mcp:install — idempotently adds the fluttersdk MCP server entry
to the project's .mcp.json (Claude Code / Cursor / Windsurf config).
Entry shape branches on whether bin/fsa is present and the platform is
not Windows:
POSIX with bin/fsa present (fast path, ~110ms startup):
{
"mcpServers": {
"fluttersdk": {
"command": "./bin/fsa",
"args": ["mcp:serve"],
"cwd": "."
}
}
}
Windows or when bin/fsa is absent (dart-direct fallback, ~3s startup):
{
"mcpServers": {
"fluttersdk": {
"command": "dart",
"args": ["run", ":dispatcher", "mcp:serve"],
"cwd": "."
}
}
}
Pre-existing mcpServers keys are preserved. Running the command twice
replaces the fluttersdk key in-place (idempotent; no duplicates).
After writing, the success line reminds the user that Claude Code does NOT
auto-reconnect on .mcp.json edits and must be told to do so manually.
- Inheritance
-
- Object
- ArtisanCommand
- McpInstallCommand
Constructors
- McpInstallCommand({bool hasFsa()?, bool isWindows()?})
- Creates an McpInstallCommand.
Properties
- boot → CommandBoot
-
What boot context the dispatcher must establish before calling handle.
See CommandBoot for the V1 taxonomy (none, connected).
no setteroverride
- description → String
-
One-line description (rendered in
artisan listnext to name).no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Dispatch key. Colons (
:) act as namespace prefixes forartisan listgrouping (e.g.dusk:snapgroups underdusk).no setteroverride - parsedSignature → CommandSignature?
-
Lazy-parsed signature. Cached for the lifetime of the instance.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signature → String?
-
Optional Laravel-style signature DSL. When set, name derives from
it and configure auto-registers the declared options/flags.
no setterinherited
Methods
-
configure(
ArgParser parser) → void -
Auto-applies signature to the parser when set. Override to register
extra ArgParser features (mandatory options, aliases, custom value
validators). When you override, call
super.configure(parser)first if you also use the signature DSL.override -
handle(
ArtisanContext ctx) → Future< int> -
Execute the command. Returns the process exit code.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited