-
Notifications
You must be signed in to change notification settings - Fork 1
Server Management
Maxim Mironenko edited this page Feb 6, 2026
·
10 revisions
After running install_command.sh, the kg-memory command is available globally:
kg-memory start # Start the server (background, nohup)
kg-memory stop # Stop the server (SIGTERM, then SIGKILL after 2s)
kg-memory restart # Stop + start
kg-memory status # Check PID + hit /health endpoint
kg-memory logs # tail -f /tmp/mcp_server.logAlternative (without global command):
cd ~/.claude/plugins/cache/maxim-plugins/memory/latest/server
./manage_server.sh start- Script checks PID file — if server already running, exits
- Runs
mcp_streamable_server.pyvia the venv Python, backgrounded withnohup - PID written to
.mcp_server.pid - Waits 2 seconds, checks if process is alive
- Server loads user graph from
~/.claude/knowledge/user.json - Starts background saver thread (30s interval)
- Listens on
http://127.0.0.1:8765/
| Endpoint | Purpose |
|---|---|
POST / |
MCP Streamable HTTP (tool calls from Claude Code) |
GET /health |
Simple health check with version, session count |
GET /api/health |
Detailed health for visual editor |
GET /api/graph/read |
REST read (visual editor) |
POST /api/nodes |
REST create/update node |
DELETE /api/nodes/{level}/{id} |
REST delete node |
POST /api/edges |
REST create/update edge |
DELETE /api/edges/{level}/{from}/{to}/{rel} |
REST delete edge |
POST /api/nodes/{level}/{id}/recall |
REST recall archived node |
GET /api/progress/{task_id} |
REST get task progress |
POST /api/progress |
REST set task progress |
GET /api/sessions/{id}/stats |
REST session stats |
WS /ws |
WebSocket for visual editor real-time updates |
| File | Location |
|---|---|
| Server script | ~/.claude/plugins/cache/maxim-plugins/memory/latest/server/mcp_streamable_server.py |
| PID file | ~/.claude/plugins/cache/maxim-plugins/memory/latest/server/.mcp_server.pid |
| Logs | /tmp/mcp_server.log |
| Python venv | ~/.claude/plugins/cache/maxim-plugins/memory/latest/server/venv/ |
| MCP config | ~/.claude/plugins/memory/.mcp.json |
For auto-start on boot and auto-restart on crashes:
# Link service file
mkdir -p ~/.config/systemd/user
ln -s ~/.claude/plugins/cache/maxim-plugins/memory/latest/server/memory-mcp.service \
~/.config/systemd/user/
# Enable and start
systemctl --user enable memory-mcp.service
systemctl --user start memory-mcp.service
# Check status
systemctl --user status memory-mcp.service
# View logs
journalctl --user -u memory-mcp.service -fThe service file configures all environment variables with sensible defaults.
Server won't start
# Check if port is taken
lsof -i :8765
# Check for stale PID file
cat ~/.claude/plugins/cache/maxim-plugins/memory/latest/server/.mcp_server.pid
ps -p $(cat ~/.claude/plugins/cache/maxim-plugins/memory/latest/server/.mcp_server.pid)
# Remove stale PID and try again
rm ~/.claude/plugins/cache/maxim-plugins/memory/latest/server/.mcp_server.pid
kg-memory startServer crashes on start
# Check logs for Python errors
cat /tmp/mcp_server.log
# Common: missing dependencies
cd ~/.claude/plugins/cache/maxim-plugins/memory/latest/server
./venv/bin/pip install -r requirements.txtClaude Code can't connect
# Verify server is responding
curl http://127.0.0.1:8765/health
# Check MCP config points to right URL
cat ~/.claude/plugins/memory/.mcp.json
# Should show: "url": "http://127.0.0.1:8765/"Server using too much memory The in-memory store grows with loaded project graphs. Each project graph stays loaded once accessed. Restart the server to unload all project graphs — they reload on demand.