Repository navigation
feat(mcp): scope advertised tools by family - #7228
Conversation
Integrate #3026 onto current main, preserving full/compact/off output profiles, summary/complete session semantics and main parsed registration ownership. Use one family inventory for runtime and product metadata, including current analysis-setting and environment contracts. Gate optional provider probes and verify named SDK scope, canonical availability and invalid-scope recovery. Co-authored-by: Codebuff <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc71669d7f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
[Medium impact] The reviewed changes appear safe to merge; no blocking finding remains. SummaryAdds opt-in tool-family selection across MCP discovery, status, prompts, catalog identity, and setup.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Selection[Selected tool families] --> Inventory[Shared family inventory]
Inventory --> Tools[Advertised tools]
Inventory --> Prompts[Available prompts]
Inventory --> Identity[Catalog identity]
Inventory --> Guidance[Scope-aware recovery advice]
Tools --> Doctor[Doctor checks]
Prompts --> Doctor
Identity --> Doctor
Reviews (3) · Last reviewed commit: "fix(mcp): align recovery guidance with a..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5e05edf45
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Since morluto#7228 the contract-owned family inventory gives every tool one selectable id, the vocabulary REA_MCP_TOOL_FAMILIES accepts. Advertise that id instead of the adapter kind so clients can map an advertised tool back to the scope that enables it.
* feat(mcp): advertise each tool's family in tools/list _meta Clients that index a large catalog lazily had to guess each REA tool's group from its name. Every tools/list entry now carries the contract's adapter family under the vendor-prefixed _meta key "io.github.morluto/rea", attached once at the contract-to-registration boundary. The recorded catalog replays it unchanged on the deferred path. No tool is hidden or renamed and input schemas are unchanged. Closes #6870 * refactor(mcp): advertise the selectable family id in tools/list _meta Since #7228 the contract-owned family inventory gives every tool one selectable id, the vocabulary REA_MCP_TOOL_FAMILIES accepts. Advertise that id instead of the adapter kind so clients can map an advertised tool back to the scope that enables it. * fix(mcp): omit family metadata for contracts outside the inventory Renamed test fixtures have no published family; advertise nothing for them instead of throwing. Drop the docs claim that a family move changes the catalog digest, since the digest hashes the adapter kind. * docs(mcp): scope family _meta promise to domain tools; pin catalog env in test --------- Co-authored-by: Vincent Koc <[email protected]>
Summary
Fixes #3246. Add opt-in
REA_MCP_TOOL_FAMILIES=native,application,sessionandrea setup --tool-familiesso clients discover only relevant tools. Unset configuration retains the existing catalog. Builds on #3026 by @0xLLVEL; upstream authorship and assistance trailers are preserved.Change and scope
The parsed family selection is retained in shared configuration; CLI
capabilities/providersand MCP use one catalog-identity owner. One contract-owned family inventory drives registration, prompts, setup, doctor and catalog identity. Disabled tools reject direct calls; session status counts only advertised tools and skips unrelated optional-provider probes. Initialization/recovery guidance names only advertised tools; real stdio tests cover scopes that advertise no prompts (the SDK already normalizes absent prompt capability). All six input/output schema profiles and canonical response validation remain supported. Setup is additive, backed up and idempotent; invalid scope fails before writes.Scope decision: not applicable; existing provider boundaries, no added target execution or mutation. CLI setup can write caller-selected configuration; analysis reads existing binaries. Evidence identity, coverage, limitations, retained paging and complete export remain intact. Include
applicationfor retained Evidence queries and analysis settings.Evidence and validation
full,compactandoffoutput profiles, including scoped discovery/status and rejection of disabled tools.npm run build:cached,npm run check:fast,npm run docs:check(9 checks),npm run format:checkpassed after rebasing ontoe54bf1006.Actual SDK workflow against system
libcrypto.so.3: two discoveries, cold/warm export inspection, first/last retained pages, complete bundle export and offline verification. All four configurations returned the same 5,367 GNU-nm-verified names/addresses and identical full Evidence hash. Linux only; external deep providers were not required or verified by this feature.Single sequential samples on a shared host; the unset control also varies substantially, so these do not establish a general speedup. Tokens use
cl100k_base, not measured model usage. Each completed workflow includes cold/warm calls and cleanup; 2-CPU affinity, 8-GiB guard, no OOM. Reproduction, exact revisions, retained identities and measurement limitations: experiment.CI attribution and authorized bypass
Final head
03cb8a110, CI run 40315595135: static checks, source tests, package build, docs, Windows capability/package checks, native package baselines and Greptile passed. Test shards 2 and 3 passed. Shard 8 failed one WorkBuddy path assertion; five other shards were cancelled, with four additional assertions found in their logs. Those cancelled shards do not establish complete coverage.Exact clean-main
e54bf1006and feature controls reproduce all five built-suite assertions with identical failed-case names and diagnostics: WorkBuddy/Trae personal skill paths, redirected-AppData Claude Desktop uninstall, pwntools completed-read cleanup, and pcap ENOTDIR allocation. Related producers/tests are unchanged. Node 22.23.4 separately reproduces the same five SQLite descriptor-cleanup failures on both revisions (16 pass); Node 24 and 26 SQLite CI passes. Aggregate Portable tests/CI required failures derive from these results.All reported assertion failures are attributed; no unclassified assertion failures remain in downloaded failed/cancelled logs. Unexecuted/cancelled coverage remains unverified. The user explicitly authorized bypass for demonstrated baseline failures and the unchecked human-readiness gate; no human review is attested.
Author readiness
Human owner: @gensokyo-dev
These declarations remain unchecked; the user explicitly authorized opening ready for review and bypassing this gate without an AI attestation of human review.