From 4673798ef6a98dd9b80d7e749599d680fd5aaf9e Mon Sep 17 00:00:00 2001 From: decoded-brain <102791706+decoded-brain@users.noreply.github.com> Date: Wed, 20 May 2026 18:08:40 +0300 Subject: [PATCH] fix: add pub(super) visibility to tool_router and prompt_router macros The rmcp macros #[tool_router] and #[prompt_router] generate private associated functions by default. Since handler.rs accesses these generated functions from a sibling module (via Self::tool_router() and Self::prompt_router()), the compiler rejects the code with a visibility error. Adding vis = "pub(super)" to both macro invocations makes the generated functions visible within the parent module, fixing the compilation failure. --- src/mcp/tools.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mcp/tools.rs b/src/mcp/tools.rs index f1d28c3..ad3a45a 100644 --- a/src/mcp/tools.rs +++ b/src/mcp/tools.rs @@ -17,8 +17,8 @@ use super::types::{ // Tool and prompt implementations // --------------------------------------------------------------------------- -#[tool_router] -#[prompt_router] +#[tool_router(vis = "pub(super)")] +#[prompt_router(vis = "pub(super)")] impl RustDoctorServer { pub(super) fn new() -> Self { Self {