fix: remote Chrome PDF export & MCP endpoint sync (#15)
All checks were successful
CI / Check (push) Successful in 11m16s
CI / Detect Changes (push) Successful in 3s
CI / Deploy Agent (push) Successful in 3s
CI / Deploy Dashboard (push) Successful in 2s
CI / Deploy Docs (push) Has been skipped
CI / Deploy MCP (push) Has been skipped

This commit was merged in pull request #15.
This commit is contained in:
2026-03-13 10:12:20 +00:00
parent a529e9af0c
commit 4eac1209d8
3 changed files with 234 additions and 15 deletions

View File

@@ -150,16 +150,23 @@ async fn seed_default_mcp_servers(db: &Database, mcp_endpoint_url: Option<&str>)
let collection = db.mcp_servers();
for (name, description, tools) in defaults {
// Skip if already exists
let exists = collection
.find_one(doc! { "name": name })
.await
.ok()
.flatten()
.is_some();
let expected_url = format!("{endpoint}/mcp");
if exists {
for (name, description, tools) in defaults {
// If it already exists, update the endpoint URL if it changed
if let Ok(Some(existing)) = collection.find_one(doc! { "name": name }).await {
if existing.endpoint_url != expected_url {
let _ = collection
.update_one(
doc! { "name": name },
doc! { "$set": { "endpoint_url": &expected_url } },
)
.await;
tracing::info!(
"Updated MCP server '{name}' endpoint: {} -> {expected_url}",
existing.endpoint_url
);
}
continue;
}