Skip to content

Commit e47f937

Browse files
Merge pull request #10349 from gitbutlerapp/fix-claude-mcp-configs-2
Use cli by full path
2 parents 12c7976 + 5412f11 commit e47f937

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/but-claude/src/claude_mcp.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::{
33
path::{Path, PathBuf},
44
};
55

6+
use but_action::cli::get_cli_path;
67
use serde::{Deserialize, Serialize};
78
use tokio::fs;
89

@@ -107,12 +108,15 @@ impl ClaudeMcpConfig {
107108
}
108109

109110
pub fn mcp_servers_with_security(&self) -> McpConfig {
111+
let cli_path = get_cli_path()
112+
.map(|p| p.to_string_lossy().into_owned())
113+
.unwrap_or("but".into());
110114
let mut out = self.mcp_servers();
111115
out.mcp_servers.insert(
112116
BUT_SECURITY_MCP.to_owned(),
113117
McpServer {
114118
r#type: Some("stdio".to_owned()),
115-
command: Some("but".to_owned()),
119+
command: Some(cli_path),
116120
url: None,
117121
args: Some(vec!["claude".to_owned(), "pp".to_owned()]),
118122
env: Some(HashMap::new()),

0 commit comments

Comments
 (0)