Normalize MCP connector toggles
Desired state
computer-use enabled; claude-in-chrome, claude.ai Gmail, claude.ai Google Calendar, claude.ai Google Drive disabled, in every project.
Where the state lives
These are not a settings.json key. State lives per-project in ~/.claude.json under each project's enabledMcpServers / disabledMcpServers arrays. claudeInChromeDefaultEnabled: false is the only global default. New project dirs may start off-spec.
Procedure
Quit all other Claude Code sessions first. A running instance rewrites ~/.claude.json from memory and will clobber external edits. (The session running this skill is itself a writer — warn the user of that residual risk before editing.)
Back up: cp ~/.claude.json ~/.claude.json.bak-mcp-normalize
Apply. Creates missing keys, dedupes, and removes names cross-listed in the other array:
python3 - <<'EOF'
import json, pathlib
p = pathlib.Path.home() / '.claude.json'
d = json.loads(p.read_text())
ENABLE = ['computer-use']
DISABLE = ['claude-in-chrome', 'claude.ai Gmail',
'claude.ai Google Calendar', 'claude.ai Google Drive']
for proj in d.get('projects', {}).values():
en = [s for s in proj.get('enabledMcpServers', []) if s not in DISABLE]
dis = [s for s in proj.get('disabledMcpServers', []) if s not in ENABLE]
proj['enabledMcpServers'] = en + [s for s in ENABLE if s not in en]
proj['disabledMcpServers'] = dis + [s for s in DISABLE if s not in dis]
p.write_text(json.dumps(d, indent=2))
EOF
Verify
JSON still parses: python3 -m json.tool ~/.claude.json > /dev/null && echo valid
Re-scan every project for compliance:
python3 - <<'EOF'
import json, pathlib
d = json.loads((pathlib.Path.home() / '.claude.json').read_text())
DISABLE = {'claude-in-chrome', 'claude.ai Gmail',
'claude.ai Google Calendar', 'claude.ai Google Drive'}
bad = [k for k, p in d.get('projects', {}).items()
if 'computer-use' not in p.get('enabledMcpServers', [])
or not DISABLE <= set(p.get('disabledMcpServers', []))]
print('\n'.join(bad) or 'all compliant')
EOF
Done when: step 1 prints valid and step 2 prints all compliant. If any project is listed, re-run the apply step and re-verify.
1---2name: mcp-toggle-normalize3description: Re-normalizes MCP connector enable/disable state across all project entries in ~/.claude.json (computer-use on; claude-in-chrome and claude.ai connectors off). Use when project dirs drift off the connector spec and every entry needs fixing at once.4---56# Normalize MCP connector toggles78## Desired state910`computer-use` **enabled**; `claude-in-chrome`, `claude.ai Gmail`, `claude.ai Google Calendar`, `claude.ai Google Drive` **disabled**, in every project.1112## Where the state lives1314These are **not** a `settings.json` key. State lives per-project in `~/.claude.json` under each project's `enabledMcpServers` / `disabledMcpServers` arrays. `claudeInChromeDefaultEnabled: false` is the only global default. New project dirs may start off-spec.1516## Procedure17181. **Quit all other Claude Code sessions first.** A running instance rewrites `~/.claude.json` from memory and will clobber external edits. (The session running this skill is itself a writer — warn the user of that residual risk before editing.)192. Back up: `cp ~/.claude.json ~/.claude.json.bak-mcp-normalize`203. Apply. Creates missing keys, dedupes, and removes names cross-listed in the other array:2122 ```sh23 python3 - <<'EOF'24 import json, pathlib25 p = pathlib.Path.home() / '.claude.json'26 d = json.loads(p.read_text())27 ENABLE = ['computer-use']28 DISABLE = ['claude-in-chrome', 'claude.ai Gmail',29 'claude.ai Google Calendar', 'claude.ai Google Drive']30 for proj in d.get('projects', {}).values():31 en = [s for s in proj.get('enabledMcpServers', []) if s not in DISABLE]32 dis = [s for s in proj.get('disabledMcpServers', []) if s not in ENABLE]33 proj['enabledMcpServers'] = en + [s for s in ENABLE if s not in en]34 proj['disabledMcpServers'] = dis + [s for s in DISABLE if s not in dis]35 p.write_text(json.dumps(d, indent=2))36 EOF37 ```3839## Verify40411. JSON still parses: `python3 -m json.tool ~/.claude.json > /dev/null && echo valid`422. Re-scan every project for compliance:4344 ```sh45 python3 - <<'EOF'46 import json, pathlib47 d = json.loads((pathlib.Path.home() / '.claude.json').read_text())48 DISABLE = {'claude-in-chrome', 'claude.ai Gmail',49 'claude.ai Google Calendar', 'claude.ai Google Drive'}50 bad = [k for k, p in d.get('projects', {}).items()51 if 'computer-use' not in p.get('enabledMcpServers', [])52 or not DISABLE <= set(p.get('disabledMcpServers', []))]53 print('\n'.join(bad) or 'all compliant')54 EOF55 ```5657**Done when:** step 1 prints `valid` and step 2 prints `all compliant`. If any project is listed, re-run the apply step and re-verify.