Documentation
Installation
The two paths are functionally identical — only the index backend differs. Requires Node >= 20.
The tarball prints a SQLITE BACKEND upgrade hint at startup; on a networked machine cd malong && npm ci upgrades it to the full backend.
Both install paths bundle the Rust parsing binary — the MCP server auto-starts it on launch; no manual start needed.
Linux / macOS communicate over a Unix socket (default /tmp/malong-parse-$(id -u).sock); Windows uses TCP 127.0.0.1:31001 and the server spawns malong-parse.exe automatically.
Override the socket, port or binary with MALONG_SOCKET / MALONG_PORT / MALONG_PARSE_BIN (see environment variables).
Quick start
Index → locate the target symbol → assess blast radius → transactional edit (reversible) → run tests → lint/typecheck to finish.
MCP clients
The MCP layer is standard JSON-RPC over stdio, so any MCP client works. All configs below are tested end-to-end.
{ "$schema": "https://opencode.ai/config.json",
"mcp": {
"malong": {
"type": "local",
"command": ["node", "--max-old-space-size=512", "malong/mcp-server.js", "--workspace", "."],
"enabled": true
}
}
}
{ "mcpServers": {
"malong": { "command": "node", "args": ["/path/to/malong/mcp-server.js"] }
}
}
claude mcp add liuhe -- node /path/to/malong/mcp-server.js --workspace /path/to/project claude mcp list # → "liuhe … ✔ Connected" # Headless example claude -p "index the workspace with reindex, then find createDb with symbol_search" \ --allowedTools "mcp__liuhe__reindex" "mcp__liuhe__symbol_search"
model = "deepseek-v4-flash" model_provider = "opencode-zen" [model_providers.opencode-zen] name = "OpenCode Zen" base_url = "https://opencode.ai/zen/go/v1" # any OpenAI-compatible endpoint wire_api = "chat" env_key = "OPENCODE_ZEN_API_KEY" # codex reads the API key from this env var [mcp_servers.liuhe] command = "node" args = ["/path/to/malong/mcp-server.js", "--workspace", "/path/to/project"]
Version note: recent codex releases force the OpenAI Responses API — use a version that still supports wire_api = "chat" (verified with 0.50.0).
bash malong/dsh/install-dsh.sh # idempotent; edits ~/.dsh/profiles/web/cordis.patch.yml with backup pkill -f "dsh web"; dsh web --port 3456 --host 0.0.0.0 --trusted-host <LAN IP>
The bridge exposes the Six-He line only — 13 tools as malong__<tool> — and auto-fills workspace_dir from the current conversation's workspace (explicit paths still win). Export MALONG_INTERFACE=classic|diagnostic on the dsh host for the classic full catalog (44) or the analyzer tier (18). Full guide incl. index rules: malong/dsh/DSH-INTEGRATION.md
CLI options
| Option | Description |
|---|---|
| --workspace <dir> | Root directory to index and operate on |
| --concurrency <n> | Number of parallel tasks |
| --max-old-space-size=<MB> | V8 heap cap, 512 recommended; warns at startup if unset and the heap is unlimited |
| --expose-gc | Enables periodic GC + memory monitoring (pairs with the health / gc tools) |
Environment variables
All optional — sensible defaults apply when unset.
| Variable | Default | Purpose |
|---|---|---|
| MALONG_STATE_DIR | ~/.config/malong | Where usage / feedback / edit-stats files are written; override for tests or sandboxed hosts |
| MALONG_SOCKET | /tmp/malong-parse-$(id -u).sock | Unix socket path to the parse daemon (Linux / macOS) |
| MALONG_PORT | 31001 | TCP port for the parse daemon (Windows) |
| MALONG_PARSE_BIN | bundled / PATH | Binary used when the client auto-starts the daemon |
| MALONG_PARSE_MODE | rust-service | Parse transport; only rust-service is supported in the current version |
| MALONG_WS_GC_DAYS | 14 | Days a workspace index cache may sit untouched before health cleanup prunes it; 0 disables |
| MALONG_INTERFACE | graph (Six-He line) | Default is the Six-He line: 13 tools (4 read entries + 8 stateful entries + edit_transaction); set classic for the full 44-tool catalog, diagnostic for the 18-tool analyzer tier |
| MALONG_ENTRY_STATE | on by default | The state layer is allowed by default (same as setting 1); set 0 to fall back to the read-only 5-tool tier |
| MALONG_PYTHON | (unset) | Interpreter used for Python test runs (test_bridge / verify_pipeline); when unset the project venv is auto-detected (.venv/venv/env next to the project root), then system python3 |
13 MCP tools by default (Six-He line); classic 44 / diagnostic 18 on demand
Every tool is pure regex / AST — zero LLM calls, reproducible, auditable, CI-friendly. Expand a group for per-tool descriptions.
I/O primitives 3 ▸
Index & search 5 ▸
Analysis 8 ▸
Editing & refactor 7 ▸
Quality & security 8 ▸
Engineering 8 ▸
Deps & system 5 ▸
Tool Routing Map (classic 44 · appendix)
The default tier is the Six-He line (13 entries: code_task → code_read → code_patch / code_batch / code_maintain → code_check → code_control); see the home page for the full loop. The four sequence diagrams and the T01–T44 index below cover the classic 44 catalog and are kept as a deep reference. On the default tier, action-map rewrites classic tool names in responses into callable graph calls.
Expand: classic 44 full routing diagrams (4) + T01–T44 index
Legend
Node index (T01–T44) (44)
Language support
Symbol-level read / write (read & write_symbol) supports 10 language families, with automatic syntax self-check after writes (node --check / py_compile).