#!/usr/bin/env python3
"""Update Claude Desktop config to use wrapper script."""
import json
import sys
from pathlib import Path
def get_claude_desktop_config_path():
"""Get the Claude Desktop configuration file path for the current OS."""
if sys.platform == "darwin": # macOS
return Path.home() / "Library/Application Support/Claude/claude_desktop_config.json"
elif sys.platform == "win32": # Windows
return Path.home() / "AppData/Roaming/Claude/claude_desktop_config.json"
else: # Linux
return Path.home() / ".config/Claude/claude_desktop_config.json"
def update_config_with_wrapper():
"""Update the configuration to use the wrapper script."""
config_path = get_claude_desktop_config_path()
try:
# Read existing config
with open(config_path, 'r') as f:
config = json.load(f)
# Update with wrapper script
config["mcpServers"]["elevenlabs"] = {
"command": "/Users/alex/claude/11-mcp/run_elevenlabs_mcp.sh",
"args": []
}
# Write back
with open(config_path, 'w') as f:
json.dump(config, f, indent=2)
print("โ
Updated Claude Desktop config to use wrapper script")
print(f" Script: /Users/alex/claude/11-mcp/run_elevenlabs_mcp.sh")
print(f" Config: {config_path}")
return True
except Exception as e:
print(f"โ Error updating config: {e}")
return False
if __name__ == "__main__":
success = update_config_with_wrapper()
if success:
print("\n๐ Now restart Claude Desktop to test the wrapper script")
print("๐งช Test with: 'What MCP tools are available?'")
else:
print("โ Failed to update configuration")
sys.exit(1)