overmind-mcp 2.8.10 → 2.8.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/install-overmind-native.sh +220 -220
- package/package.json +2 -2
- package/dist/bin/launch.js +0 -78
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# ============================================================
|
|
3
|
-
# install-overmind-native.sh
|
|
4
|
-
# Installation OverMind-MCP + Postgres-MCP — mode NATIF (sans Docker)
|
|
5
|
-
# Pour Ubuntu 26.04+ avec PostgreSQL 18 + pgvector + systemd
|
|
6
|
-
# Idempotent : peut être ré-exécuté sans casser l'existant.
|
|
7
|
-
# ============================================================
|
|
8
|
-
|
|
9
|
-
set -euo pipefail
|
|
10
|
-
|
|
11
|
-
# ---------- Couleurs ----------
|
|
12
|
-
R='\033[0;31m'; G='\033[0;32m'; Y='\033[1;33m'; C='\033[0;36m'; N='\033[0m'
|
|
13
|
-
|
|
14
|
-
log() { echo -e "${C}[$(date +%H:%M:%S)]${N} $*"; }
|
|
15
|
-
ok() { echo -e "${G}[OK]${N} $*"; }
|
|
16
|
-
warn() { echo -e "${Y}[WARN]${N} $*"; }
|
|
17
|
-
die() { echo -e "${R}[FAIL]${N} $*"; exit 1; }
|
|
18
|
-
|
|
19
|
-
# ---------- Constantes ----------
|
|
20
|
-
OM_USER="${SUDO_USER:-$(whoami)}"
|
|
21
|
-
OM_HOME="$(getent passwd "$OM_USER" | cut -d: -f6)"
|
|
22
|
-
OM_DIR="$OM_HOME/.overmind"
|
|
23
|
-
LOG_DIR="$OM_DIR/logs"
|
|
24
|
-
PG_DB="overmind_memory"
|
|
25
|
-
PG_PORT=5432
|
|
26
|
-
MCP_PORT_CORE=3099
|
|
27
|
-
MCP_PORT_PG=5433
|
|
28
|
-
|
|
29
|
-
[ "$(id -u)" -ne 0 ] && die "Lancer avec sudo : sudo $0"
|
|
30
|
-
[ -z "$OM_USER" ] || [ -z "$OM_HOME" ] && die "Impossible de déterminer l'utilisateur"
|
|
31
|
-
|
|
32
|
-
log "Installation pour user=$OM_USER home=$OM_HOME"
|
|
33
|
-
|
|
34
|
-
# ============================================================
|
|
35
|
-
# STEP 1/6 — Vérification Node.js + npm
|
|
36
|
-
# ============================================================
|
|
37
|
-
log "STEP 1/6 : Node.js"
|
|
38
|
-
command -v node >/dev/null || die "Node.js manquant : curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt install -y nodejs"
|
|
39
|
-
NODE_MAJ=$(node -p "process.versions.node.split('.')[0]")
|
|
40
|
-
[ "$NODE_MAJ" -ge 20 ] || die "Node >= 20 requis (vous avez $(node -v))"
|
|
41
|
-
ok "Node $(node -v) / npm $(npm -v)"
|
|
42
|
-
|
|
43
|
-
# ============================================================
|
|
44
|
-
# STEP 2/6 — PostgreSQL 18 + pgvector
|
|
45
|
-
# ============================================================
|
|
46
|
-
log "STEP 2/6 : PostgreSQL + pgvector"
|
|
47
|
-
if ! dpkg -l postgresql-18-pgvector 2>/dev/null | grep -q '^ii'; then
|
|
48
|
-
log "Installation postgresql-18-pgvector..."
|
|
49
|
-
apt update -qq
|
|
50
|
-
DEBIAN_FRONTEND=noninteractive apt install -y postgresql-18-pgvector postgresql-client-18
|
|
51
|
-
fi
|
|
52
|
-
ok "postgresql-18-pgvector $(dpkg -s postgresql-18-pgvector | awk '/Version:/ {print $2}')"
|
|
53
|
-
|
|
54
|
-
# Service postgresql actif
|
|
55
|
-
if ! systemctl is-active --quiet postgresql; then
|
|
56
|
-
systemctl enable --now postgresql
|
|
57
|
-
fi
|
|
58
|
-
ok "postgresql.service: $(systemctl is-active postgresql)"
|
|
59
|
-
|
|
60
|
-
# DB + extension vector
|
|
61
|
-
if ! sudo -u postgres psql -tAc "SELECT 1 FROM pg_database WHERE datname='$PG_DB'" | grep -q 1; then
|
|
62
|
-
log "Création DB $PG_DB..."
|
|
63
|
-
sudo -u postgres createdb "$PG_DB"
|
|
64
|
-
fi
|
|
65
|
-
sudo -u postgres psql -d "$PG_DB" -c "CREATE EXTENSION IF NOT EXISTS vector;" >/dev/null
|
|
66
|
-
PGV=$(sudo -u postgres psql -d "$PG_DB" -tAc "SELECT extversion FROM pg_extension WHERE extname='vector'")
|
|
67
|
-
ok "DB $PG_DB prête, pgvector v$PGV"
|
|
68
|
-
|
|
69
|
-
# ============================================================
|
|
70
|
-
# STEP 3/6 — Packages npm globaux
|
|
71
|
-
# ============================================================
|
|
72
|
-
log "STEP 3/6 : npm install -g"
|
|
73
|
-
if ! npm list -g overmind-mcp >/dev/null 2>&1; then
|
|
74
|
-
npm install -g overmind-mcp@latest
|
|
75
|
-
fi
|
|
76
|
-
if ! npm list -g overmind-postgres-mcp >/dev/null 2>&1; then
|
|
77
|
-
npm install -g overmind-postgres-mcp@latest
|
|
78
|
-
fi
|
|
79
|
-
ok "overmind-mcp $(npm list -g overmind-mcp --depth=0 | awk '/overmind-mcp@/ {print $2}')"
|
|
80
|
-
ok "overmind-postgres-mcp $(npm list -g overmind-postgres-mcp --depth=0 | awk '/overmind-postgres-mcp@/ {print $2}')"
|
|
81
|
-
|
|
82
|
-
# ============================================================
|
|
83
|
-
# STEP 4/6 — Arborescence + .env
|
|
84
|
-
# ============================================================
|
|
85
|
-
log "STEP 4/6 : ~/.overmind/"
|
|
86
|
-
mkdir -p "$OM_DIR/logs" "$OM_DIR/config"
|
|
87
|
-
chown -R "$OM_USER:$OM_USER" "$OM_DIR"
|
|
88
|
-
|
|
89
|
-
if [ ! -f "$OM_DIR/.env" ]; then
|
|
90
|
-
log "Création $OM_DIR/.env (template à compléter)..."
|
|
91
|
-
cat > "$OM_DIR/.env" <<'EOF'
|
|
92
|
-
# OverMind - Configuration principale (mode natif sans Docker)
|
|
93
|
-
|
|
94
|
-
# --- PostgreSQL (apt postgresql-18 + pgvector) ---
|
|
95
|
-
POSTGRES_HOST=127.0.0.1
|
|
96
|
-
POSTGRES_PORT=5432
|
|
97
|
-
POSTGRES_USER=postgres
|
|
98
|
-
POSTGRES_PASSWORD=CHANGEME_PG_PASS
|
|
99
|
-
POSTGRES_DATABASE=overmind_memory
|
|
100
|
-
POSTGRES_SSL=false
|
|
101
|
-
POSTGRES_MAX_CONNECTIONS=10
|
|
102
|
-
|
|
103
|
-
# --- Provider LLM par défaut ---
|
|
104
|
-
OVERMIND_DEFAULT_PROVIDER=anthropic
|
|
105
|
-
|
|
106
|
-
# --- Core ---
|
|
107
|
-
OVERMIND_MEMORY_TYPE=postgres
|
|
108
|
-
MEMORY_HTTP_PORT=3099
|
|
109
|
-
OVERMIND_HTTP_MODE=false
|
|
110
|
-
OVERMIND_HTTP_PORT=3099
|
|
111
|
-
|
|
112
|
-
# --- Embeddings (Qwen 8B, 4096D) ---
|
|
113
|
-
OVERMIND_EMBEDDING_DIMENSIONS=4096
|
|
114
|
-
OVERMIND_EMBEDDING_MODEL=qwen/qwen3-embedding-8b
|
|
115
|
-
OVERMIND_EMBEDDING_URL=https://openrouter.ai/api/v1
|
|
116
|
-
# OVERMIND_EMBEDDING_KEY=sk-or-...
|
|
117
|
-
|
|
118
|
-
# --- Clés LLM (à remplir) ---
|
|
119
|
-
# ANTHROPIC_AUTH_TOKEN=...
|
|
120
|
-
# ANTHROPIC_BASE_URL=https://api.anthropic.com
|
|
121
|
-
# ANTHROPIC_MODEL=claude-sonnet-4-6
|
|
122
|
-
# MISTRAL_API_KEY=...
|
|
123
|
-
# GLM_API_KEY=...
|
|
124
|
-
# ELEVENLABS_API_KEY=...
|
|
125
|
-
EOF
|
|
126
|
-
chown "$OM_USER:$OM_USER" "$OM_DIR/.env"
|
|
127
|
-
chmod 600 "$OM_DIR/.env"
|
|
128
|
-
warn "Éditer $OM_DIR/.env et remplir POSTGRES_PASSWORD + clés LLM"
|
|
129
|
-
else
|
|
130
|
-
ok ".env existant conservé"
|
|
131
|
-
fi
|
|
132
|
-
|
|
133
|
-
# ============================================================
|
|
134
|
-
# STEP 5/6 — Systemd units
|
|
135
|
-
# ============================================================
|
|
136
|
-
log "STEP 5/6 : systemd units"
|
|
137
|
-
|
|
138
|
-
write_unit() {
|
|
139
|
-
local name="$1" port="$2" entry="$3"
|
|
140
|
-
cat > "/etc/systemd/system/$name" <<EOF
|
|
141
|
-
[Unit]
|
|
142
|
-
Description=$name (OverMind)
|
|
143
|
-
After=network-online.target postgresql.service
|
|
144
|
-
Wants=network-online.target
|
|
145
|
-
Requires=postgresql.service
|
|
146
|
-
|
|
147
|
-
[Service]
|
|
148
|
-
Type=simple
|
|
149
|
-
User=$OM_USER
|
|
150
|
-
Group=$OM_USER
|
|
151
|
-
WorkingDirectory=$OM_DIR
|
|
152
|
-
EnvironmentFile=$OM_DIR/.env
|
|
153
|
-
ExecStart=/usr/bin/node --max-old-space-size=256 --no-warnings $entry
|
|
154
|
-
Restart=on-failure
|
|
155
|
-
RestartSec=5
|
|
156
|
-
StandardOutput=append:$LOG_DIR/$name.log
|
|
157
|
-
StandardError=append:$LOG_DIR/$name.err
|
|
158
|
-
|
|
159
|
-
[Install]
|
|
160
|
-
WantedBy=multi-user.target
|
|
161
|
-
EOF
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
write_unit "overmind-mcp.service" "$MCP_PORT_CORE" \
|
|
165
|
-
"/usr/lib/node_modules/overmind-mcp/dist/bin/cli.js --transport httpStream --port $MCP_PORT_CORE"
|
|
166
|
-
|
|
167
|
-
write_unit "overmind-postgres-mcp.service" "$MCP_PORT_PG" \
|
|
168
|
-
"/usr/lib/node_modules/overmind-postgres-mcp/dist/index.js"
|
|
169
|
-
|
|
170
|
-
systemctl daemon-reload
|
|
171
|
-
systemctl enable --now overmind-mcp.service overmind-postgres-mcp.service
|
|
172
|
-
ok "Services activés et démarrés"
|
|
173
|
-
|
|
174
|
-
# ============================================================
|
|
175
|
-
# STEP 6/6 — Validation HTTP
|
|
176
|
-
# ============================================================
|
|
177
|
-
log "STEP 6/6 : validation"
|
|
178
|
-
|
|
179
|
-
sleep 3
|
|
180
|
-
test_endpoint() {
|
|
181
|
-
local port="$1" name="$2"
|
|
182
|
-
local code
|
|
183
|
-
code=$(curl -s -o /dev/null -w "%{http_code}" -m 5 \
|
|
184
|
-
-H "Accept: application/json, text/event-stream" \
|
|
185
|
-
-H "Content-Type: application/json" \
|
|
186
|
-
-X POST "http://127.0.0.1:$port/mcp" \
|
|
187
|
-
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}' || echo "000")
|
|
188
|
-
if [ "$code" = "200" ]; then
|
|
189
|
-
ok "$name (port $port) : HTTP 200"
|
|
190
|
-
else
|
|
191
|
-
warn "$name (port $port) : HTTP $code — voir $LOG_DIR/$name.err"
|
|
192
|
-
fi
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
test_endpoint "$MCP_PORT_CORE" "overmind-mcp"
|
|
196
|
-
test_endpoint "$MCP_PORT_PG" "overmind-postgres-mcp"
|
|
197
|
-
|
|
198
|
-
# Test SQL direct
|
|
199
|
-
if sudo -u postgres psql -d "$PG_DB" -c "SELECT 1" >/dev/null 2>&1; then
|
|
200
|
-
ok "PostgreSQL $PG_DB accessible en local"
|
|
201
|
-
else
|
|
202
|
-
warn "PostgreSQL $PG_DB inaccessible — vérifier sudo -u postgres psql"
|
|
203
|
-
fi
|
|
204
|
-
|
|
205
|
-
echo
|
|
206
|
-
echo -e "${G}============================================================${N}"
|
|
207
|
-
echo -e "${G}✅ Installation terminée${N}"
|
|
208
|
-
echo -e "${G}============================================================${N}"
|
|
209
|
-
echo
|
|
210
|
-
echo "Endpoints (loopback uniquement) :"
|
|
211
|
-
echo " • overmind-mcp : http://127.0.0.1:$MCP_PORT_CORE"
|
|
212
|
-
echo " • overmind-postgres-mcp: http://127.0.0.1:$MCP_PORT_PG"
|
|
213
|
-
echo
|
|
214
|
-
echo "Pour accès distant, utiliser un tunnel SSH :"
|
|
215
|
-
echo " ssh -L 13099:127.0.0.1:$MCP_PORT_CORE -L 15433:127.0.0.1:$MCP_PORT_PG user@host"
|
|
216
|
-
echo
|
|
217
|
-
echo "Actions manuelles restantes :"
|
|
218
|
-
echo " 1. Éditer $OM_DIR/.env et remplir POSTGRES_PASSWORD + clés LLM"
|
|
219
|
-
echo " 2. sudo systemctl restart overmind-mcp overmind-postgres-mcp"
|
|
220
|
-
echo " 3. (Optionnel) Créer un user Postgres dédié et restreindre pg_hba.conf"
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ============================================================
|
|
3
|
+
# install-overmind-native.sh
|
|
4
|
+
# Installation OverMind-MCP + Postgres-MCP — mode NATIF (sans Docker)
|
|
5
|
+
# Pour Ubuntu 26.04+ avec PostgreSQL 18 + pgvector + systemd
|
|
6
|
+
# Idempotent : peut être ré-exécuté sans casser l'existant.
|
|
7
|
+
# ============================================================
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
# ---------- Couleurs ----------
|
|
12
|
+
R='\033[0;31m'; G='\033[0;32m'; Y='\033[1;33m'; C='\033[0;36m'; N='\033[0m'
|
|
13
|
+
|
|
14
|
+
log() { echo -e "${C}[$(date +%H:%M:%S)]${N} $*"; }
|
|
15
|
+
ok() { echo -e "${G}[OK]${N} $*"; }
|
|
16
|
+
warn() { echo -e "${Y}[WARN]${N} $*"; }
|
|
17
|
+
die() { echo -e "${R}[FAIL]${N} $*"; exit 1; }
|
|
18
|
+
|
|
19
|
+
# ---------- Constantes ----------
|
|
20
|
+
OM_USER="${SUDO_USER:-$(whoami)}"
|
|
21
|
+
OM_HOME="$(getent passwd "$OM_USER" | cut -d: -f6)"
|
|
22
|
+
OM_DIR="$OM_HOME/.overmind"
|
|
23
|
+
LOG_DIR="$OM_DIR/logs"
|
|
24
|
+
PG_DB="overmind_memory"
|
|
25
|
+
PG_PORT=5432
|
|
26
|
+
MCP_PORT_CORE=3099
|
|
27
|
+
MCP_PORT_PG=5433
|
|
28
|
+
|
|
29
|
+
[ "$(id -u)" -ne 0 ] && die "Lancer avec sudo : sudo $0"
|
|
30
|
+
[ -z "$OM_USER" ] || [ -z "$OM_HOME" ] && die "Impossible de déterminer l'utilisateur"
|
|
31
|
+
|
|
32
|
+
log "Installation pour user=$OM_USER home=$OM_HOME"
|
|
33
|
+
|
|
34
|
+
# ============================================================
|
|
35
|
+
# STEP 1/6 — Vérification Node.js + npm
|
|
36
|
+
# ============================================================
|
|
37
|
+
log "STEP 1/6 : Node.js"
|
|
38
|
+
command -v node >/dev/null || die "Node.js manquant : curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt install -y nodejs"
|
|
39
|
+
NODE_MAJ=$(node -p "process.versions.node.split('.')[0]")
|
|
40
|
+
[ "$NODE_MAJ" -ge 20 ] || die "Node >= 20 requis (vous avez $(node -v))"
|
|
41
|
+
ok "Node $(node -v) / npm $(npm -v)"
|
|
42
|
+
|
|
43
|
+
# ============================================================
|
|
44
|
+
# STEP 2/6 — PostgreSQL 18 + pgvector
|
|
45
|
+
# ============================================================
|
|
46
|
+
log "STEP 2/6 : PostgreSQL + pgvector"
|
|
47
|
+
if ! dpkg -l postgresql-18-pgvector 2>/dev/null | grep -q '^ii'; then
|
|
48
|
+
log "Installation postgresql-18-pgvector..."
|
|
49
|
+
apt update -qq
|
|
50
|
+
DEBIAN_FRONTEND=noninteractive apt install -y postgresql-18-pgvector postgresql-client-18
|
|
51
|
+
fi
|
|
52
|
+
ok "postgresql-18-pgvector $(dpkg -s postgresql-18-pgvector | awk '/Version:/ {print $2}')"
|
|
53
|
+
|
|
54
|
+
# Service postgresql actif
|
|
55
|
+
if ! systemctl is-active --quiet postgresql; then
|
|
56
|
+
systemctl enable --now postgresql
|
|
57
|
+
fi
|
|
58
|
+
ok "postgresql.service: $(systemctl is-active postgresql)"
|
|
59
|
+
|
|
60
|
+
# DB + extension vector
|
|
61
|
+
if ! sudo -u postgres psql -tAc "SELECT 1 FROM pg_database WHERE datname='$PG_DB'" | grep -q 1; then
|
|
62
|
+
log "Création DB $PG_DB..."
|
|
63
|
+
sudo -u postgres createdb "$PG_DB"
|
|
64
|
+
fi
|
|
65
|
+
sudo -u postgres psql -d "$PG_DB" -c "CREATE EXTENSION IF NOT EXISTS vector;" >/dev/null
|
|
66
|
+
PGV=$(sudo -u postgres psql -d "$PG_DB" -tAc "SELECT extversion FROM pg_extension WHERE extname='vector'")
|
|
67
|
+
ok "DB $PG_DB prête, pgvector v$PGV"
|
|
68
|
+
|
|
69
|
+
# ============================================================
|
|
70
|
+
# STEP 3/6 — Packages npm globaux
|
|
71
|
+
# ============================================================
|
|
72
|
+
log "STEP 3/6 : npm install -g"
|
|
73
|
+
if ! npm list -g overmind-mcp >/dev/null 2>&1; then
|
|
74
|
+
npm install -g overmind-mcp@latest
|
|
75
|
+
fi
|
|
76
|
+
if ! npm list -g overmind-postgres-mcp >/dev/null 2>&1; then
|
|
77
|
+
npm install -g overmind-postgres-mcp@latest
|
|
78
|
+
fi
|
|
79
|
+
ok "overmind-mcp $(npm list -g overmind-mcp --depth=0 | awk '/overmind-mcp@/ {print $2}')"
|
|
80
|
+
ok "overmind-postgres-mcp $(npm list -g overmind-postgres-mcp --depth=0 | awk '/overmind-postgres-mcp@/ {print $2}')"
|
|
81
|
+
|
|
82
|
+
# ============================================================
|
|
83
|
+
# STEP 4/6 — Arborescence + .env
|
|
84
|
+
# ============================================================
|
|
85
|
+
log "STEP 4/6 : ~/.overmind/"
|
|
86
|
+
mkdir -p "$OM_DIR/logs" "$OM_DIR/config"
|
|
87
|
+
chown -R "$OM_USER:$OM_USER" "$OM_DIR"
|
|
88
|
+
|
|
89
|
+
if [ ! -f "$OM_DIR/.env" ]; then
|
|
90
|
+
log "Création $OM_DIR/.env (template à compléter)..."
|
|
91
|
+
cat > "$OM_DIR/.env" <<'EOF'
|
|
92
|
+
# OverMind - Configuration principale (mode natif sans Docker)
|
|
93
|
+
|
|
94
|
+
# --- PostgreSQL (apt postgresql-18 + pgvector) ---
|
|
95
|
+
POSTGRES_HOST=127.0.0.1
|
|
96
|
+
POSTGRES_PORT=5432
|
|
97
|
+
POSTGRES_USER=postgres
|
|
98
|
+
POSTGRES_PASSWORD=CHANGEME_PG_PASS
|
|
99
|
+
POSTGRES_DATABASE=overmind_memory
|
|
100
|
+
POSTGRES_SSL=false
|
|
101
|
+
POSTGRES_MAX_CONNECTIONS=10
|
|
102
|
+
|
|
103
|
+
# --- Provider LLM par défaut ---
|
|
104
|
+
OVERMIND_DEFAULT_PROVIDER=anthropic
|
|
105
|
+
|
|
106
|
+
# --- Core ---
|
|
107
|
+
OVERMIND_MEMORY_TYPE=postgres
|
|
108
|
+
MEMORY_HTTP_PORT=3099
|
|
109
|
+
OVERMIND_HTTP_MODE=false
|
|
110
|
+
OVERMIND_HTTP_PORT=3099
|
|
111
|
+
|
|
112
|
+
# --- Embeddings (Qwen 8B, 4096D) ---
|
|
113
|
+
OVERMIND_EMBEDDING_DIMENSIONS=4096
|
|
114
|
+
OVERMIND_EMBEDDING_MODEL=qwen/qwen3-embedding-8b
|
|
115
|
+
OVERMIND_EMBEDDING_URL=https://openrouter.ai/api/v1
|
|
116
|
+
# OVERMIND_EMBEDDING_KEY=sk-or-...
|
|
117
|
+
|
|
118
|
+
# --- Clés LLM (à remplir) ---
|
|
119
|
+
# ANTHROPIC_AUTH_TOKEN=...
|
|
120
|
+
# ANTHROPIC_BASE_URL=https://api.anthropic.com
|
|
121
|
+
# ANTHROPIC_MODEL=claude-sonnet-4-6
|
|
122
|
+
# MISTRAL_API_KEY=...
|
|
123
|
+
# GLM_API_KEY=...
|
|
124
|
+
# ELEVENLABS_API_KEY=...
|
|
125
|
+
EOF
|
|
126
|
+
chown "$OM_USER:$OM_USER" "$OM_DIR/.env"
|
|
127
|
+
chmod 600 "$OM_DIR/.env"
|
|
128
|
+
warn "Éditer $OM_DIR/.env et remplir POSTGRES_PASSWORD + clés LLM"
|
|
129
|
+
else
|
|
130
|
+
ok ".env existant conservé"
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# ============================================================
|
|
134
|
+
# STEP 5/6 — Systemd units
|
|
135
|
+
# ============================================================
|
|
136
|
+
log "STEP 5/6 : systemd units"
|
|
137
|
+
|
|
138
|
+
write_unit() {
|
|
139
|
+
local name="$1" port="$2" entry="$3"
|
|
140
|
+
cat > "/etc/systemd/system/$name" <<EOF
|
|
141
|
+
[Unit]
|
|
142
|
+
Description=$name (OverMind)
|
|
143
|
+
After=network-online.target postgresql.service
|
|
144
|
+
Wants=network-online.target
|
|
145
|
+
Requires=postgresql.service
|
|
146
|
+
|
|
147
|
+
[Service]
|
|
148
|
+
Type=simple
|
|
149
|
+
User=$OM_USER
|
|
150
|
+
Group=$OM_USER
|
|
151
|
+
WorkingDirectory=$OM_DIR
|
|
152
|
+
EnvironmentFile=$OM_DIR/.env
|
|
153
|
+
ExecStart=/usr/bin/node --max-old-space-size=256 --no-warnings $entry
|
|
154
|
+
Restart=on-failure
|
|
155
|
+
RestartSec=5
|
|
156
|
+
StandardOutput=append:$LOG_DIR/$name.log
|
|
157
|
+
StandardError=append:$LOG_DIR/$name.err
|
|
158
|
+
|
|
159
|
+
[Install]
|
|
160
|
+
WantedBy=multi-user.target
|
|
161
|
+
EOF
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
write_unit "overmind-mcp.service" "$MCP_PORT_CORE" \
|
|
165
|
+
"/usr/lib/node_modules/overmind-mcp/dist/bin/cli.js --transport httpStream --port $MCP_PORT_CORE"
|
|
166
|
+
|
|
167
|
+
write_unit "overmind-postgres-mcp.service" "$MCP_PORT_PG" \
|
|
168
|
+
"/usr/lib/node_modules/overmind-postgres-mcp/dist/index.js"
|
|
169
|
+
|
|
170
|
+
systemctl daemon-reload
|
|
171
|
+
systemctl enable --now overmind-mcp.service overmind-postgres-mcp.service
|
|
172
|
+
ok "Services activés et démarrés"
|
|
173
|
+
|
|
174
|
+
# ============================================================
|
|
175
|
+
# STEP 6/6 — Validation HTTP
|
|
176
|
+
# ============================================================
|
|
177
|
+
log "STEP 6/6 : validation"
|
|
178
|
+
|
|
179
|
+
sleep 3
|
|
180
|
+
test_endpoint() {
|
|
181
|
+
local port="$1" name="$2"
|
|
182
|
+
local code
|
|
183
|
+
code=$(curl -s -o /dev/null -w "%{http_code}" -m 5 \
|
|
184
|
+
-H "Accept: application/json, text/event-stream" \
|
|
185
|
+
-H "Content-Type: application/json" \
|
|
186
|
+
-X POST "http://127.0.0.1:$port/mcp" \
|
|
187
|
+
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}' || echo "000")
|
|
188
|
+
if [ "$code" = "200" ]; then
|
|
189
|
+
ok "$name (port $port) : HTTP 200"
|
|
190
|
+
else
|
|
191
|
+
warn "$name (port $port) : HTTP $code — voir $LOG_DIR/$name.err"
|
|
192
|
+
fi
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
test_endpoint "$MCP_PORT_CORE" "overmind-mcp"
|
|
196
|
+
test_endpoint "$MCP_PORT_PG" "overmind-postgres-mcp"
|
|
197
|
+
|
|
198
|
+
# Test SQL direct
|
|
199
|
+
if sudo -u postgres psql -d "$PG_DB" -c "SELECT 1" >/dev/null 2>&1; then
|
|
200
|
+
ok "PostgreSQL $PG_DB accessible en local"
|
|
201
|
+
else
|
|
202
|
+
warn "PostgreSQL $PG_DB inaccessible — vérifier sudo -u postgres psql"
|
|
203
|
+
fi
|
|
204
|
+
|
|
205
|
+
echo
|
|
206
|
+
echo -e "${G}============================================================${N}"
|
|
207
|
+
echo -e "${G}✅ Installation terminée${N}"
|
|
208
|
+
echo -e "${G}============================================================${N}"
|
|
209
|
+
echo
|
|
210
|
+
echo "Endpoints (loopback uniquement) :"
|
|
211
|
+
echo " • overmind-mcp : http://127.0.0.1:$MCP_PORT_CORE"
|
|
212
|
+
echo " • overmind-postgres-mcp: http://127.0.0.1:$MCP_PORT_PG"
|
|
213
|
+
echo
|
|
214
|
+
echo "Pour accès distant, utiliser un tunnel SSH :"
|
|
215
|
+
echo " ssh -L 13099:127.0.0.1:$MCP_PORT_CORE -L 15433:127.0.0.1:$MCP_PORT_PG user@host"
|
|
216
|
+
echo
|
|
217
|
+
echo "Actions manuelles restantes :"
|
|
218
|
+
echo " 1. Éditer $OM_DIR/.env et remplir POSTGRES_PASSWORD + clés LLM"
|
|
219
|
+
echo " 2. sudo systemctl restart overmind-mcp overmind-postgres-mcp"
|
|
220
|
+
echo " 3. (Optionnel) Créer un user Postgres dédié et restreindre pg_hba.conf"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "overmind-mcp",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.12",
|
|
4
4
|
"description": "Orchestrateur universel agents IA multi-modeles via MCP. Inclut le protocole 'Custom-Nickname' pour identifier vos agents avec des surnoms originaux (The Chaos Prophet, Shadow Sniper, etc.), l'isolation mémoire (Private Memory Context) et le support pour QwenCli et Nous Hermes. Installation automatique des dépendances Docker (PostgreSQL, pgvector) inclus.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"async-mutex": "^0.5.0",
|
|
101
101
|
"dotenv": "^17.4.2",
|
|
102
102
|
"fastmcp": "^4.0.1",
|
|
103
|
-
"overmind-postgres-mcp": "^1.
|
|
103
|
+
"overmind-postgres-mcp": "^1.4.1",
|
|
104
104
|
"pg": "^8.20.0",
|
|
105
105
|
"pino": "^10.3.1",
|
|
106
106
|
"pino-roll": "^4.0.0",
|
package/dist/bin/launch.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// launch.js — compiled launcher for Workflow
|
|
2
|
-
// Prebuild copies this to dist/bin/launch.js
|
|
3
|
-
|
|
4
|
-
const { exec, spawn } = require("child_process");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const path = require("path");
|
|
7
|
-
|
|
8
|
-
const SCRIPT_DIR = path.resolve(__dirname, "..");
|
|
9
|
-
const LOG_DIR = path.join(SCRIPT_DIR, "logs");
|
|
10
|
-
const PORT = "3099";
|
|
11
|
-
const NAME = "Workflow";
|
|
12
|
-
const BUILD_CMD = "npm run build";
|
|
13
|
-
|
|
14
|
-
function log(msg) {
|
|
15
|
-
console.log(`[{new Date().toISOString()}] [{NAME}] ${msg}`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function ensureDir(dir) {
|
|
19
|
-
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function killPort(port) {
|
|
23
|
-
return new Promise((resolve) => {
|
|
24
|
-
const cmd = `powershell -c "Get-NetTCPConnection -LocalPort ${port} -State Listen -ErrorAction SilentlyContinue | Format-Table -HideTableHeaders -Property OwningProcess | ForEach-Object {$_.Trim()} | Where-Object {$_}"`;
|
|
25
|
-
exec(cmd, { cwd: SCRIPT_DIR }, (err, stdout) => {
|
|
26
|
-
const pids = (stdout || "").trim().split("\n").map((p) => p.trim()).filter(Boolean);
|
|
27
|
-
if (pids.length === 0) { log(`Port ${port} — no process`); resolve(); return; }
|
|
28
|
-
for (const pid of pids) {
|
|
29
|
-
log(`Port ${port} PID ${pid} killed`);
|
|
30
|
-
exec(`taskkill /F /PID ${pid}`, () => {});
|
|
31
|
-
}
|
|
32
|
-
setTimeout(resolve, 500);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function build() {
|
|
38
|
-
return new Promise((resolve) => {
|
|
39
|
-
log("[BUILD] Starting...");
|
|
40
|
-
exec(BUILD_CMD, { cwd: SCRIPT_DIR }, (err) => {
|
|
41
|
-
if (err && !fs.existsSync(path.join(SCRIPT_DIR, "dist"))) {
|
|
42
|
-
log("[FAIL] Build failed — no dist");
|
|
43
|
-
resolve(false);
|
|
44
|
-
} else {
|
|
45
|
-
log("[OK] Build complete");
|
|
46
|
-
resolve(true);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function launch() {
|
|
53
|
-
const logFile = path.join(LOG_DIR, `${NAME}.log`);
|
|
54
|
-
const errFile = path.join(LOG_DIR, `${NAME}.err.log`);
|
|
55
|
-
const out = fs.openSync(logFile, "a");
|
|
56
|
-
const err = fs.openSync(errFile, "a");
|
|
57
|
-
const env = { ...process.env, ...{} };
|
|
58
|
-
const child = spawn("node", ['--max-old-space-size=256', '--no-warnings', '--env-file=.env', 'dist/bin/cli.js', '--transport', 'httpStream', '--port', '3099'], {
|
|
59
|
-
cwd: SCRIPT_DIR,
|
|
60
|
-
detached: true,
|
|
61
|
-
stdio: ["ignore", out, err],
|
|
62
|
-
env,
|
|
63
|
-
});
|
|
64
|
-
child.unref();
|
|
65
|
-
log(`[SPAWN] PID=${child.pid}`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async function main() {
|
|
69
|
-
log("[START] Launching...");
|
|
70
|
-
ensureDir(LOG_DIR);
|
|
71
|
-
await killPort(PORT);
|
|
72
|
-
const ok = await build();
|
|
73
|
-
if (!ok) { console.error("[ABORT] Build failed"); process.exit(1); }
|
|
74
|
-
launch();
|
|
75
|
-
log("[DONE] Server launched. Check ${LOG_DIR}/${NAME}.log");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
main().catch(console.error);
|