graphmemory <command> [options]Primary mode. Starts HTTP server with MCP endpoints, REST API, web UI, and WebSocket.
# Zero-config: use current directory as a single project
graphmemory serve
# With config file: multi-project, custom settings
graphmemory serve --config graph-memory.yamlWhen no --config is provided and graph-memory.yaml is not found, the current directory becomes the project. The project ID is the directory name.
- Load YAML config, create
ProjectManager - Add all projects (load graphs from disk, or fresh if
--reindex) - Start HTTP server (MCP + REST API + static UI + WebSocket)
- Validate
jwtSecretif users are configured (warns if missing) - Start auto-save (30s interval for dirty projects)
- Background: per project — load embedding models → start indexing
- Handle
SIGINT/SIGTERM: shutdown all projects gracefully
| Path | Description |
|---|---|
/ |
Web UI (static files from ui/dist/) |
/mcp/{projectId} |
MCP HTTP endpoint |
/api/* |
REST API |
/api/ws |
WebSocket |
| Flag | Default | Description |
|---|---|---|
--config |
graph-memory.yaml |
Path to config (optional — uses cwd if not found) |
--host |
from config or 127.0.0.1 |
Bind address |
--port |
from config or 3000 |
Port |
--reindex |
false |
Discard persisted graphs, re-index from scratch |
--log-level |
info |
Log level: fatal/error/warn/info/debug/trace |
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL |
info |
Log level threshold (also settable via --log-level) |
LOG_JSON |
0 |
Set to 1 for JSON log output (for Docker/production) |
Indexes a project and exits. Useful for CI/CD or as a pre-start step.
# Zero-config: index current directory
graphmemory index
# With config
graphmemory index --config graph-memory.yaml --project my-app [--reindex]- Load graphs from disk (or fresh if
--reindex) + load embedding models - Run
scan()+drain()(walks directory, embeds all files) - Save all graphs to disk, exit
| Flag | Default | Description |
|---|---|---|
--config |
graph-memory.yaml |
Path to config (optional — uses cwd if not found) |
--project |
all projects | Project ID to index (omit to index all) |
--reindex |
false |
Discard persisted graphs |
Interactive command to add a user to the config file.
graphmemory users add --config graph-memory.yaml- User ID — alphanumeric identifier (e.g.
alice) - Name — display name
- Email — for UI login
- Password — hidden input, with confirmation
- Hashes the password with scrypt (
$scrypt$N$r$p$salt$hash) - Generates a random API key (
mgm-{random base64url}) - Writes the user block into
graph-memory.yaml(finds existingusers:section or creates new one) - Validates the config after writing
Both main commands (index, serve) support --reindex:
- Discards persisted graph JSON files
- Creates fresh empty graphs
- Re-indexes all files from scratch
Each graph JSON file stores a data version and embedding model fingerprint. On load, if either differs from the current config, the graph is automatically discarded and re-indexed — no --reindex needed. This covers both model changes and schema upgrades (e.g. new embedding content, path normalization changes).
The primary connection method. Start the server with serve, then connect MCP clients to http://localhost:3000/mcp/{projectId}.
Claude Desktop — add via Settings > Connectors in the app, enter the URL:
http://localhost:3000/mcp/my-app
Claude Code — run in your project directory:
claude mcp add --transport http --scope project graph-memory http://localhost:3000/mcp/my-appOr add to .mcp.json manually:
{
"mcpServers": {
"graph-memory": {
"type": "http",
"url": "http://localhost:3000/mcp/my-app"
}
}
}Cursor / Windsurf / other clients — enter the MCP URL directly in settings:
http://localhost:3000/mcp/my-app
Multiple clients can connect to the same server simultaneously. Each session gets its own MCP instance but shares graph data.
npm run build # Build server + UI → dist/
npm run build:server # Build server only
npm run build:ui # Build UI only
npm run dev # tsc --watch (server)
npm run cli:dev # tsx src/cli/index.ts (run without build)
npm test # Run all tests
npm run test:watch # Watch mode