fix(mcp): add environment variable support for stdio MCP servers #62

Merged
sarman merged 2 commits from bug/mcp-env-vars-support into master 2026-06-01 18:27:59 +00:00
Showing only changes of commit 7cc4f0f689 - Show all commits

View File

@ -103,9 +103,16 @@ async fn discover_server_inner(
other => return Err(format!("Unknown transport type: {other}")),
};
// List tools and resources
// List tools and resources (resources are optional — not all servers implement them)
let tools = list_tools(&conn, &server.id, &server.name).await?;
let resources = list_resources(&conn, &server.id).await?;
let resources = match list_resources(&conn, &server.id).await {
Ok(r) => r,
Err(e) if e.contains("-32601") || e.contains("Method not found") => {
info!(server_id = %server.id, "Server does not support resources/list (optional)");
vec![]
}
Err(e) => return Err(e),
};
// Persist to DB
{