Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/fs_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,24 @@ pub struct FileSearchResult {
pub matches: Vec<ContentMatchResult>,
}

/// 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
#[allow(clippy::ptr_arg)]
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<Self> {
let normalized_dirs: Vec<PathBuf> = allowed_directories
.iter()
.map(fix_dockerhub_mcp_registry_gateway)
.map_while(|dir| {
let expand_result = expand_home(dir.into());
if !expand_result.is_dir() {
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ async fn main() {
if let Err(error) = server::start_server(arguments).await {
eprintln!("{error}");
}
println!(">>> 90 {:?} ", 90);
}