fix(bin): force collectMcpTools: true for mcp:serve + inject --invocation for mcp:install#7
Merged
Conversation
…tion for mcp:install Mirrors fluttersdk_dusk's Bug 1 + Bug 3 wrapper fixes. Bug 1: bin/fluttersdk_telescope.dart auto-injects --invocation=fluttersdk_telescope when forwarding mcp:install to the artisan substrate, so .mcp.json writes 'dart run fluttersdk_telescope mcp:serve' when bin/fsa is absent. Bug 3: bin/fluttersdk_telescope.dart forces collectMcpTools: true for mcp:serve dispatch. dart run fluttersdk_telescope mcp:serve now surfaces all 9 telescope_* MCP tools (previously returned 0 plugin tools). - New lib/src/cli_args.dart with pure injectInvocationForMcpInstall (copy-with-rename of dusk's helper; only 2 callers so extraction to a shared utility is deferred per the rule of three). - New test/src/cli_args_test.dart with 4 cases (mcp:install detection + override-safe equal-form and whitespace-form paths). - CHANGELOG: ### Changed bullet for Bug 1 + ### Fixed bullet for Bug 3. Part of the cross-repo dusk-cli-fixes-rename plan (.ac/plans/dusk-cli-fixes-rename/plan.md in fluttersdk_dusk repo).
There was a problem hiding this comment.
Pull request overview
Fixes Telescope’s standalone CLI wrapper (dart run fluttersdk_telescope ...) so it correctly participates in Artisan’s MCP install/serve flows, aligning behavior with the companion substrate changes.
Changes:
- Inject
--invocation=fluttersdk_telescopewhen forwardingmcp:installso the substrate can write the correct.mcp.jsonfallback entry. - Force MCP tool collection when dispatching
mcp:serveso all 9telescope_*tools are surfaced (instead of 0). - Add a small pure CLI-args helper with unit tests, and document the behavior in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| bin/fluttersdk_telescope.dart | Injects --invocation for mcp:install and sets collectMcpTools for mcp:serve. |
| lib/src/cli_args.dart | Adds injectInvocationForMcpInstall() pure helper used by the bin wrapper. |
| test/src/cli_args_test.dart | Adds unit coverage for invocation injection and override preservation. |
| CHANGELOG.md | Records the mcp:install fallback change and the mcp:serve tool-collection fix under [Unreleased]. |
CI's dart format check is stricter than my local run (Dart version drift). Re-formatted to satisfy the format gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirrors fluttersdk_dusk's Bug 1 + Bug 3 wrapper fixes. Pairs with fluttersdk/artisan#18 (substrate
--invocationflag) and fluttersdk/dusk#10 (dusk-side fixes).Bug 1 (mcp:install fallback):
bin/fluttersdk_telescope.dartauto-injects--invocation=fluttersdk_telescopewhen forwardingmcp:installto the artisan substrate..mcp.jsonnow writesdart run fluttersdk_telescope mcp:servewhenbin/fsais absent, instead of the legacy:dispatcherfallback.Bug 3 (mcp:serve telescope-tools empty):
bin/fluttersdk_telescope.dartforcescollectMcpTools: trueformcp:servedispatch.dart run fluttersdk_telescope mcp:servenow surfaces all 9 telescope_* MCP tools (previously returned 0 plugin tools).Changes
bin/fluttersdk_telescope.dart: two interceptions —mcp:installarg-inject (line 33) +mcp:servecollectMcpTools: isMcpServe(line 44).lib/src/cli_args.dart(NEW): pureinjectInvocationForMcpInstall(args, invocation)helper. Copy-with-rename of dusk's helper; only 2 callers across the org so extraction to a shared utility is deferred per rule of three.test/src/cli_args_test.dart(NEW): 4 cases (no mcp:install → unchanged; mcp:install → injects; equal-form override → preserved; whitespace-form override → preserved).CHANGELOG.md:### Changedbullet for Bug 1 +### Fixedbullet for Bug 3, both under[Unreleased].Tool count unchanged: 9 telescope_* MCP tools.
Test plan
Manual smoke against this branch (with companion artisan #18 active):
Response includes all 9 telescope_* tool names (
telescope_tail,telescope_requests,telescope_clear,telescope_exceptions,telescope_events,telescope_gates,telescope_dumps,telescope_queries,telescope_caches) alongside the 10 substrateartisan_*tools.Out of scope for this PR
dart run fluttersdk_artisanreferences analogous to dusk's. Tracked as a follow-up plantelescope-cli-rename-sweep(separate PR).skills/fluttersdk-telescope/(SKILL.md, references/*) from prior unrelated work. Preserved in the working tree; not part of this PR.Companion PRs (cross-repo plan)
This PR is part of the cross-repo plan
dusk-cli-fixes-rename(plan file lives in fluttersdk_dusk repo). Companion PRs:feat/mcp-install-invocation-flag(substrate--invocationflag; land first — this PR depends on it).dart run fluttersdk_duskrename dusk#10 —fix/cli-bugs-rename-sweep(dusk-side fixes + full rename sweep inside dusk).🤖 Generated with Claude Code