Skip to content

fix(bin): force collectMcpTools: true for mcp:serve + inject --invocation for mcp:install#7

Merged
anilcancakir merged 2 commits into
masterfrom
fix/mcp-wrapper-bug3-and-invocation
May 28, 2026
Merged

fix(bin): force collectMcpTools: true for mcp:serve + inject --invocation for mcp:install#7
anilcancakir merged 2 commits into
masterfrom
fix/mcp-wrapper-bug3-and-invocation

Conversation

@anilcancakir

Copy link
Copy Markdown
Contributor

Summary

Mirrors fluttersdk_dusk's Bug 1 + Bug 3 wrapper fixes. Pairs with fluttersdk/artisan#18 (substrate --invocation flag) and fluttersdk/dusk#10 (dusk-side fixes).

Bug 1 (mcp:install fallback): bin/fluttersdk_telescope.dart auto-injects --invocation=fluttersdk_telescope when forwarding mcp:install to the artisan substrate. .mcp.json now writes dart run fluttersdk_telescope mcp:serve when bin/fsa is absent, instead of the legacy :dispatcher fallback.

Bug 3 (mcp:serve telescope-tools empty): 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).

Changes

  • bin/fluttersdk_telescope.dart: two interceptions — mcp:install arg-inject (line 33) + mcp:serve collectMcpTools: isMcpServe (line 44).
  • lib/src/cli_args.dart (NEW): pure injectInvocationForMcpInstall(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: ### Changed bullet for Bug 1 + ### Fixed bullet for Bug 3, both under [Unreleased].

Tool count unchanged: 9 telescope_* MCP tools.

Test plan

dart format --output=none --set-exit-if-changed lib/ test/ bin/    # clean after 1 fix applied
dart analyze lib/ test/ bin/                                        # No issues found
flutter test --exclude-tags=integration --timeout=30s               # 253 pass, 0 fail

Manual smoke against this branch (with companion artisan #18 active):

(echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}'; echo '{"jsonrpc":"2.0","id":2,"method":"tools/list"}') | timeout 12 dart run fluttersdk_telescope mcp:serve

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 substrate artisan_* tools.

Out of scope for this PR

  • Rename sweep: telescope's own docs have dart run fluttersdk_artisan references analogous to dusk's. Tracked as a follow-up plan telescope-cli-rename-sweep (separate PR).
  • Pre-existing skills/ work: this repo has uncommitted edits in 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:

🤖 Generated with Claude Code

…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).
Copilot AI review requested due to automatic review settings May 28, 2026 08:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_telescope when forwarding mcp:install so the substrate can write the correct .mcp.json fallback entry.
  • Force MCP tool collection when dispatching mcp:serve so all 9 telescope_* 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.
@anilcancakir anilcancakir merged commit 69486dc into master May 28, 2026
1 check passed
@anilcancakir anilcancakir deleted the fix/mcp-wrapper-bug3-and-invocation branch May 28, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants