From 981cbd5bfb4571ff582a0b3528f3df98af6ff64c Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 22 Sep 2025 16:52:31 -0300 Subject: [PATCH 1/2] fix: mcp-registry issue --- src/fs_service.rs | 13 +++++++++++++ src/main.rs | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/fs_service.rs b/src/fs_service.rs index bab712e..e1eb273 100644 --- a/src/fs_service.rs +++ b/src/fs_service.rs @@ -75,10 +75,23 @@ pub struct FileSearchResult { pub matches: Vec, } +/// This addresses the issue with the DockerHub mcp-registry & mcp-gateway where tool discovery fails to resolve +/// references to 'example' or 'default' values when running the run->command from the server.yaml file +/// should be removed once mcp-gateway is more mature +/// reference: https://github.com/docker/mcp-registry/blob/7d815fac2f3b7a9717eebc3f3db215de3ce3c3c7/internal/mcp/client.go#L170-L173 +fn fix_dockerhub_mcp_registry_gateway(input: &String) -> &str { + if input.contains("{{rust-mcp-filesystem.allowed_directories|volume-target|into}}") { + "." + } else { + input + } +} + impl FileSystemService { pub fn try_new(allowed_directories: &[String]) -> ServiceResult { let normalized_dirs: Vec = allowed_directories .iter() + .map(fix_dockerhub_mcp_registry_gateway) .map_while(|dir| { let expand_result = expand_home(dir.into()); if !expand_result.is_dir() { diff --git a/src/main.rs b/src/main.rs index ef0e08e..7f444b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,5 +12,4 @@ async fn main() { if let Err(error) = server::start_server(arguments).await { eprintln!("{error}"); } - println!(">>> 90 {:?} ", 90); } From d2ba1ed835742eb624febfe30e7ecc42130a415c Mon Sep 17 00:00:00 2001 From: Ali Hashemi Date: Mon, 22 Sep 2025 18:18:34 -0300 Subject: [PATCH 2/2] clippy flag --- src/fs_service.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fs_service.rs b/src/fs_service.rs index e1eb273..cb10c13 100644 --- a/src/fs_service.rs +++ b/src/fs_service.rs @@ -79,6 +79,7 @@ pub struct FileSearchResult { /// references to 'example' or 'default' values when running the run->command from the server.yaml file /// should be removed once mcp-gateway is more mature /// reference: https://github.com/docker/mcp-registry/blob/7d815fac2f3b7a9717eebc3f3db215de3ce3c3c7/internal/mcp/client.go#L170-L173 +#[allow(clippy::ptr_arg)] fn fix_dockerhub_mcp_registry_gateway(input: &String) -> &str { if input.contains("{{rust-mcp-filesystem.allowed_directories|volume-target|into}}") { "."