Skip to content

Commit 83b7a89

Browse files
Fix: better compatibility with original mcp2cli implementation (#2)
1 parent 2e54d68 commit 83b7a89

16 files changed

Lines changed: 352 additions & 170 deletions

File tree

Cargo.lock

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ async-trait = "0.1"
6464
rand = "0.8"
6565
base64 = "0.22"
6666

67+
# Binary path resolution (for bake install)
68+
which = "7"
69+
6770
[dev-dependencies]
6871
wiremock = "0.6"
6972
tempfile = "3"

src/bake/config.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ pub fn config_dir() -> PathBuf {
99
if let Ok(dir) = std::env::var("MCP2CLI_CONFIG_DIR") {
1010
PathBuf::from(dir)
1111
} else {
12-
dirs::config_dir()
12+
dirs::home_dir()
1313
.unwrap_or_else(|| PathBuf::from("/tmp"))
14+
.join(".config")
1415
.join("mcp2cli")
1516
}
1617
}
@@ -103,15 +104,12 @@ pub async fn remove_baked_from(dir: &Path, name: &str) -> Result<bool> {
103104
}
104105

105106
/// Mask secrets in a BakeConfig for display purposes.
106-
/// Replaces values that look like secrets (env: prefixed, or containing
107-
/// "secret", "token", "key", "password") with "***".
108107
pub fn mask_secrets(config: &BakeConfig) -> BakeConfig {
109108
let mut masked = config.clone();
110109
masked.auth_headers = config
111110
.auth_headers
112111
.iter()
113112
.map(|h| {
114-
// Format is "Key: Value" — mask the value part if it looks secret
115113
if let Some(colon_pos) = h.find(':') {
116114
let key = &h[..colon_pos];
117115
let value = h[colon_pos + 1..].trim();

0 commit comments

Comments
 (0)