<# QGIS MCP Plugin + qgis-mcp Server setup for Windows Run in PowerShell. This script prepares the external qgis-mcp project. It does not modify QGIS projects. After this script, enable the QGIS MCP plugin inside QGIS and press "Start Server". #> param( [string]$InstallRoot = "C:\\gis-mcp", [string]$RepoUrl = "https://github.com/nkarasiak/qgis-mcp.git" ) $ErrorActionPreference = "Stop" Write-Host "=== QGIS MCP setup for Windows ===" Write-Host "InstallRoot: $InstallRoot" if (-not (Get-Command git -ErrorAction SilentlyContinue)) { throw "git が見つかりません。Git for Windows をインストールしてください。" } if (-not (Get-Command uv -ErrorAction SilentlyContinue)) { Write-Host "uv が見つからないため、インストールします..." powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" } New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null Set-Location $InstallRoot if (-not (Test-Path "qgis-mcp")) { git clone $RepoUrl qgis-mcp } else { Write-Host "既存の qgis-mcp フォルダを更新します..." Set-Location "qgis-mcp" git pull Set-Location ".." } Set-Location "$InstallRoot\\qgis-mcp" Write-Host "Python依存関係を同期します..." uv sync Write-Host "インストーラを実行します..." uv run python install.py Write-Host "" Write-Host "次の作業を行ってください:" Write-Host "1. QGISを再起動" Write-Host "2. プラグイン > プラグインの管理とインストール > QGIS MCP を有効化" Write-Host "3. プラグイン > QGIS MCP > QGIS MCP パネルを開く" Write-Host "4. Start Server をクリック" Write-Host "5. MCPクライアント側に claude_desktop_config.sample.json 等を参考に設定を追加"