generated from nhcarrigan/template
feat: add ENABLE_CLAUDEAI_MCP_SERVERS opt-out setting
Adds a toggle in the MCP Servers settings section to control whether Claude Code connects to MCP servers configured in Claude.ai. When disabled, sets ENABLE_CLAUDEAI_MCP_SERVERS=false. Also fixes a pre-existing omission of disable_cron from the TypeScript HikariConfig interface. Closes #210
This commit is contained in:
@@ -40,6 +40,9 @@ pub struct ClaudeStartOptions {
|
||||
|
||||
#[serde(default = "default_include_git_instructions")]
|
||||
pub include_git_instructions: bool,
|
||||
|
||||
#[serde(default = "default_enable_claudeai_mcp_servers")]
|
||||
pub enable_claudeai_mcp_servers: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -180,6 +183,9 @@ pub struct HikariConfig {
|
||||
|
||||
#[serde(default = "default_include_git_instructions")]
|
||||
pub include_git_instructions: bool,
|
||||
|
||||
#[serde(default = "default_enable_claudeai_mcp_servers")]
|
||||
pub enable_claudeai_mcp_servers: bool,
|
||||
}
|
||||
|
||||
impl Default for HikariConfig {
|
||||
@@ -228,6 +234,7 @@ impl Default for HikariConfig {
|
||||
task_loop_include_summary: false,
|
||||
disable_cron: false,
|
||||
include_git_instructions: true,
|
||||
enable_claudeai_mcp_servers: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,6 +283,10 @@ fn default_include_git_instructions() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn default_enable_claudeai_mcp_servers() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum BudgetAction {
|
||||
@@ -372,6 +383,7 @@ mod tests {
|
||||
assert!(!config.task_loop_include_summary);
|
||||
assert!(!config.disable_cron);
|
||||
assert!(config.include_git_instructions);
|
||||
assert!(config.enable_claudeai_mcp_servers);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -420,6 +432,7 @@ mod tests {
|
||||
task_loop_include_summary: true,
|
||||
disable_cron: true,
|
||||
include_git_instructions: false,
|
||||
enable_claudeai_mcp_servers: false,
|
||||
};
|
||||
|
||||
let json = serde_json::to_string(&config).unwrap();
|
||||
@@ -439,6 +452,7 @@ mod tests {
|
||||
assert!(deserialized.task_loop_include_summary);
|
||||
assert!(deserialized.disable_cron);
|
||||
assert!(!deserialized.include_git_instructions);
|
||||
assert!(!deserialized.enable_claudeai_mcp_servers);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -320,6 +320,11 @@ impl WslBridge {
|
||||
cmd.env("CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS", "1");
|
||||
}
|
||||
|
||||
// Opt out of claude.ai MCP servers if requested
|
||||
if !options.enable_claudeai_mcp_servers {
|
||||
cmd.env("ENABLE_CLAUDEAI_MCP_SERVERS", "false");
|
||||
}
|
||||
|
||||
cmd
|
||||
} else {
|
||||
// Running on Windows - use wsl with bash login shell to ensure PATH is loaded
|
||||
@@ -382,6 +387,11 @@ impl WslBridge {
|
||||
claude_cmd.push_str("CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1 ");
|
||||
}
|
||||
|
||||
// Opt out of claude.ai MCP servers if requested
|
||||
if !options.enable_claudeai_mcp_servers {
|
||||
claude_cmd.push_str("ENABLE_CLAUDEAI_MCP_SERVERS=false ");
|
||||
}
|
||||
|
||||
claude_cmd.push_str(
|
||||
"claude --output-format stream-json --input-format stream-json --verbose",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user