Skip to content

feat(cli): expose keywords and recommendedFor in focus_search MCP tool#95

Merged
samuelds merged 5 commits into
developfrom
feat/bricks-search-enriched
Apr 29, 2026
Merged

feat(cli): expose keywords and recommendedFor in focus_search MCP tool#95
samuelds merged 5 commits into
developfrom
feat/bricks-search-enriched

Conversation

@samuelds
Copy link
Copy Markdown
Contributor

Summary

  • Extends SearchCommandResult with a bricks field (structured SearchResultBrick[])
  • Each SearchResultBrick includes keywords? and recommendedFor? alongside name/version/catalog/description
  • The focus_search MCP tool now returns two content items: the formatted text table + a JSON block with the structured bricks list
  • Adds toBrickResult helper in search.ts to safely forward the new fields from AggregatedBrick (via runtime cast, compatible with core >= 1.5.0)

Files modified

  • src/commands/search.ts — SearchResultBrick type, bricks field, toBrickResult helper
  • src/commands/search.test.ts — 5 new test cases (empty bricks, structured output, keywords/recommendedFor propagation)
  • src/commands/start.ts — focus_search handler returns JSON structured bricks as second content item
  • src/commands/start.test.ts — updated existing mocks + 1 new test for keywords/recommendedFor in MCP response
  • .changeset/bricks-search-enriched.md — minor changeset

Dependency note

Full keywords/recommendedFor enrichment requires @focus-mcp/core >= 1.5.0 (see core PR #63). With core 1.4.0, parseCatalog ignores these fields and they will be undefined in results. The cli code and propagation path are already in place — only the dep bump is needed after core 1.5.0 releases.

Test plan

  • vitest run src/commands/search.test.ts — 12 tests pass (including 5 new)
  • vitest run src/commands/start.test.ts — 76 tests pass (including 1 new)
  • biome check — no errors
  • pnpm typecheck — passes (via pre-commit lint-staged)
  • gitleaks — no leaks

Release order

marketplace → core → cli

After core 1.5.0 is released, update devDependencies["@focus-mcp/core"] to ^1.5.0 in package.json before releasing this PR.

🤖 Generated with Claude Code

claude and others added 5 commits April 28, 2026 21:52
…thin wrapper

Required for focus_update + focus_upgrade MCP tools (thin wrapper depends on
executeUpgrade exported from @focus-mcp/core 1.2.0).
The focus_search tool now returns a structured JSON block alongside the
formatted table, including keywords and recommendedFor per brick when
present. SearchCommandResult gains a bricks field for downstream use.
Full enrichment requires @focus-mcp/core >= 1.5.0 once released.
- CHANGELOG.md: garder les deux (additif develop au-dessus)
- package.json: version 2.1.0 (develop), @focus-mcp/core ^1.4.0 (develop)
- pnpm-lock.yaml: régénéré depuis develop
- start.test.ts: corriger focus_search → focus_bricks_search dans le test keywords/recommendedFor

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@samuelds samuelds merged commit 01ef020 into develop Apr 29, 2026
10 checks passed
@samuelds samuelds deleted the feat/bricks-search-enriched branch April 30, 2026 07:45
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