forked from Ladvien/bevy_debugger_mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-claude.sh
More file actions
executable file
·142 lines (124 loc) · 4.64 KB
/
setup-claude.sh
File metadata and controls
executable file
·142 lines (124 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/bash
# Universal setup script for bevy-debugger-mcp
# Supports: Claude (Code/Desktop), Cline, Roo Code, Cursor, VS Code, Gemini/Qwen/Codex CLI
# Run this after installing via any method (cargo, brew, manual)
set -e
echo "Setting up bevy-debugger-mcp..."
# Find the bevy-debugger-mcp binary
BINARY_PATH=""
# Check common installation locations
if command -v bevy-debugger-mcp &> /dev/null; then
BINARY_PATH=$(which bevy-debugger-mcp)
echo "✅ Found bevy-debugger-mcp at: $BINARY_PATH"
elif [ -f "$HOME/.cargo/bin/bevy-debugger-mcp" ]; then
BINARY_PATH="$HOME/.cargo/bin/bevy-debugger-mcp"
echo "✅ Found bevy-debugger-mcp at: $BINARY_PATH"
elif [ -f "/usr/local/bin/bevy-debugger-mcp" ]; then
BINARY_PATH="/usr/local/bin/bevy-debugger-mcp"
echo "✅ Found bevy-debugger-mcp at: $BINARY_PATH"
elif [ -f "/opt/homebrew/bin/bevy-debugger-mcp" ]; then
BINARY_PATH="/opt/homebrew/bin/bevy-debugger-mcp"
echo "✅ Found bevy-debugger-mcp at: $BINARY_PATH"
else
echo "❌ bevy-debugger-mcp not found. Please install it first:"
echo " cargo install bevy_debugger_mcp"
echo " or"
echo " brew install bevy-debugger-mcp"
exit 1
fi
# Create symlinks for compatibility
echo "Creating compatibility symlinks..."
mkdir -p ~/.local/bin
ln -sf "$BINARY_PATH" ~/.local/bin/bevy-debugger-mcp
# Also ensure it's in ~/.cargo/bin for consistency
if [ ! -f "$HOME/.cargo/bin/bevy-debugger-mcp" ] && [ "$BINARY_PATH" != "$HOME/.cargo/bin/bevy-debugger-mcp" ]; then
mkdir -p ~/.cargo/bin
ln -sf "$BINARY_PATH" ~/.cargo/bin/bevy-debugger-mcp
fi
# Define the common config block
CONFIG_JSON=$(cat << EOF
"bevy-debugger-mcp": {
"command": "$BINARY_PATH",
"args": ["stdio"],
"env": {
"RUST_LOG": "info",
"BEVY_BRP_HOST": "127.0.0.1",
"BEVY_BRP_PORT": "15702"
}
}
EOF
)
FULL_CONFIG_JSON=$(cat << EOF
{
"mcpServers": {
$CONFIG_JSON
}
}
EOF
)
# Function to check and print instructions for a config file
check_config() {
local name="$1"
local config_path="$2"
if [ -f "$config_path" ]; then
echo "--------- $name ---------"
echo "Found config at: $config_path"
if grep -q "bevy-debugger-mcp" "$config_path"; then
echo "⚠️ bevy-debugger-mcp already configured in $name"
else
echo "📝 Add the following to 'mcpServers' in your $name config:"
echo "$CONFIG_JSON"
fi
echo ""
fi
}
echo ""
echo "=== Configuration Check ==="
echo ""
# 1. Claude Code
CLAUDE_CODE_CONFIG="$HOME/.claude/mcp_settings.json"
if [ ! -f "$CLAUDE_CODE_CONFIG" ]; then
mkdir -p ~/.claude
echo "--------- Claude Code ---------"
echo "Creating new config at: $CLAUDE_CODE_CONFIG"
echo "$FULL_CONFIG_JSON" > "$CLAUDE_CODE_CONFIG"
echo "✅ Created Claude Code config"
echo ""
else
check_config "Claude Code" "$CLAUDE_CODE_CONFIG"
fi
# 2. Claude Desktop (macOS)
CLAUDE_DESKTOP_CONFIG="$HOME/Library/Application Support/Claude/claude_desktop_config.json"
check_config "Claude Desktop (macOS)" "$CLAUDE_DESKTOP_CONFIG"
# 3. Cline (VS Code Extension)
# macOS
CLINE_CONFIG_MAC="$HOME/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json"
check_config "Cline (macOS)" "$CLINE_CONFIG_MAC"
# Linux
CLINE_CONFIG_LINUX="$HOME/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json"
check_config "Cline (Linux)" "$CLINE_CONFIG_LINUX"
# Windows (approximate via WSL/Git Bash if applicable, but usually $APPDATA)
# 4. Roo Code (VS Code Extension)
# macOS
ROO_CONFIG_MAC="$HOME/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json"
check_config "Roo Code (macOS)" "$ROO_CONFIG_MAC"
# Linux
ROO_CONFIG_LINUX="$HOME/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json"
check_config "Roo Code (Linux)" "$ROO_CONFIG_LINUX"
echo "=== Manual Configuration Instructions ==="
echo ""
echo "If your tool's config was not found automatically, use the JSON below."
echo "Applicable for: VS Code, Cursor, Gemini CLI, Qwen CLI, Codex CLI, etc."
echo ""
echo "$FULL_CONFIG_JSON"
echo ""
echo "Specific Instructions:"
echo "• VS Code (with MCP extension): Add to your User or Workspace settings.json under 'mcp.servers'."
echo "• Cursor IDE: Go to Settings > Features > MCP > Add New MCP Server."
echo " - Name: bevy-debugger-mcp"
echo " - Type: stdio"
echo " - Command: $BINARY_PATH"
echo " - Args: stdio"
echo " - Env: RUST_LOG=info, BEVY_BRP_HOST=127.0.0.1, BEVY_BRP_PORT=15702"
echo ""
echo "✅ Setup complete! Symlinks created at ~/.local/bin/bevy-debugger-mcp"