Skip to content

feat(mcp): resources/list enumeration, argument completion, swap notifications - #410

Merged
ShixiangWang merged 1 commit into
mainfrom
feat/mcp-capability-polish
Oct 19, 2026
Merged

ShixiangWang merged 1 commit into
mainfrom
feat/mcp-capability-polish

Conversation

@ShixiangWang

Copy link
Copy Markdown
Member

Summary

Protocol audit against the MCP specification found three capability gaps in bizard-mcp; this PR closes all three, test-first.

  1. Resource template enumeration — bizard://tutorial/{chartId} registered with list: undefined, so clients could not discover tutorial URIs via resources/list. Now every chart in the live bundle enumerates as bizard://tutorial/{chartId} with per-item name/title/description.
  2. Argument completion — adapt / troubleshoot prompt chartId arguments (and the tutorial template's chartId variable) now autocomplete via completion/complete, case-insensitive against the catalog, capped at the spec's 100-value limit. Degraded mode (no snapshot) yields empty suggestions instead of errors. Implemented with the SDK's completable() helper (present since 1.12.0, our declared floor — no bump needed).
  3. Hot-swap notification — the §3.4 background update check hot-swaps the bundle but never told clients; cached resource lists went stale silently. The swap now fires notifications/resources/list_changed (silent no-op when unconnected — SDK guard verified). The swap trigger is injectable via startUpdateCheck so hosts/tests can fire swaps manually.

Verification

  • TDD throughout: each capability watched failing first (resources/list → 818 URIs missing; completion/complete → Method not found; list_changed → null)
  • 15 new tests across test/resources.test.ts, test/prompts.test.ts, test/entry.test.ts; suite 88 → 104, all green
  • Coverage gate: statements 89.5% → 93.9% (gate 80%)
  • Built-binary smoke over stdio: capabilities advertise completions: {} + resources.listChanged: true; resources/list returns 818 URIs; completion/complete on the adapt prompt resolves 085-half-violin-637 … for query viol
  • Docs synced: mcp/README.md, Skills.qmd, Skills.zh.qmd

Test plan

  • npm test — 104/104
  • npm run coverage — 93.9% statements (≥ 80% gate)
  • npm run build + stdio smoke of dist/index.js (initialize → resources/list → completion/complete)
  • CI green on this PR

🤖 Generated with Claude Code

…fications

Close the three MCP capability gaps found in the protocol audit:

- bizard://tutorial/{chartId} now lists one resource per chart in
  resources/list and autocompletes chartId via completion/complete
  (case-insensitive, spec-capped at 100 values).
- adapt/troubleshoot prompt chartId arguments autocomplete from the
  live bundle via the SDK completable() wrapper; degraded mode yields
  no suggestions instead of erroring.
- A mid-session bundle hot-swap now fires
  notifications/resources/list_changed (fire-and-forget, silent when
  unconnected); the swap trigger is injectable for hosts/tests.

Docs updated (mcp/README.md, Skills EN/zh); 15 new tests; coverage
89.5% -> 93.9% statements. Verified end-to-end on the built binary:
capabilities advertise completions + resources.listChanged,
resources/list returns 818 URIs, completion/complete resolves ids.
@ShixiangWang
ShixiangWang merged commit 1c94e49 into main Oct 19, 2026
8 checks passed
@ShixiangWang
ShixiangWang deleted the feat/mcp-capability-polish branch October 19, 2026 16:20
@github-actions

Copy link
Copy Markdown
Contributor

✅ QMD Format Check

No new QMD tutorial files to check.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Quarto Render Preview

The new or modified Quarto files have been rendered and are available as artifacts.

🔗 View and Download Rendered Files

Click the link above, scroll to the "Artifacts" section at the bottom of the page, and download quarto-rendered-files to preview the rendered HTML files.

Modified files:

Skills.qmd
Skills.zh.qmd

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.

1 participant