Architecture
Run Without Installing
Global Options
These options apply to every command.| Flag | Description | Default |
|---|---|---|
-c, --config <PATH> | Explicit config file path | Auto-resolved |
--log-level <level> | debug, info, warn, or error | info |
--log-format <format> | json or pretty | pretty |
-h, --help | Show help | — |
-v, --version | Print version | — |
--config is omitted):
SDL_CONFIGenvironment variable (orSDL_CONFIG_PATH)- Local config in the current working directory (
./config/sdlmcp.config.json) - Global config path (default user-level location; overridable via
SDL_CONFIG_HOME) - Package-local fallback (
<sdl-mcp package root>/config/sdlmcp.config.json)
Commands
sdl-mcp init — Bootstrap config and optionally auto-index
sdl-mcp init — Bootstrap config and optionally auto-index
| Flag | Type | Description | Default |
|---|---|---|---|
--client <name> | string | Target MCP client: claude-code, codex, gemini, opencode | — |
--repo-path <PATH> | string | Path to repository root | Current directory |
--languages <list> | string | Comma-separated language codes: ts, tsx, js, jsx, py, go, java, cs, c, cpp, php, rs, kt, sh | Auto-detected |
-f, --force | boolean | Overwrite existing config | false |
-y, --yes | boolean | Non-interactive mode with repo/language auto-detection | false |
--auto-index | boolean | Run inline incremental index and doctor checks after init | false (enabled when -y is set) |
--dry-run | boolean | Print generated config without writing files | false |
--enforce-agent-tools | boolean | Generate SDL-first enforcement assets for the chosen client (hooks, instructions, plugin) | false |
ts, tsx, js, jsx (TypeScript/JavaScript) · py (Python) · go (Go) · java (Java) · cs (C#) · c, cpp (C/C++) · php (PHP) · rs (Rust) · kt (Kotlin) · sh (Shell)Examplesinit writes:config/sdlmcp.config.json— main SDL-MCP configuration<client>-mcp-config.json— client-specific MCP server registration (when--clientis set)AGENTS.md/CLAUDE.md/CODEX.mdetc. — agent instruction files (when--enforce-agent-tools).claude/hooks/,.claude/settings.json,.opencode/plugins/— runtime enforcement assets (client-specific)
init without --auto-indexsdl-mcp doctor — Validate runtime and environment
sdl-mcp doctor — Validate runtime and environment
| Check | What it validates |
|---|---|
| Node.js version | Node.js >= required minimum version |
| Config file exists | Config file is present at resolved path |
| Config file readable | Config file can be read by the current user |
| Tree-sitter grammars | All grammar binaries load without error |
| Repo paths accessible | Every configured rootPath exists on disk |
| Stale index detection | All repos indexed within the last 24 hours |
| Watcher health telemetry | Active file watchers are not stale or errored |
| Live index runtime | Live indexing coordinator is healthy |
| Call resolution capabilities | Pass-2 resolvers and call-edge metadata |
| Graph database (Ladybug) | DB opens, symbols and edges are queryable |
| DB extension capabilities | fts and vector extensions loaded |
| Semantic embedding models | onnxruntime-node, tokenizers, and model files |
| Runtime execution | Allowed runtimes are detectable on the system |
sdl-mcp index — Index repositories into the symbol graph
sdl-mcp index — Index repositories into the symbol graph
| Flag | Type | Description | Default |
|---|---|---|---|
--repo-id <ID> | string | Index only this repository | All configured repos |
-w, --watch | boolean | Stay running and watch for file changes | false |
-f, --force | boolean | Force full re-index (instead of incremental) | false |
sdl-mcp serve --http) is already running on the same database, sdl-mcp index automatically delegates to it. The --watch flag is ignored in delegation mode — the server manages its own file watchers.sdl-mcp serve — Start the MCP server
sdl-mcp serve — Start the MCP server
| Flag | Type | Description | Default |
|---|---|---|---|
--stdio | boolean | Use stdio transport | — |
--http | boolean | Use HTTP transport | — |
--host <HOST> | string | HTTP bind address | localhost |
--port <NUMBER> | number | HTTP port | 3000 |
--no-watch | boolean | Disable file watchers even when enabled in config | false |
--http, additional REST endpoints and a Graph UI are available:| Surface | Path |
|---|---|
| Graph UI | http://<host>:<port>/ui/graph |
| Symbol neighborhood | /api/graph/:repoId/symbol/:symbolId/neighborhood |
| Blast radius | /api/graph/:repoId/blast-radius/:fromVersion/:toVersion |
| Graph slice | /api/graph/:repoId/slice/:handle |
| Symbol search | /api/symbol/:repoId/search |
| Symbol card | /api/symbol/:repoId/card/:symbolId |
| Repo status | /api/repo/:repoId/status |
| Trigger re-index | /api/repo/:repoId/reindex |
sdl-mcp tool — Access all MCP tool actions directly
sdl-mcp tool — Access all MCP tool actions directly
sdl-mcp info — Runtime diagnostics
sdl-mcp info — Runtime diagnostics
| Flag | Type | Description |
|---|---|---|
--json | boolean | Output report as JSON |
- Version — SDL-MCP package version
- Runtime — Node.js version, platform, architecture
- Config — Resolved config path, whether it exists and loaded successfully
- Logging — Active log file path, whether console mirroring is enabled, whether temp-file fallback is in use
- Ladybug — Graph database availability and active DB path
- Native addon — Rust indexer availability, source path, and fallback reason
- Warnings / Misconfigurations — Any detected issues
sdl-mcp summary — Generate context summaries
sdl-mcp summary — Generate context summaries
| Flag | Type | Description | Default |
|---|---|---|---|
--budget <NUMBER> | number | Token budget for the summary | 2000 |
--short | boolean | Shorthand for a small token budget | — |
--medium | boolean | Shorthand for a medium token budget | — |
--long | boolean | Shorthand for a large token budget | — |
--format <format> | string | markdown, json, or clipboard | markdown |
--scope <scope> | string | symbol, file, or task (auto-detected from query if omitted) | Auto |
--repo <ID> | string | Repository ID | Auto-resolved from cwd |
-o, --output <PATH> | string | Write output to file instead of stdout | — |
sdl-mcp health — Composite repository health score
sdl-mcp health — Composite repository health score
| Flag | Type | Description |
|---|---|---|
--repo-id <ID> | string | Repository to evaluate (defaults to first configured repo) |
--json | boolean | Output full health snapshot as JSON |
--badge | boolean | Output Shields.io-compatible badge JSON |
| Component | Description |
|---|---|
| Freshness | How recently the repo was indexed |
| Coverage | Ratio of indexed symbols to total detected symbols |
| Error Rate | Proportion of files that failed during indexing |
| Edge Quality | Quality of dependency edges in the graph |
--badge)sdl-mcp benchmark:ci — CI regression benchmarks
sdl-mcp benchmark:ci — CI regression benchmarks
| Flag | Type | Description | Default |
|---|---|---|---|
--repo-id <ID> | string | Repository to benchmark | First configured repo |
--baseline-path <PATH> | string | Path to baseline JSON file | .benchmark/baseline.json |
--threshold-path <PATH> | string | Path to threshold config | config/benchmark.config.json |
--out <PATH> | string | Output path for results JSON | .benchmark/latest.json |
--json | boolean | Also print full results JSON to stdout | false |
--update-baseline | boolean | Update the baseline file with current results | false |
--skip-indexing | boolean | Skip the indexing step (use existing indexed data) | false |
| Category | Metrics |
|---|---|
| Indexing | Time per file, time per symbol |
| Quality | Symbols per file, edges per symbol, graph connectivity, exported symbol ratio |
| Performance | Slice build time, skeleton generation time |
| Token efficiency | Average card tokens, average skeleton tokens |
| Coverage | Call edge count, import edge count |
| Phase A | Summary generation time, summary tokens, health score, watcher events |
| Phase B (Edge Accuracy) | Per-language precision, recall, F1 score, strategy accuracy |
- Edge-accuracy regression checks compare against
scripts/benchmark/edge-accuracy-baseline.json - Benchmark repo scope can be pinned via
scripts/benchmark/phase-a-benchmark-lock.json - Exits with code
1if any threshold or edge-accuracy gate fails
sdl-mcp export — Export a sync artifact
sdl-mcp export — Export a sync artifact
.sdl-artifact.json). Artifacts contain full repository state and can be imported into another environment.Syntax| Flag | Type | Description | Default |
|---|---|---|---|
--repo-id <ID> | string | Repository to export | First configured repo |
--version-id <ID> | string | Specific version to export | Latest |
--commit-sha <SHA> | string | Export the version matching this commit SHA | — |
--branch <NAME> | string | Export the version for this branch | — |
-o, --output <PATH> | string | Output directory | .sdl-sync/ |
--list | boolean | List existing artifacts instead of exporting | false |
sdl-mcp import — Import a sync artifact
sdl-mcp import — Import a sync artifact
| Flag | Type | Description | Default |
|---|---|---|---|
--artifact-path <PATH> | string | Path to the .sdl-artifact.json file (required) | — |
--repo-id <ID> | string | Target repository ID | First configured repo |
-f, --force | boolean | Overwrite existing data | false |
--verify | boolean | Verify artifact integrity before import | true |
sdl-mcp pull — Pull by version or commit with fallback
sdl-mcp pull — Pull by version or commit with fallback
| Flag | Type | Description | Default |
|---|---|---|---|
--repo-id <ID> | string | Repository to pull | First configured repo |
--version-id <ID> | string | Target version ID | Latest |
--commit-sha <SHA> | string | Pull the version matching this commit SHA | — |
--fallback | boolean | Fall back to full re-index if no artifact found | true |
--retries <NUMBER> | number | Number of retry attempts | 3 |
sdl-mcp version — Show version and environment
sdl-mcp version — Show version and environment
sdl-mcp info instead.Typical Workflows
- Local Setup
- CI Data Sync
- One-liner (npx)