Skip to main content
Glama

DollhouseMCP

by DollhouseMCP
setup-npm.shโ€ข3.56 kB
#!/bin/bash # DollhouseMCP NPM Setup Script # Automatically configures Claude Desktop for NPM-installed DollhouseMCP set -e echo "๐ŸŽญ DollhouseMCP NPM Setup Script" echo "================================" echo # Check if DollhouseMCP is installed globally if ! command -v dollhousemcp &> /dev/null && ! npm list -g @dollhousemcp/mcp-server &> /dev/null; then echo "๐Ÿ“ฆ Installing DollhouseMCP globally..." npm install -g @dollhousemcp/mcp-server else echo "โœ… DollhouseMCP is already installed" fi echo # Detect platform and set config file path if [[ "$OSTYPE" == "darwin"* ]]; then CONFIG_FILE="$HOME/Library/Application Support/Claude/claude_desktop_config.json" PLATFORM="macOS" elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then CONFIG_FILE="$APPDATA/Claude/claude_desktop_config.json" PLATFORM="Windows" else CONFIG_FILE="$HOME/.config/Claude/claude_desktop_config.json" PLATFORM="Linux" fi echo "๐Ÿ”ง Claude Desktop Configuration" echo "==============================" echo "๐Ÿ“ Platform: $PLATFORM" echo "๐Ÿ“ Config file: $CONFIG_FILE" echo # Ensure directory exists CONFIG_DIR=$(dirname "$CONFIG_FILE") mkdir -p "$CONFIG_DIR" # Check if config file exists and read it if [[ -f "$CONFIG_FILE" ]]; then echo "โœ… Found existing Claude Desktop configuration" # Check if it has valid JSON if python3 -m json.tool "$CONFIG_FILE" > /dev/null 2>&1; then echo "๐Ÿ“– Merging with existing configuration..." # Backup existing config cp "$CONFIG_FILE" "$CONFIG_FILE.backup.$(date +%Y%m%d_%H%M%S)" echo "๐Ÿ’พ Backup saved to: $CONFIG_FILE.backup.*" # Use Python to merge the configurations python3 << EOF > "$CONFIG_FILE.tmp" import json import sys # Read existing config with open("$CONFIG_FILE", 'r') as f: config = json.load(f) # Ensure mcpServers exists if 'mcpServers' not in config: config['mcpServers'] = {} # Add or update dollhousemcp server for NPM installation config['mcpServers']['dollhousemcp'] = { "command": "npx", "args": ["@dollhousemcp/mcp-server"] } # Pretty print the result print(json.dumps(config, indent=2)) EOF # Move temp file to actual config mv "$CONFIG_FILE.tmp" "$CONFIG_FILE" echo "โœ… Configuration updated successfully!" else echo "โš ๏ธ Existing config file has invalid JSON." echo "Creating backup and starting fresh..." mv "$CONFIG_FILE" "$CONFIG_FILE.invalid.$(date +%Y%m%d_%H%M%S)" # Create fresh config cat > "$CONFIG_FILE" << EOF { "mcpServers": { "dollhousemcp": { "command": "npx", "args": ["@dollhousemcp/mcp-server"] } } } EOF echo "โœ… Fresh configuration created!" fi else echo "๐Ÿ“ Creating new configuration..." cat > "$CONFIG_FILE" << EOF { "mcpServers": { "dollhousemcp": { "command": "npx", "args": ["@dollhousemcp/mcp-server"] } } } EOF echo "โœ… Configuration created successfully!" fi echo echo "๐ŸŽ‰ Setup Complete!" echo "==================" echo echo "Next steps:" echo "1. โš ๏ธ Restart Claude Desktop completely (quit and reopen)" echo "2. ๐ŸŽญ Test with: list_personas" echo "3. ๐Ÿช Browse collection: browse_collection" echo "4. ๐Ÿ”„ Check for updates: check_for_updates" echo echo "๐Ÿ“š Documentation: https://github.com/DollhouseMCP/mcp-server" echo "๐Ÿ“ฆ NPM Package: https://www.npmjs.com/package/@dollhousemcp/mcp-server" echo echo "Happy persona management! ๐ŸŽญ"

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DollhouseMCP/DollhouseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server