mcp-init.ps1•2.31 kB
$ErrorActionPreference = "Stop"
$root = "$HOME/dev/mcp"
$bin = "$root/bin"
$scripts = "$root/scripts"
$config = "$root/config"
$qdrant = "$root/qdrant/storage"
$neo = "$root/neo4j/data"
New-Item -ItemType Directory -Force -Path $bin,$scripts,$config,$qdrant,$neo | Out-Null
# Python venv
$venvPath = "$root/win-venv"
if (-not (Test-Path $venvPath)) {
python -m venv $venvPath
}
& "$venvPath/Scripts/Activate.ps1"
python -m pip install --upgrade pip
python -m pip install `
qdrant-client==1.10.1 `
sentence-transformers==3.0.1 `
spacy==3.7.5 `
neo4j==5.22.0 `
uvicorn==0.30.6 `
fastapi==0.112.0 `
scipy==1.13.1 `
FlagEmbedding==1.2.10
python -m spacy download en_core_web_sm
# Config seed
$cfg = "$config/memory.config.json"
if (-not (Test-Path $cfg)) {
@"
{
"qdrant": {
"url": "http://127.0.0.1:6333",
"collection": "fieldnote_memory",
"dense_model": "sentence-transformers/all-MiniLM-L6-v2",
"top_k": 8
},
"kg": {
"backend": "neo4j",
"uri": "bolt://127.0.0.1:7687",
"user": "neo4j",
"pass": "password"
},
"injection": {
"max_tokens": 2000,
"score_threshold": 0.30,
"include_kg_symmetry": true
},
"sparse": {
"enabled": true,
"model": "bge-m3",
"hash_dim": 32768
}
}
"@ | Out-File -Encoding utf8 -FilePath $cfg
}
# Symlink friendly shims (Developer Mode typically required)
$ErrorActionPreference = "SilentlyContinue"
ni -Type SymbolicLink -Path "$bin/memory-store.cmd" -Target "$scripts/memory_store.py" | Out-Null
ni -Type SymbolicLink -Path "$bin/memory-search.cmd" -Target "$scripts/memory_search.py" | Out-Null
ni -Type SymbolicLink -Path "$bin/context-inject.cmd" -Target "$scripts/context_injector.py" | Out-Null
ni -Type SymbolicLink -Path "$bin/mcp-health.cmd" -Target "$scripts/mcp_health.py" | Out-Null
ni -Type SymbolicLink -Path "$bin/qdrant-run.cmd" -Target "$scripts/qdrant-run.ps1" | Out-Null
$ErrorActionPreference = "Stop"
# PATH
$hook = '$env:Path = "$HOME\dev\mcp\bin;" + $env:Path'
if (-not (Test-Path -LiteralPath "$PROFILE")) {
New-Item -ItemType File -Path "$PROFILE" -Force | Out-Null
}
if (-not (Select-String -Path "$PROFILE" -Pattern "dev\\mcp\\bin" -Quiet)) {
Add-Content -Path "$PROFILE" -Value $hook
}
Write-Host "mcp-init v3: done. Try: docker compose up -d; make health; make demo"