Skip to content

Commit 981cbd5

Browse files
committed
fix: mcp-registry issue
1 parent b586d41 commit 981cbd5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/fs_service.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,23 @@ pub struct FileSearchResult {
7575
pub matches: Vec<ContentMatchResult>,
7676
}
7777

78+
/// This addresses the issue with the DockerHub mcp-registry & mcp-gateway where tool discovery fails to resolve
79+
/// references to 'example' or 'default' values when running the run->command from the server.yaml file
80+
/// should be removed once mcp-gateway is more mature
81+
/// reference: https://github.com/docker/mcp-registry/blob/7d815fac2f3b7a9717eebc3f3db215de3ce3c3c7/internal/mcp/client.go#L170-L173
82+
fn fix_dockerhub_mcp_registry_gateway(input: &String) -> &str {
83+
if input.contains("{{rust-mcp-filesystem.allowed_directories|volume-target|into}}") {
84+
"."
85+
} else {
86+
input
87+
}
88+
}
89+
7890
impl FileSystemService {
7991
pub fn try_new(allowed_directories: &[String]) -> ServiceResult<Self> {
8092
let normalized_dirs: Vec<PathBuf> = allowed_directories
8193
.iter()
94+
.map(fix_dockerhub_mcp_registry_gateway)
8295
.map_while(|dir| {
8396
let expand_result = expand_home(dir.into());
8497
if !expand_result.is_dir() {

src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ async fn main() {
1212
if let Err(error) = server::start_server(arguments).await {
1313
eprintln!("{error}");
1414
}
15-
println!(">>> 90 {:?} ", 90);
1615
}

0 commit comments

Comments
 (0)