Skip to content

refactor(server): gate tool_catalog behind test-support#375

Merged
randomparity merged 1 commit into
mainfrom
refactor/server-gate-tool-catalog-test-support-339
May 29, 2026
Merged

refactor(server): gate tool_catalog behind test-support#375
randomparity merged 1 commit into
mainfrom
refactor/server-gate-tool-catalog-test-support-339

Conversation

@randomparity
Copy link
Copy Markdown
Owner

mcp::tool_catalog was a pub mod and TOOL_DEFS a pub static, exposed on the (doc-hidden) library surface solely so the binary's test-support dump-tool-catalog subcommand could reach the catalog. Every production caller is in-crate, routing through dispatch and server.

This demotes the module to pub(crate) and re-exports TOOL_DEFS at mcp::TOOL_DEFS under #[cfg(any(test, feature = "test-support"))], mirroring how execute_tool_for_test is gated in server.rs. The binary's dump_tool_catalog cli imports the gated re-export; in-crate callers keep the canonical crate::mcp::tool_catalog path.

Also fixes a stale output_schema doc reference in mcp_wire_conformance.rs left by #336's rename.

Verification:

  • default cargo build -p rimap-server clean (re-export inactive, no unreachable-pub warning)
  • cargo clippy -p rimap-server --all-targets --all-features clean
  • cargo test --features test-support --test dump_tool_catalog 4/4 pass
  • 14 tool_catalog unit tests pass

Closes #339

🤖 Generated with Claude Code

`mcp::tool_catalog` was `pub mod` and `TOOL_DEFS` a `pub static`,
exposed on the (doc-hidden) library surface solely so the binary's
test-support `dump-tool-catalog` subcommand could reach the catalog.
Every production caller is in-crate, routing through `dispatch` and
`server`.

Demote the module to `pub(crate)` and re-export `TOOL_DEFS` at
`mcp::TOOL_DEFS` under `#[cfg(any(test, feature = "test-support"))]`,
mirroring how `execute_tool_for_test` is gated in `server.rs`. The
binary's `dump_tool_catalog` cli imports the gated re-export. In-crate
callers keep the canonical `crate::mcp::tool_catalog` path.

Also fix a stale `output_schema` doc reference in the wire-conformance
test left by #336's rename.

Closes #339
@randomparity randomparity merged commit f81a8f6 into main May 29, 2026
12 checks passed
@randomparity randomparity deleted the refactor/server-gate-tool-catalog-test-support-339 branch May 29, 2026 12:20
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.

refactor(server): gate tool_catalog/TOOL_DEFS behind test-support

1 participant