mcp: redact stdio server spec debug
This commit is contained in:
+19
-1
@@ -52,7 +52,7 @@ impl Default for McpStdioLimits {
|
||||
}
|
||||
|
||||
/// A resolved, explicit local stdio MCP server process specification.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct McpStdioServerSpec {
|
||||
pub name: String,
|
||||
pub command: String,
|
||||
@@ -107,6 +107,24 @@ impl McpStdioServerSpec {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for McpStdioServerSpec {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let env: BTreeMap<&str, &str> = self
|
||||
.env
|
||||
.keys()
|
||||
.map(|name| (name.as_str(), "[redacted]"))
|
||||
.collect();
|
||||
f.debug_struct("McpStdioServerSpec")
|
||||
.field("name", &self.name)
|
||||
.field("command", &self.command)
|
||||
.field("args", &self.args)
|
||||
.field("cwd", &self.cwd)
|
||||
.field("env", &env)
|
||||
.field("redaction_count", &self.redactions.len())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
/// Resolve one explicitly named stdio server from typed MCP config.
|
||||
pub fn resolve_named_stdio_server(
|
||||
config: &McpConfig,
|
||||
|
||||
Reference in New Issue
Block a user