Forge
powershell9332cf7c
1# Publish Release (win-x64, self-contained) and mirror to a fixed path for Cursor MCP.
2# Run from repo: cd ...\hybrid-codebase-index ; .\publish-and-deploy.ps1
3# Optional: -Target "D:\hybrid-codebase-index"
4[CmdletBinding()]
5param(
6 [string] $Target = "D:\hybrid-codebase-index"
7)
8
9$ErrorActionPreference = "Stop"
10$here = $PSScriptRoot
11$csproj = Join-Path $here "HybridCodebaseIndex.Mcp\HybridCodebaseIndex.Mcp.csproj"
12if (-not (Test-Path -LiteralPath $csproj)) {
13 Write-Error "HybridCodebaseIndex.Mcp.csproj not found. Run this script from the hybrid-codebase-index directory (PSScriptRoot=$here)."
14 exit 1
15}
16
17Push-Location $here
18try {
19 # Keep docs/manifests in sync with ToolCatalog.
20 & dotnet run --project (Join-Path $here "tools\\ExportMcpManifest\\ExportMcpManifest.csproj") -- --write | Out-Null
21 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
22
23 $exe = Join-Path $Target "HybridCodebaseIndex.Mcp.exe"
24 $exeJson = $exe.Replace('\', '\\')
25
26 # Prefer local tool (repo-pinned), but global install works too.
27 if (Test-Path -LiteralPath (Join-Path $here ".config\\dotnet-tools.json")) {
28 & dotnet aid-publish -Project $csproj -Target $Target -Runtime "win-x64" -Configuration "Release" -SelfContained -KillRunning
29 } else {
30 & aid-publish -Project $csproj -Target $Target -Runtime "win-x64" -Configuration "Release" -SelfContained -KillRunning
31 }
32 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
33
34 Write-Host ""
35 Write-Host "Cursor MCP: paste into mcp.json ->"
36 Write-Host @"
37 "hybrid-codebase-index": {
38 "command": "$exeJson",
39 "args": []
40 }
41"@
42 Write-Host ""
43} finally {
44 Pop-Location
45}
46
47
View only · write via MCP/CIDE