Skip to content
Open
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
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ members = [
"libs/server",
"libs/gateway",
"libs/mcp/client",
"libs/mcp/config",
"libs/mcp/server",
"libs/mcp/proxy",
"libs/shell-tool-approvals",
Expand All @@ -32,6 +33,7 @@ stakpak-api = { path = "libs/api", version = "0.3.73" }
stakpak-mcp-server = { path = "libs/mcp/server", version = "0.3.73" }
stakpak-mcp-client = { path = "libs/mcp/client", version = "0.3.73" }
stakpak-mcp-proxy = { path = "libs/mcp/proxy", version = "0.3.73" }
stakpak-mcp-config = { path = "libs/mcp/config", version = "0.3.73" }
stakpak-agent-core = { path = "libs/agent-core", version = "0.3.73" }
stakpak-gateway = { path = "libs/gateway", version = "0.3.73" }
stakpak-server = { path = "libs/server", version = "0.3.73" }
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ libsql-test = []
stakpak-api = { workspace = true }
stakpak-mcp-server = { workspace = true }
stakpak-mcp-client = { workspace = true }
stakpak-mcp-config = { workspace = true }
stakpak-mcp-proxy = { workspace = true }
stakpak-tui = { workspace = true }
stakpak-shared = { workspace = true, features = ["sqlite"] }
Expand Down
35 changes: 35 additions & 0 deletions cli/src/commands/agent/run/mcp_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,44 @@ fn build_proxy_config(
},
);

// Load external servers from config file (skip mcp_servers with reserved names)
if let Ok(config_path) = stakpak_mcp_config::find_config_file() {
match load_external_servers(&config_path) {
Ok(external_servers) => {
let mut loaded_servers = 0;
for (name, config) in external_servers {
if name == "stakpak" || name == "paks" {
tracing::warn!(
"Skipping external MCP server {} (reserved for stakpak's internal use)",
name
);
continue;
}
loaded_servers += 1;
servers.insert(name, config);
}
tracing::info!(
"Loaded {} external MCP servers from {}",
loaded_servers,
config_path
);
}
Err(e) => {
tracing::warn!("Failed to load MCP config from {}: {}", config_path, e);
}
}
}

ClientPoolConfig::with_servers(servers)
}

/// Load external MCP servers from a config file (TOML or JSON).
fn load_external_servers(config_path: &str) -> Result<HashMap<String, ServerConfig>, String> {
let config = stakpak_mcp_config::load_config(config_path.as_ref())?;
let pool_config = ClientPoolConfig::from(config);
Ok(pool_config.servers)
Comment on lines +239 to +243
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load_external_servers passes config_path.as_ref() (a &str) into stakpak_mcp_config::load_config, which takes &Path. This won’t compile as written. Convert the string to a &Path (e.g., Path::new(config_path)) or change load_external_servers to accept impl AsRef<Path> and pass as_ref() through consistently.

Copilot uses AI. Check for mistakes.
}

/// Start the proxy server
async fn start_proxy(
pool_config: ClientPoolConfig,
Expand Down
Loading
Loading