"""Fix the Claude Desktop config file with proper JSON formatting"""
import json
import os
config_path = os.path.join(os.environ['APPDATA'], 'Claude', 'claude_desktop_config.json')
config_dir = os.path.dirname(config_path)
# Ensure directory exists
os.makedirs(config_dir, exist_ok=True)
# Create proper config
config = {
"mcpServers": {
"inventory-mcp": {
"command": "C:\\Users\\aditi\\Anaconda3\\python.exe",
"args": [
"C:\\Users\\aditi\\Downloads\\inventory-mcp-server-master\\inventory-mcp-server.py"
],
"env": {
"SUPABASE_DB_PASSWORD": "root"
}
}
}
}
# Write with proper JSON formatting (no BOM, proper encoding)
try:
with open(config_path, 'w', encoding='utf-8', newline='\n') as f:
json.dump(config, f, indent=2, ensure_ascii=False)
print(f"✓ Configuration file written successfully!")
print(f" Location: {config_path}")
print(f"\nConfiguration:")
print(json.dumps(config, indent=2))
# Verify it can be read back
with open(config_path, 'r', encoding='utf-8') as f:
verify = json.load(f)
print(f"\n✓ Verified: File can be read correctly")
except Exception as e:
print(f"❌ Error: {e}")
import traceback
traceback.print_exc()