feat(cli): expose keywords and recommendedFor in focus_search MCP tool#95
Merged
Conversation
…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>
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
SearchCommandResultwith abricksfield (structuredSearchResultBrick[])SearchResultBrickincludeskeywords?andrecommendedFor?alongside name/version/catalog/descriptionfocus_searchMCP tool now returns two content items: the formatted text table + a JSON block with the structured bricks listtoBrickResulthelper insearch.tsto safely forward the new fields fromAggregatedBrick(via runtime cast, compatible with core >= 1.5.0)Files modified
src/commands/search.ts— SearchResultBrick type, bricks field, toBrickResult helpersrc/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 itemsrc/commands/start.test.ts— updated existing mocks + 1 new test for keywords/recommendedFor in MCP response.changeset/bricks-search-enriched.md— minor changesetDependency note
Full
keywords/recommendedForenrichment requires@focus-mcp/core >= 1.5.0(see core PR #63). With core 1.4.0,parseCatalogignores these fields and they will beundefinedin 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 errorspnpm typecheck— passes (via pre-commit lint-staged)Release order
marketplace → core → cli
After core 1.5.0 is released, update
devDependencies["@focus-mcp/core"]to^1.5.0inpackage.jsonbefore releasing this PR.🤖 Generated with Claude Code