Config file location
SDL-MCP resolves the config file in the following order (highest precedence first):Resolution precedence
Resolution precedence
| Priority | Method | Details |
|---|---|---|
| 1 | --config <PATH> CLI flag | Passed to any command |
| 2 | SDL_CONFIG or SDL_CONFIG_PATH env var | Full path to config file |
| 3 | SDL_CONFIG_HOME env var | Directory; SDL-MCP looks for sdlmcp.config.json inside |
| 4 | OS config directory | Platform default (~/.config/sdl-mcp/ on Linux/macOS) |
sdl-mcp init command creates a config file interactively. You can also start from the example file in config/sdlmcp.config.example.json.
Minimal required config
Only two top-level fields are required. Everything else has sensible defaults:graphDatabase.path is omitted, SDL-MCP defaults to <configDir>/sdl-mcp-graph.lbug.Field reference
repos[] — repositories to index
repos[] — repositories to index
sdl.symbol.search({ repoId: "my-repo" })). Must be unique across all registered repos.["**/node_modules/**", "**/dist/**", "**/.next/**", "**/build/**", "**/.git/**", "**/coverage/**"]ts, tsx, js, jsx, py, go, java, cs, c, cpp, php, rs, kt, sh@types/* declarations from node_modules for TypeScript call resolution. Excludes @types/node. Disable for non-TypeScript repos or if indexing is slow.package.json location. Useful for monorepos with custom layouts.tsconfig.json. Useful for monorepos with multiple tsconfigs.package.json files in monorepos.Example: ["packages/*/package.json", "apps/*/package.json"]graphDatabase — Ladybug database storage
graphDatabase — Ladybug database storage
${ENV_VAR} expansion inside values..lbug database file. Defaults to <configDir>/sdl-mcp-graph.lbug when omitted.Supports environment variable expansion: use ${SDL_GRAPH_DB_PATH} for an explicit file path, or ${SDL_GRAPH_DB_DIR} to point at a directory and let SDL-MCP place sdl-mcp-graph.lbug inside it.policy — proof-of-need gating for code access
policy — proof-of-need gating for code access
sdl.code.needWindow. Requests exceeding maxWindowLines or maxWindowTokens are silently clamped, not rejected. Policy can also be changed at runtime via sdl.policy.set.sdl.code.needWindow request. Minimum: 1. Requests above this are clamped.sdl.code.needWindow request. Minimum: 1. Requests above this are clamped.identifiersToFind in sdl.code.needWindow calls. Enforces proof-of-need: agents must specify what they’re looking for.needWindow to proof-of-need gating.{ "maxCards": 60, "maxEstimatedTokens": 12000 }minCallConfidence used in symbol.getCard and slice.build call-edge filtering. Range: 0.0–1.0. Leave unset to keep call-edge filtering request-driven only.redaction — sensitive data masking
redaction — sensitive data masking
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Label for documentation and logging |
pattern | string | Yes | Regex pattern to match |
flags | string | No | Regex flags (e.g., "gi") |
indexing — indexer configuration
indexing — indexer configuration
"rust" (native addon, faster) or "typescript" (fallback). Falls back to TypeScript automatically if the native addon is unavailable.sdl-mcp serve. Disable in CI or batch-only workflows.liveIndex — live editor buffer overlay
liveIndex — live editor buffer overlay
slice — graph slice budget and traversal
slice — graph slice budget and traversal
sdl.slice.build). Per-call budget parameters override these defaults.sdl.slice.build call. Minimum: 1.semantic — embeddings, semantic search, and LLM summaries
semantic — embeddings, semantic search, and LLM summaries
sdl.symbol.search when semantic: true is passed. When enabled, lexical results are reranked by embedding similarity."local" (onnxruntime-node, works offline), "api" (remote), "mock" (deterministic, for testing)."api" and "local" providers. Also supported: "nomic-embed-text-v1.5".summaryApiKey or the ANTHROPIC_API_KEY environment variable. Summaries are cached as SummaryCache graph nodes in the database."api" (Anthropic), "local" (OpenAI-compatible, e.g., Ollama), "mock" (deterministic). Defaults to the provider value when unset."api" uses "claude-haiku-4-5-20251001", "local" uses "gpt-4o-mini".ANTHROPIC_API_KEY environment variable when unset."http://localhost:11434/v1" for Ollama. Uses the Anthropic API when unset.retrieval.fusion.rrfK instead. Legacy lexical/semantic blend ratio (0.0 = pure lexical, 1.0 = pure semantic). Still honored in "legacy" retrieval mode; ignored when retrieval.mode is "hybrid".semantic.retrieval — hybrid retrieval pipeline
Replaces legacy alpha-blending with a two-stage FTS + vector search pipeline fused via Reciprocal Rank Fusion (RRF)."legacy" (original semantic re-rank) or "hybrid" (FTS + vector fusion pipeline). "hybrid" is recommended for best search quality.true, all query terms must match (AND). When false, any term matches (OR)."rrf" (Reciprocal Rank Fusion) is currently supported.prefetch — predictive background warming
prefetch — predictive background warming
sdl-mcp serve. Prefetch metrics are exposed in sdl.repo.status under prefetchStats.diagnostics — TypeScript/JavaScript error reporting
diagnostics — TypeScript/JavaScript error reporting
"tsLS" (TypeScript Language Service, faster) or "tsc" (compiler, more thorough)."changedFiles" (only files modified since last index, faster) or "workspace" (all files, more thorough but much slower on large repos).cache — in-memory LRU caches
cache — in-memory LRU caches
concurrency — session, tool, and DB connection limits
concurrency — session, tool, and DB connection limits
httpAuth — bearer-token authentication
httpAuth — bearer-token authentication
sdl-mcp serve --http). Has no effect on stdio transport./mcp and /api/* endpoints.null and enabled is true, a random token is generated at startup and printed to stderr.| Configuration | Behavior |
|---|---|
Omitted / { "enabled": false } | Auth disabled — all requests accepted without a token |
{ "enabled": true } | Random token generated at startup, printed to stderr |
{ "enabled": true, "token": "my-token" } | Static token — no random generation, token not printed |
plugins — adapter plugin loading
plugins — adapter plugin loading
false to disable all plugins without removing paths.gateway — namespace-scoped tool registration
gateway — namespace-scoped tool registration
sdl_repo, sdl_symbol, sdl_code, sdl_agent) plus sdl.action.search and sdl.info.false to reduce the tool list from 37 to 6 tools (gateway-only mode).codeMode — sdl.manual and sdl.chain tool chaining
codeMode — sdl.manual and sdl.chain tool chaining
sdl.manual and sdl.chain).sdl.action.search, sdl.manual, sdl.chain).true, suppresses gateway and legacy tools — only code-mode tools and discovery are registered. Set to false to expose the full tool surface alongside code-mode tools."off", "warn", "enforce". Use "enforce" to reject chains that skip context ladder rungs.ifNoneMatch ETags for repeated card requests within a chain to avoid resending unchanged cards.parallelScorer — worker-thread beam search acceleration
parallelScorer — worker-thread beam search acceleration
sdl.slice.build. Most useful for repos with more than 5,000 symbols and large slices.tracing — OpenTelemetry observability
tracing — OpenTelemetry observability
"console" (stdout), "otlp" (collector endpoint), "memory" (in-process).exporterType is "otlp".Example: "http://localhost:4318/v1/traces"runtime — sandboxed code execution
runtime — sandboxed code execution
sdl.runtime.execute).true to use sdl.runtime.execute.node, typescript, python, shell, ruby, php, perl, r, elixir, go, java, kotlin, rust, c, cpp, csharp (16 runtimes total).["bun", "deno"].["NODE_ENV", "DATABASE_URL"].security — access restrictions
security — access restrictions
sdl.repo.register. When non-empty, calls are rejected unless the rootPath starts with one of these prefixes. An empty array (default) allows any path.Environment variables
SDL-MCP expands${VAR_NAME} references inside JSON config values at load time.
| Variable | Description |
|---|---|
SDL_CONFIG / SDL_CONFIG_PATH | Full path to the config file |
SDL_CONFIG_HOME | Directory for default global config resolution |
SDL_GRAPH_DB_PATH | Override graph DB file path (takes precedence over config) |
SDL_GRAPH_DB_DIR | Directory-style override; SDL-MCP stores sdl-mcp-graph.lbug inside it |
SDL_DB_PATH | Legacy alias for graph DB path override (v0.7.x) |
SDL_LOG_FILE | Explicit log file path; falls back to an OS temp file if unusable |
SDL_LOG_LEVEL | Log level: debug, info, warn, error (case-insensitive) |
SDL_CONSOLE_LOGGING | Set to true to mirror log lines to stderr in addition to file logging |
SDL_LOG_FORMAT | Log format: json or text |
ANTHROPIC_API_KEY | Fallback API key for semantic.generateSummaries |
SDL_MCP_DISABLE_NATIVE_ADDON | Set to 1 to force the TypeScript fallback engine (skip native Rust addon) |
Common configuration profiles
Full annotated example
The following example shows every available option with its default value. JSON does not support comments — this is for reference only. Remove comments and unused fields before saving as your actual config file.Native Rust engine
The Rust indexer (defaultindexing.engine) replaces the TypeScript tree-sitter pass with a native addon for faster multi-threaded symbol extraction. It supports the same 14 file extensions as the TypeScript engine.
Prerequisites: Rust toolchain (rustc 1.70+, cargo) and @napi-rs/cli (installed as a dev dependency).
Build the native addon
native/ and produces a platform-specific .node file.Enable in config
"**/native/target/**" to your repo ignore patterns to exclude the Rust build directory from indexing.SDL_MCP_DISABLE_NATIVE_ADDON=1 to force the TypeScript fallback explicitly.Operational diagnostics
Runsdl-mcp info or call the sdl.info MCP tool to inspect the resolved runtime state. The report includes:
- Config path, existence, and load status
- Resolved log file path and whether temp-file fallback is active
- Whether
SDL_CONSOLE_LOGGINGis mirroring logs to stderr - Ladybug availability and active database path
- Native addon availability, source path, and fallback reason
sdl-mcp doctor to validate your config file and check environment health, including registered resolvers, call-edge metadata schema support, and minCallConfidence policy status.