# Galaxy Brain MCP - PowerShell Installation Script
# Think. Do. Done.
#
# Usage:
# .\install.ps1 # Full installation
# .\install.ps1 -SkipClaude # Skip Claude Desktop config
# .\install.ps1 -DevMode # Development installation
param(
[switch]$SkipClaude,
[switch]$DevMode,
[switch]$Help
)
$ErrorActionPreference = "Stop"
# Colors
function Write-Galaxy { param($msg) Write-Host $msg -ForegroundColor Magenta }
function Write-Success { param($msg) Write-Host "[OK] $msg" -ForegroundColor Green }
function Write-Info { param($msg) Write-Host "[..] $msg" -ForegroundColor Cyan }
function Write-Warn { param($msg) Write-Host "[!!] $msg" -ForegroundColor Yellow }
function Write-Fail { param($msg) Write-Host "[XX] $msg" -ForegroundColor Red }
# Banner
function Show-Banner {
Write-Galaxy @"
============================================
GALAXY BRAIN MCP INSTALLER
============================================
Think. Do. Done.
Sequential Thinking + Sequential Doing
= Complete Cognitive Loop
============================================
"@
}
# Help
if ($Help) {
Show-Banner
Write-Host @"
Usage: .\install.ps1 [options]
Options:
-SkipClaude Skip Claude Desktop configuration
-DevMode Install in development mode (editable)
-Help Show this help message
Examples:
.\install.ps1 # Full installation
.\install.ps1 -DevMode # Development mode
.\install.ps1 -SkipClaude # Skip Claude Desktop setup
"@
exit 0
}
Show-Banner
# Check Python
Write-Info "Checking Python installation..."
try {
$pythonVersion = python --version 2>&1
if ($pythonVersion -match "Python 3\.(\d+)") {
$minor = [int]$Matches[1]
if ($minor -ge 10) {
Write-Success "Python $pythonVersion"
} else {
Write-Fail "Python 3.10+ required (found: $pythonVersion)"
exit 1
}
}
} catch {
Write-Fail "Python not found. Please install Python 3.10+"
exit 1
}
# Check pip
Write-Info "Checking pip..."
try {
$pipVersion = pip --version 2>&1
Write-Success "pip found"
} catch {
Write-Fail "pip not found"
exit 1
}
# Get script directory (where install.ps1 is located)
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$projectDir = Split-Path -Parent $scriptDir
Write-Info "Project directory: $projectDir"
# Install package
Write-Info "Installing Galaxy Brain..."
Push-Location $projectDir
try {
if ($DevMode) {
Write-Info "Installing in development mode..."
pip install -e ".[dev]" 2>&1 | Out-Null
} else {
pip install . 2>&1 | Out-Null
}
Write-Success "Galaxy Brain installed"
} catch {
Write-Fail "Installation failed: $_"
exit 1
} finally {
Pop-Location
}
# Verify installation
Write-Info "Verifying installation..."
try {
$version = python -c "import galaxy_brain; print(galaxy_brain.__version__)" 2>&1
Write-Success "Galaxy Brain v$version installed"
} catch {
Write-Warn "Could not verify installation"
}
# Configure Claude Desktop (unless skipped)
if (-not $SkipClaude) {
Write-Info "Configuring Claude Desktop..."
$claudeConfigDir = "$env:APPDATA\Claude"
$claudeConfigFile = "$claudeConfigDir\claude_desktop_config.json"
# Ensure directory exists
if (-not (Test-Path $claudeConfigDir)) {
New-Item -ItemType Directory -Path $claudeConfigDir -Force | Out-Null
}
# Load existing config or create new
if (Test-Path $claudeConfigFile) {
$config = Get-Content $claudeConfigFile -Raw | ConvertFrom-Json
} else {
$config = @{ mcpServers = @{} }
}
# Ensure mcpServers exists
if (-not $config.mcpServers) {
$config | Add-Member -NotePropertyName "mcpServers" -NotePropertyValue @{} -Force
}
# Get Python path
$pythonPath = (Get-Command python).Source
# Add galaxy-brain server
$serverConfig = @{
command = $pythonPath
args = @("-m", "galaxy_brain.server")
}
# Convert to proper JSON structure
if ($config.mcpServers -is [PSCustomObject]) {
$config.mcpServers | Add-Member -NotePropertyName "galaxy-brain" -NotePropertyValue $serverConfig -Force
} else {
$config.mcpServers["galaxy-brain"] = $serverConfig
}
# Save config
$config | ConvertTo-Json -Depth 10 | Set-Content $claudeConfigFile -Encoding UTF8
Write-Success "Claude Desktop configured"
Write-Info "Config location: $claudeConfigFile"
}
# Done
Write-Galaxy @"
============================================
INSTALLATION COMPLETE!
============================================
Galaxy Brain is ready to think and do.
Quick Start:
1. Restart Claude Desktop
2. Use these tools:
- start_thinking: Begin reasoning
- think: Add thoughts
- execute_batch: Run operations
- think_and_do: Complete loop
Example:
think_and_do({
problem: "What files are in this directory?",
thoughts: [
"I need to list directory contents",
"I'll use the shell service"
],
operations: [{
service: "shell",
method: "run",
params: { command: "dir" }
}]
})
Think. Do. Done.
============================================
"@