{"record":{"id":"4614a725b5a3b3f1","repo":"gitbutlerapp/gitbutler","slug":"the-mcp-client-did-not-provide-any-filesystem-root","errorCode":null,"errorMessage":"The MCP client did not provide any filesystem roots. Pass the repository argument explicitly.","messagePattern":"The MCP client did not provide any filesystem roots\\. Pass the repository argument explicitly\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/mcp/mod.rs","lineNumber":515,"sourceCode":"    let supports_roots = peer\n        .peer_info()\n        .is_some_and(|client| client.capabilities.roots.is_some());\n    if !supports_roots {\n        bail!(\n            \"No repository was provided and this MCP client does not expose filesystem roots. Pass the repository argument explicitly.\"\n        );\n    }\n\n    let roots = peer\n        .list_roots()\n        .await\n        .context(\"Could not request filesystem roots from the MCP client\")?;\n    repository_from_roots(&roots.roots)\n}\n\nfn repository_from_roots(roots: &[Root]) -> Result<ResolvedRepository> {\n    if roots.is_empty() {\n        bail!(\n            \"The MCP client did not provide any filesystem roots. Pass the repository argument explicitly.\"\n        );\n    }\n\n    let mut failures = Vec::new();\n    for root in roots {\n        let path = match root_path(root) {\n            Ok(path) => path,\n            Err(err) => {\n                failures.push(err.to_string());\n                continue;\n            }\n        };\n        match open_repository(&path) {\n            Ok(resolved) => return Ok(resolved),\n            Err(err) => failures.push(format!(\"{}: {err:#}\", path.display())),\n        }\n    }","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/mcp/mod.rs#L497-L533","documentation":"repository_from_roots (crates/but/src/command/mcp/mod.rs:515) bails when the client advertised roots support but list_roots returned an empty list — there is nothing to probe for a Git repository, so the explicit `repository` argument is required.","triggerScenarios":"Calling an MCP tool without `repository` when the client supports roots but has no roots configured (empty workspace), or all roots were denied/hidden.","commonSituations":"The project folder was never added to the MCP client's workspace; client launched in an empty directory; permissions revoked all roots.","solutions":["Add the project folder as a workspace root in the MCP client, then retry.","Or pass the `repository` argument explicitly.","Check the client's roots/permissions UI to confirm at least one root is exposed."],"exampleFix":"// before\n{ \"review_numbers\": [12] }  // client roots: []\n\n// after: add the folder as a root in the client, or\n{ \"repository\": \"/home/user/project\", \"review_numbers\": [12] }","handlingStrategy":"validation","validationCode":"if repository.is_none() {\n    let roots = peer.list_roots().await?;\n    ensure!(!roots.roots.is_empty(), \"client exposes no roots; pass repository explicitly\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(err) = resolve_repository(None, context).await {\n    if err.to_string().contains(\"did not provide any filesystem roots\") {\n        // ask the user to add a workspace root, or retry with explicit path\n    }\n}","preventionTips":["Add the project folder as a root in the MCP client before connecting.","Default to passing `repository` explicitly in automation.","Grant the client roots access so it can enumerate the workspace."],"tags":["mcp","workspace","roots","repository"],"backgroundTag":"missing-required-argument","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}