Skip to content

feat: make --strict-mcp-config configurable via settings#788

Open
shahartaite-talon wants to merge 5 commits into
refactoringhq:mainfrom
shahartaite-talon:feat/configurable-strict-mcp-config
Open

feat: make --strict-mcp-config configurable via settings#788
shahartaite-talon wants to merge 5 commits into
refactoringhq:mainfrom
shahartaite-talon:feat/configurable-strict-mcp-config

Conversation

@shahartaite-talon

Copy link
Copy Markdown

Summary

  • Adds a strict_mcp_config boolean setting (default true) that controls whether --strict-mcp-config and --mcp-config flags are passed to Claude Code
  • When strict_mcp_config: false is set in the app settings JSON, both flags are omitted — allowing Tolaria to work in environments where Claude Code has an enterprise managed-settings.json (which rejects these flags)
  • Current behavior is fully preserved when the setting is absent or true

Problem

Organizations using Claude Code with enterprise-managed settings (~/.claude/managed-settings.json) cannot use Tolaria's AI features because Claude Code rejects --strict-mcp-config and --mcp-config with:

"You cannot use --strict-mcp-config when an enterprise MCP config is present"
"You cannot dynamically configure MCP servers when an enterprise MCP config is present"

Changes

  • src-tauri/src/settings.rs — Added strict_mcp_config: Option<bool> to the Settings struct
  • src-tauri/src/claude_cli.rs — Reads the setting and passes it to the invocation layer
  • src-tauri/src/claude_invocation.rs — Conditionally applies --strict-mcp-config and --mcp-config flags based on the setting; adds test for the disabled case
  • docs/ARCHITECTURE.md — Documents the configurable behavior

Usage

Add to settings.json (macOS: ~/Library/Application Support/com.tolaria.app/settings.json):

{
  "strict_mcp_config": false
}

Test plan

  • New test agent_args_omit_strict_mcp_config_when_disabled verifies both flags are absent when disabled
  • All existing tests pass with strict_mcp_config: true (default behavior unchanged)
  • Manually verified in enterprise environment with managed-settings.json

🤖 Generated with Claude Code

shahartaite-talon and others added 5 commits May 31, 2026 19:31
Claude Code rejects both --strict-mcp-config and --mcp-config when an
enterprise managed-settings.json is present (e.g. in corporate
environments). This makes Tolaria's AI agent unusable for those users
since the flags were unconditionally applied.

Add a `strict_mcp_config` boolean to app settings (defaults to true,
preserving current behavior). When set to false, both --mcp-config and
--strict-mcp-config are omitted from the Claude invocation, allowing
Claude Code to start in enterprise-managed environments.

To use: add `"strict_mcp_config": false` to settings.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant