Skip to main content

Module claudeai_connectors

Module claudeai_connectors 

Source
Expand description

The claude.ai account’s connectors (Gmail, Calendar, Drive, Docs) are off in Claude agents by default.

Claude Code loads the connectors of the signed-in claude.ai account into every session. AgentMux has its own Google tools (Gmail, Calendar, Drive, once the person grants them), so the claude.ai ones only add a second, unauthorized copy of each, and agents keep telling the person to authorize them in claude.ai.

The switch is an environment variable the CLI reads at launch (ENABLE_CLAUDEAI_MCP_SERVERS, also the CLI’s disableClaudeAiConnectors setting). Its name is the CLI’s, not ours: when the pinned CLI version moves, the canary test below and this note are rechecked against it.

Setting agent:claudeaiconnectors: false (the default) launches Claude agents with the variable set to false; true leaves it unset, so the CLI loads the connectors as it does outside AgentMux. It takes effect at an agent’s next launch.

Constants§

ENV_SWITCH
The CLI’s own switch: false keeps the claude.ai connectors out of the session.
SETTING_CLAUDEAI_CONNECTORS
The setting. Off by default.

Functions§

apply
Keep the connectors out of a launch environment: a Claude agent’s, when the setting is off. It overwrites what the environment already carries (a persisted cmd:env), as the setting is the only way to turn them back on. Any other provider’s launch is left alone.
apply_for_spawn
apply for a launch of provider (already resolved from a legacy alias), reading the setting now. Called from cli_messaging::apply_for_spawn, which resolves the block’s provider for both switches.
enabled
Whether the connectors stay on: only a boolean true turns them on.
install_config
Attach the live settings, so SETTING_CLAUDEAI_CONNECTORS is read at each launch (bootstrap, through cli_messaging::install_config).