-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
68 lines (56 loc) · 2.77 KB
/
install.ps1
File metadata and controls
68 lines (56 loc) · 2.77 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
# MCP Prompt Optimizer Installation Script (PowerShell)
# This script sets up the MCP Prompt Optimizer for use with UV package manager
Write-Host "🚀 MCP Prompt Optimizer - Installation Script" -ForegroundColor Cyan
Write-Host "==============================================" -ForegroundColor Cyan
Write-Host ""
# Check if UV is installed
try {
$uvVersion = uv --version 2>&1
Write-Host "✅ UV is installed: $uvVersion" -ForegroundColor Green
} catch {
Write-Host "❌ UV is not installed." -ForegroundColor Red
Write-Host " Please install UV first:" -ForegroundColor Yellow
Write-Host " powershell -ExecutionPolicy ByPass -c `"irm https://astral.sh/uv/install.ps1 | iex`"" -ForegroundColor Yellow
exit 1
}
Write-Host ""
# Get the project directory
$PROJECT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $PROJECT_DIR
Write-Host "📦 Installing dependencies with UV..." -ForegroundColor Cyan
uv sync
Write-Host ""
Write-Host "✅ Dependencies installed successfully!" -ForegroundColor Green
Write-Host ""
# Create necessary directories
Write-Host "📁 Creating configuration directories..." -ForegroundColor Cyan
New-Item -ItemType Directory -Force -Path ".cursor" | Out-Null
New-Item -ItemType Directory -Force -Path ".vscode" | Out-Null
New-Item -ItemType Directory -Force -Path ".windsurf" | Out-Null
Write-Host "✅ Directories created!" -ForegroundColor Green
Write-Host ""
# Check if configuration files exist, if not create them
Write-Host "📝 Generating configuration files with absolute paths..." -ForegroundColor Cyan
uv run python scripts/generate_config.py
# Check if user wants global Cursor configuration
if ($args -contains "--global" -or $args -contains "-g") {
Write-Host ""
Write-Host "📝 Generating global Cursor configuration (~/.cursor/mcp.json)..." -ForegroundColor Cyan
uv run python scripts/generate_config.py --global
Write-Host "✅ Global Cursor configuration created" -ForegroundColor Green
}
Write-Host ""
Write-Host "🎉 Installation complete!" -ForegroundColor Green
Write-Host ""
Write-Host "📚 Next steps:" -ForegroundColor Cyan
Write-Host " 1. Review the configuration files in .cursor/, .vscode/, or .windsurf/"
if (-not ($args -contains "--global" -or $args -contains "-g")) {
Write-Host " 2. (Optional) Run '.\install.ps1 --global' to also configure global Cursor config (~/.cursor/mcp.json)"
}
Write-Host " 3. Update MCP_PROMPT_OPTIMIZER_REPO_PATH if your prompt_engineering repo is in a different location"
Write-Host " 4. Restart your IDE to load the MCP server"
Write-Host " 5. See SETUP.md for detailed IDE-specific instructions"
Write-Host ""
Write-Host "🧪 Test the installation:" -ForegroundColor Cyan
Write-Host " uv run python -m src.mcp_server" -ForegroundColor Yellow
Write-Host ""