-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup-claude-code.sh
More file actions
executable file
·714 lines (644 loc) · 24 KB
/
Copy pathsetup-claude-code.sh
File metadata and controls
executable file
·714 lines (644 loc) · 24 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
#!/bin/bash
# Claude Code Setup Script for Compiler Explorer MCP Server
# This script sets up the MCP server for use with Claude Code
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Helper functions
print_header() {
if [[ "$QUIET" != true ]]; then
echo -e "${BLUE}================================================${NC}"
echo -e "${BLUE} Compiler Explorer MCP Setup for Claude Code ${NC}"
echo -e "${BLUE}================================================${NC}"
echo ""
fi
}
print_step() {
if [[ "$QUIET" != true ]]; then
echo -e "${GREEN}[STEP]${NC} $1"
fi
}
print_info() {
if [[ "$QUIET" != true ]]; then
echo -e "${YELLOW}[INFO]${NC} $1"
fi
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1" >&2
}
print_success() {
if [[ "$QUIET" != true ]]; then
echo -e "${GREEN}[SUCCESS]${NC} $1"
fi
}
# Check if command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Main setup function
main() {
# Remember the directory where the script is located (ce-mcp source directory)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Parse command line arguments
PROJECT_DIR=""
GLOBAL_INSTALL=false
GLOBAL_MCP=false
NON_INTERACTIVE=false
QUIET=false
DEFAULT_LANG="c++"
DEFAULT_COMPILER="g++"
UNINSTALL=false
MCP_NAME="ce-mcp"
while [[ $# -gt 0 ]]; do
case $1 in
--project-dir)
PROJECT_DIR="$2"
shift 2
;;
--global)
GLOBAL_INSTALL=true
shift
;;
--global-mcp)
GLOBAL_MCP=true
GLOBAL_MCP_SET=true
shift
;;
--non-interactive)
NON_INTERACTIVE=true
shift
;;
-q|--quiet)
QUIET=true
NON_INTERACTIVE=true
shift
;;
--language)
DEFAULT_LANG="$2"
shift 2
;;
--compiler)
DEFAULT_COMPILER="$2"
shift 2
;;
--uninstall)
UNINSTALL=true
shift
;;
--help)
show_help
exit 0
;;
*)
echo "Unknown option: $1"
show_help
exit 1
;;
esac
done
print_header
# Auto-enable global installation if global MCP is requested
if [[ "$GLOBAL_MCP" == true ]] && [[ "$GLOBAL_INSTALL" != true ]]; then
GLOBAL_INSTALL=true
print_info "Global MCP registration requires global installation - automatically enabling --global"
fi
# If no project directory specified, ask user (unless non-interactive)
if [[ -z "$PROJECT_DIR" ]]; then
if [[ "$NON_INTERACTIVE" == false ]]; then
echo -e "${YELLOW}Enter the path to your C++/coding project (or press Enter for current directory):${NC}"
read -r PROJECT_DIR
fi
if [[ -z "$PROJECT_DIR" ]]; then
PROJECT_DIR="$(pwd)"
fi
fi
# Convert to absolute path
if [[ -d "$PROJECT_DIR" ]]; then
PROJECT_DIR="$(cd "$PROJECT_DIR" && pwd)"
else
mkdir -p "$PROJECT_DIR"
PROJECT_DIR="$(cd "$PROJECT_DIR" && pwd)"
fi
# Handle uninstall if requested
if [[ "$UNINSTALL" == true ]]; then
uninstall_mcp_server
exit 0
fi
print_info "Setting up Compiler Explorer MCP for Claude Code"
print_info "Project directory: $PROJECT_DIR"
print_info "Source directory: $SCRIPT_DIR"
if [[ "$QUIET" != true ]]; then
echo ""
fi
# Step 1: Check prerequisites
print_step "Checking prerequisites..."
check_prerequisites
# Step 2: Install the MCP server
print_step "Installing Compiler Explorer MCP server..."
install_mcp_server
# Step 3: Create project configuration
print_step "Creating project configuration..."
create_project_config
# Step 4: Register MCP server with Claude
print_step "Registering MCP server with Claude..."
register_mcp_server
# Step 5: Verify installation
print_step "Verifying installation..."
verify_installation
# Step 6: Show success message and next steps
show_completion_message
}
check_prerequisites() {
local missing_deps=()
# Check for Python
if ! command_exists python3; then
missing_deps+=("python3")
fi
# Check for Claude CLI
if ! command_exists claude; then
missing_deps+=("claude")
fi
# Check for UV or pip
if ! command_exists uv && ! command_exists pip; then
missing_deps+=("uv or pip")
fi
if [[ ${#missing_deps[@]} -gt 0 ]]; then
print_error "Missing dependencies: ${missing_deps[*]}"
if [[ "$QUIET" != true ]]; then
echo ""
fi
print_info "Please install the missing dependencies:"
if [[ "$QUIET" != true ]]; then
for dep in "${missing_deps[@]}"; do
case $dep in
"python3")
echo " - Python 3.8+: https://python.org/downloads"
;;
"claude")
echo " - Claude Code: https://claude.ai/download"
;;
"uv or pip")
echo " - UV: curl -LsSf https://astral.sh/uv/install.sh | sh"
echo " - Or use pip (comes with Python)"
;;
esac
done
fi
exit 1
fi
print_success "All prerequisites found"
}
install_mcp_server() {
# Check if we're running the script from the ce-mcp development directory
if [[ -f "$SCRIPT_DIR/pyproject.toml" ]] && grep -q "ce-mcp" "$SCRIPT_DIR/pyproject.toml"; then
print_info "Found ce-mcp development directory at: $SCRIPT_DIR"
if [[ "$GLOBAL_INSTALL" == true ]]; then
print_info "Installing globally with pipx..."
if ! command_exists pipx; then
print_info "Installing pipx first..."
if command_exists uv; then
uv tool install pipx
else
python3 -m pip install --user pipx
python3 -m pipx ensurepath
fi
fi
# Install with pipx
pipx install "$SCRIPT_DIR"
CE_MCP_COMMAND="ce-mcp"
# For global installation, we should use global registration by default
if [[ -z "$GLOBAL_MCP_SET" ]]; then
GLOBAL_MCP=true
print_info "Global installation detected, will use global MCP registration"
fi
else
print_info "Installing in project environment from source: $SCRIPT_DIR"
cd "$PROJECT_DIR"
# Create virtual environment if it doesn't exist
if [[ ! -d ".venv" ]]; then
if command_exists uv; then
if [[ "$QUIET" == true ]]; then
uv venv --seed >/dev/null 2>&1
else
uv venv --seed
fi
else
if [[ "$QUIET" == true ]]; then
python3 -m venv .venv >/dev/null 2>&1
else
python3 -m venv .venv
fi
fi
fi
# Install ce-mcp in the virtual environment
if command_exists uv; then
source .venv/bin/activate
if [[ "$QUIET" == true ]]; then
uv pip install -e "$SCRIPT_DIR" >/dev/null 2>&1
else
uv pip install -e "$SCRIPT_DIR"
fi
deactivate
else
source .venv/bin/activate
if [[ "$QUIET" == true ]]; then
pip install -e "$SCRIPT_DIR" >/dev/null 2>&1
else
pip install -e "$SCRIPT_DIR"
fi
deactivate
fi
# Use a wrapper script that activates venv first
CE_MCP_WRAPPER="$PROJECT_DIR/.ce-mcp-wrapper.sh"
cat > "$CE_MCP_WRAPPER" << 'EOF'
#!/bin/bash
# Wrapper script for ce-mcp that activates the virtual environment
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/.venv/bin/activate"
exec ce-mcp "$@"
EOF
chmod +x "$CE_MCP_WRAPPER"
CE_MCP_COMMAND="$CE_MCP_WRAPPER"
fi
else
print_error "Cannot find ce-mcp source at: $SCRIPT_DIR"
print_error "Please ensure the script is in the ce-mcp directory with pyproject.toml"
exit 1
fi
print_success "MCP server installed successfully"
}
create_project_config() {
# Determine config location based on scope
if [[ "$GLOBAL_MCP" == true ]]; then
# Use user's home directory for global config (ce-mcp will look here by default)
CONFIG_DIR="$HOME/.config/compiler_explorer_mcp"
mkdir -p "$CONFIG_DIR"
CONFIG_PATH="$CONFIG_DIR/config.yaml"
print_info "Creating global configuration in default location: $CONFIG_PATH"
else
# Use project directory for local config
cd "$PROJECT_DIR"
CONFIG_PATH="$PROJECT_DIR/.ce-mcp-config.yaml"
print_info "Creating project configuration..."
fi
if [[ "$NON_INTERACTIVE" == false ]] && [[ "$QUIET" != true ]]; then
# Ask for default language
echo -e "${YELLOW}What's your primary programming language? (c++/c/rust/go/python) [c++]:${NC}"
read -r INPUT_LANG
DEFAULT_LANG=${INPUT_LANG:-"c++"}
# Ask for default compiler
case $DEFAULT_LANG in
"c++"|"c")
echo -e "${YELLOW}Preferred compiler? (g++/clang++) [g++]:${NC}"
read -r INPUT_COMPILER
DEFAULT_COMPILER=${INPUT_COMPILER:-"g++"}
;;
"rust")
DEFAULT_COMPILER="rustc"
;;
"go")
DEFAULT_COMPILER="go"
;;
"python")
DEFAULT_COMPILER="python311"
;;
*)
DEFAULT_COMPILER="g++"
;;
esac
else
# Set compiler based on language for non-interactive mode
case $DEFAULT_LANG in
"c++"|"c")
DEFAULT_COMPILER=${DEFAULT_COMPILER:-"g++"}
;;
"rust")
DEFAULT_COMPILER="rustc"
;;
"go")
DEFAULT_COMPILER="go"
;;
"python")
DEFAULT_COMPILER="python311"
;;
*)
DEFAULT_COMPILER="g++"
;;
esac
print_info "Using language: $DEFAULT_LANG, compiler: $DEFAULT_COMPILER"
fi
# Create configuration file at the determined location
cat > "$CONFIG_PATH" << EOF
# Project-specific Compiler Explorer MCP configuration
compiler_explorer_mcp:
api:
timeout: 30
defaults:
language: "$DEFAULT_LANG"
compiler: "$DEFAULT_COMPILER"
extract_args_from_source: true
filters:
commentOnly: true
demangle: true
intel: true
labels: true
output_limits:
max_stdout_lines: 50
max_stderr_lines: 25
max_assembly_lines: 100
max_line_length: 120
compiler_mappings:
"g++": "g132"
"gcc": "g132"
"clang++": "clang1700"
"clang": "clang1700"
"rustc": "r1740"
"go": "gccgo132"
"python": "python311"
EOF
if [[ "$GLOBAL_MCP" == true ]]; then
print_success "Configuration file created: $CONFIG_PATH"
else
print_success "Configuration file created: .ce-mcp-config.yaml"
fi
}
register_mcp_server() {
# First remove any existing ce-mcp server
print_info "Checking for existing ce-mcp server..."
if claude mcp list 2>/dev/null | grep -q "$MCP_NAME"; then
print_info "Removing existing $MCP_NAME server..."
claude mcp remove "$MCP_NAME" >/dev/null 2>&1 || true
fi
# Register the MCP server using claude mcp add
# The arguments after the command are passed to the MCP server
# CONFIG_PATH is already set by create_project_config
# Determine scope message
if [[ "$GLOBAL_MCP" == true ]]; then
print_info "Registering MCP server globally (user scope)..."
else
print_info "Registering MCP server for this project (local scope)..."
fi
# Register with claude mcp add
# Use -- to separate claude mcp options from MCP server arguments
if [[ "$QUIET" == true ]]; then
if [[ "$GLOBAL_MCP" == true ]]; then
# For global registration, don't pass config - let ce-mcp use defaults or find config in default location
if claude mcp add --scope user "$MCP_NAME" "$CE_MCP_COMMAND" >/dev/null 2>&1; then
print_success "MCP server registered successfully with Claude"
else
print_error "Failed to register MCP server"
print_info "You can try manually registering with:"
echo " claude mcp add --scope user \"$MCP_NAME\" \"$CE_MCP_COMMAND\""
exit 1
fi
else
if claude mcp add "$MCP_NAME" "$CE_MCP_COMMAND" -- "--config" "$CONFIG_PATH" >/dev/null 2>&1; then
print_success "MCP server registered successfully with Claude"
else
print_error "Failed to register MCP server"
print_info "You can try manually registering with:"
echo " claude mcp add \"$MCP_NAME\" \"$CE_MCP_COMMAND\" -- --config \"$CONFIG_PATH\""
exit 1
fi
fi
else
if [[ "$GLOBAL_MCP" == true ]]; then
# For global registration, don't pass config - let ce-mcp use defaults or find config in default location
if claude mcp add --scope user "$MCP_NAME" "$CE_MCP_COMMAND"; then
print_success "MCP server registered successfully with Claude"
else
print_error "Failed to register MCP server"
print_info "You can try manually registering with:"
echo " claude mcp add --scope user \"$MCP_NAME\" \"$CE_MCP_COMMAND\""
exit 1
fi
else
if claude mcp add "$MCP_NAME" "$CE_MCP_COMMAND" -- "--config" "$CONFIG_PATH"; then
print_success "MCP server registered successfully with Claude"
else
print_error "Failed to register MCP server"
print_info "You can try manually registering with:"
echo " claude mcp add \"$MCP_NAME\" \"$CE_MCP_COMMAND\" -- --config \"$CONFIG_PATH\""
exit 1
fi
fi
fi
}
verify_installation() {
cd "$PROJECT_DIR"
# Test that the MCP command works
print_info "Testing MCP server command..."
if [[ -f "$CE_MCP_WRAPPER" ]]; then
# Test wrapper script
if "$CE_MCP_WRAPPER" --help > /dev/null 2>&1; then
print_success "MCP wrapper script works correctly"
else
print_error "MCP wrapper script failed"
exit 1
fi
elif command_exists ce-mcp; then
# Test global installation
if ce-mcp --help > /dev/null 2>&1; then
print_success "ce-mcp command works correctly"
else
print_error "ce-mcp command failed"
exit 1
fi
else
print_error "ce-mcp command not found"
exit 1
fi
# Check that MCP server is registered with Claude
print_info "Verifying MCP registration..."
if claude mcp list 2>/dev/null | grep -q "$MCP_NAME"; then
print_success "MCP server is registered with Claude"
# Show MCP server details
if [[ "$QUIET" != true ]]; then
echo ""
print_info "MCP server details:"
claude mcp get "$MCP_NAME" 2>/dev/null || true
fi
else
print_error "MCP server not found in Claude configuration"
exit 1
fi
# Check configuration file
if [[ -f "$CONFIG_PATH" ]]; then
if [[ "$GLOBAL_MCP" == true ]]; then
print_success "Global configuration file exists: $CONFIG_PATH"
else
print_success "Configuration file exists: .ce-mcp-config.yaml"
fi
else
print_error "Configuration file missing at: $CONFIG_PATH"
exit 1
fi
}
show_completion_message() {
if [[ "$QUIET" != true ]]; then
echo ""
print_success "🎉 Setup complete!"
echo ""
echo -e "${GREEN}Your project is now configured for Claude Code with Compiler Explorer MCP!${NC}"
echo ""
echo -e "${YELLOW}Next steps:${NC}"
echo "1. Restart Claude Code (or reload the window)"
echo "2. The MCP server should be automatically available"
echo "3. Try using the MCP tools with @$MCP_NAME:"
echo ""
echo -e "${YELLOW}Example usage:${NC}"
echo " Ask Claude: \"@$MCP_NAME compile and run this code: int main(){return 0;}\""
echo ""
echo -e "${YELLOW}Configuration:${NC}"
if [[ "$GLOBAL_MCP" == true ]]; then
echo " 📄 MCP server registered globally (available in all projects)"
else
echo " 📄 MCP server registered for this project"
fi
echo " ⚙️ .ce-mcp-config.yaml - Project-specific settings"
echo ""
echo -e "${YELLOW}Available tools via @$MCP_NAME:${NC}"
echo " 🔍 compile_check_tool - Quick syntax validation"
echo " 🚀 compile_and_run_tool - Compile and execute code"
echo " 🐛 compile_with_diagnostics_tool - Detailed error analysis"
echo " ⚡ analyze_optimization_tool - Assembly optimization analysis"
echo " 🔗 generate_share_url_tool - Create shareable links"
echo " 📊 compare_compilers_tool - Side-by-side compiler comparison"
echo ""
echo -e "${YELLOW}Managing the MCP server:${NC}"
echo " claude mcp list - List all MCP servers"
echo " claude mcp get $MCP_NAME - Show server details"
echo " claude mcp remove $MCP_NAME - Remove the server"
echo ""
echo -e "${BLUE}Happy coding! 🚀${NC}"
fi
}
uninstall_mcp_server() {
print_header
print_info "Uninstalling Compiler Explorer MCP server..."
echo ""
# Remove MCP server from Claude (try all scopes)
if command_exists claude; then
# Check and remove from project scope
cd "$PROJECT_DIR" 2>/dev/null || true
if claude mcp list 2>/dev/null | grep -q "$MCP_NAME"; then
print_info "Removing $MCP_NAME from Claude (project scope)..."
claude mcp remove "$MCP_NAME" 2>/dev/null || true
print_success "Removed $MCP_NAME from Claude project configuration"
fi
# Note: Current Claude CLI doesn't support scope option
# Global removal would need to be done manually if needed
fi
# Remove from project directory
if [[ -d "$PROJECT_DIR" ]]; then
cd "$PROJECT_DIR"
# Remove wrapper script
if [[ -f ".ce-mcp-wrapper.sh" ]]; then
print_info "Removing wrapper script..."
rm -f .ce-mcp-wrapper.sh
print_success "Removed .ce-mcp-wrapper.sh"
fi
# Remove virtual environment if it contains ce-mcp
if [[ -d ".venv" ]] && [[ -f ".venv/bin/ce-mcp" ]]; then
if [[ "$NON_INTERACTIVE" == false ]]; then
echo -e "${YELLOW}Remove virtual environment? (y/N):${NC}"
read -r REMOVE_VENV
if [[ "$REMOVE_VENV" =~ ^[Yy]$ ]]; then
rm -rf .venv
print_success "Removed virtual environment"
else
# Just uninstall ce-mcp from venv
source .venv/bin/activate
pip uninstall ce-mcp -y 2>/dev/null || true
deactivate
print_success "Removed ce-mcp from virtual environment"
fi
else
# Just uninstall ce-mcp from venv
source .venv/bin/activate
pip uninstall ce-mcp -y 2>/dev/null || true
deactivate
print_success "Removed ce-mcp from virtual environment"
fi
fi
# Remove configuration file
if [[ -f ".ce-mcp-config.yaml" ]]; then
print_info "Removing .ce-mcp-config.yaml..."
rm -f .ce-mcp-config.yaml
print_success "Removed .ce-mcp-config.yaml"
fi
# Remove old .claude.json if it exists and contains ce-mcp
if [[ -f ".claude.json" ]] && grep -q "ce-mcp" .claude.json 2>/dev/null; then
print_info "Found old .claude.json with ce-mcp configuration..."
if [[ "$NON_INTERACTIVE" == false ]]; then
echo -e "${YELLOW}Remove .claude.json? (y/N):${NC}"
read -r REMOVE_CONFIG
if [[ "$REMOVE_CONFIG" =~ ^[Yy]$ ]]; then
rm -f .claude.json
print_success "Removed .claude.json"
fi
else
rm -f .claude.json
print_success "Removed .claude.json"
fi
fi
fi
# Check for global installation
if command_exists pipx; then
if pipx list 2>/dev/null | grep -q "ce-mcp"; then
print_info "Removing global pipx installation..."
pipx uninstall ce-mcp 2>/dev/null || true
print_success "Removed global ce-mcp installation"
fi
fi
echo ""
print_success "Uninstall complete!"
echo ""
echo -e "${YELLOW}Removed:${NC}"
echo " ✓ $MCP_NAME from Claude MCP servers"
echo " ✓ ce-mcp package from virtual environment (if present)"
echo " ✓ Project configuration files (.ce-mcp-config.yaml, wrapper script)"
echo " ✓ Global ce-mcp installation (if present)"
echo ""
echo -e "${BLUE}The ce-mcp source code remains at: $SCRIPT_DIR${NC}"
}
show_help() {
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Setup or uninstall Compiler Explorer MCP server for Claude Code"
echo ""
echo "Options:"
echo " --project-dir DIR Target project directory (default: current directory)"
echo " --global Install ce-mcp globally with pipx instead of project-local"
echo " --global-mcp Register MCP server globally (available in all projects)"
echo " --non-interactive Skip interactive prompts, use defaults"
echo " -q, --quiet Quiet mode: no output except errors"
echo " --language LANG Default language (c++, c, rust, go, python)"
echo " --compiler COMP Default compiler (g++, clang++, rustc, etc.)"
echo " --uninstall Uninstall ce-mcp and remove configuration"
echo " --help Show this help message"
echo ""
echo "Examples:"
echo " $0 # Setup in current directory"
echo " $0 --project-dir ~/my-cpp-project # Setup in specific project"
echo " $0 --global # Install ce-mcp globally"
echo " $0 --global-mcp # Register MCP globally (all projects)"
echo " $0 --non-interactive # Use defaults without prompts"
echo " $0 -q # Quiet setup with no output"
echo " $0 --language rust --compiler rustc # Setup for Rust"
echo " $0 --uninstall # Uninstall ce-mcp"
echo ""
echo "The script will:"
echo " 1. Install the ce-mcp Python package"
echo " 2. Create project configuration (.ce-mcp-config.yaml)"
echo " 3. Register the MCP server with Claude using 'claude mcp add'"
echo " 4. Verify the installation"
echo ""
echo "After setup, the MCP server will be available in Claude Code via @ce-mcp"
}
# Run main function
main "$@"