Config File Location
SDL-MCP resolves the config path in this order:SDL_CONFIG environment variable
Set once; all SDL-MCP commands pick it up:
SDL_CONFIG_PATH is accepted as an alias.SDL_CONFIG_HOME environment variable
Points SDL-MCP at a directory; the filename
sdlmcp.config.json is appended automatically:OS default config directory
If none of the above are set, SDL-MCP writes and reads from the OS-standard user config directory.
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.
Full Annotated Config Example
This is the complete example config shipped with SDL-MCP (config/sdlmcp.config.example.json) with all defaults shown:
Config Sections
repos[] — Repositories to index
repos[] — Repositories to index
Each entry registers a codebase for indexing. You can index multiple repos in a single config.
Supported languages:
| Field | Type | Default | Description |
|---|---|---|---|
repoId | string | — | Required. Unique ID used in all MCP tool calls |
rootPath | string | — | Required. Absolute or relative path to repo root |
ignore | string[] | Common dirs | Glob patterns to exclude from indexing |
languages | string[] | All supported | File extensions to index |
maxFileBytes | integer | 2000000 (2 MB) | Files larger than this are skipped |
includeNodeModulesTypes | boolean | true | Index @types/* for TypeScript call resolution |
workspaceGlobs | string[] | null | Glob patterns for monorepo workspace package.json files |
packageJsonPath | string | Auto | Override package.json location |
tsconfigPath | string | Auto | Override tsconfig.json location |
ts, tsx, js, jsx, py, go, java, cs, c, cpp, php, rs, kt, shgraphDatabase — Database file location
graphDatabase — Database file location
Controls where SDL-MCP stores the Ladybug graph database. Supports If omitted, defaults to
${ENV_VAR} expansion.<configDir>/sdl-mcp-graph.lbug.| Field | Type | Default | Description |
|---|---|---|---|
path | string? | <configDir>/sdl-mcp-graph.lbug | Path to the Ladybug database file |
policy — Gated code access controls
policy — Gated code access controls
Controls the proof-of-need gating system for raw code access via
Recommended CI config (tighter limits to control token spend):
sdl.code.needWindow.| Field | Type | Default | Description |
|---|---|---|---|
maxWindowLines | integer | 180 | Max lines per raw code window (requests above this are clamped) |
maxWindowTokens | integer | 1400 | Max tokens per raw code window (requests above this are clamped) |
requireIdentifiers | boolean | true | Require non-empty identifiersToFind in needWindow calls |
allowBreakGlass | boolean | false | Allow emergency override of policy denials (logged in audit trail) |
defaultDenyRaw | boolean | true | Default deny for raw code — requires proof-of-need |
budgetCaps | object? | null | Optional server-side budget defaults: { maxCards, maxEstimatedTokens } |
defaultMinCallConfidence | number? | null | Default threshold for call-edge filtering (0.0–1.0) |
Requests exceeding
maxWindowLines or maxWindowTokens are silently clamped, not rejected. Policy can be changed at runtime via sdl.policy.set.semantic — Embedding search and LLM summaries
semantic — Embedding search and LLM summaries
Controls semantic search reranking, embedding generation, and LLM-powered symbol summaries.
See Semantic Setup for a full walkthrough of all providers.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable semantic reranking in symbol search |
provider | string | "local" | Embedding provider: "local" (ONNX), "api", or "mock" |
model | string | "all-MiniLM-L6-v2" | Embedding model. Also supports "nomic-embed-text-v1.5" |
generateSummaries | boolean | false | Generate LLM summaries during indexing |
summaryProvider | string? | null | Summary LLM: "api" (Anthropic), "local" (OpenAI-compatible), "mock" |
summaryModel | string? | null | LLM model for summaries (defaults per-provider) |
summaryApiKey | string? | null | API key (falls back to ANTHROPIC_API_KEY env var) |
summaryApiBaseUrl | string? | null | Base URL for OpenAI-compatible local providers |
summaryMaxConcurrency | integer | 5 | Max concurrent LLM requests (1–20) |
summaryBatchSize | integer | 20 | Symbols per LLM batch request (1–50) |
prefetch — Predictive background warming
prefetch — Predictive background warming
Enables background prefetch of likely-needed results during
Prefetch metrics are available in
sdl-mcp serve.| Field | Type | Default | Range | Description |
|---|---|---|---|---|
enabled | boolean | true | — | Toggle the prefetch queue |
maxBudgetPercent | integer | 20 | 1–100 | Resource cap as % of configured budget |
warmTopN | integer | 50 | min: 1 | Symbols warmed on server startup |
sdl.repo.status under prefetchStats (queue depth, hit/waste rates, latency reduction).Prefetch is disabled in CI and batch-only workflows. Enable it for long-running
serve sessions.concurrency — Session and tool limits
concurrency — Session and tool limits
Controls concurrency for sessions, tool dispatch, and database connections. Primarily relevant in HTTP (multi-agent) mode.
For multi-agent setups: Increase
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
maxSessions | integer | 8 | 1–16 | Max concurrent HTTP sessions |
maxToolConcurrency | integer | 8 | 1–32 | Max concurrent tool handler executions |
readPoolSize | integer | 4 | 1–8 | LadybugDB read connection pool size |
writeQueueTimeoutMs | integer | 30000 | 1000–120000 | Timeout for queued write operations (ms) |
toolQueueTimeoutMs | integer | 30000 | 5000–120000 | Timeout for queued tool invocations (ms) |
maxSessions up to 16. For resource-constrained systems: Lower maxToolConcurrency to 2–4.httpAuth — Bearer-token auth for HTTP transport
httpAuth — Bearer-token auth for HTTP transport
Enables bearer-token authentication when running
When Set a fixed token for shared dev servers or CI pipelines:Agents must include the token as
sdl-mcp serve --http. Has no effect on stdio transport.| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable auth (disabled by default) |
token | string? | null | Static bearer token. When null, a random token is generated at startup |
token is null, the generated token is printed to stderr on startup:Authorization: Bearer <token> in every request.indexing — Engine and performance
indexing — Engine and performance
Controls how and when source code is indexed.
Engine selection: The Rust engine is faster and is the default. If the native addon is unavailable (unsupported platform), SDL-MCP falls back to the TypeScript engine automatically. To force the TypeScript engine:The TypeScript engine uses tree-sitter grammars for AST parsing and works everywhere Node.js runs with no native build requirements.CI/batch mode recommendations:
| Field | Type | Default | Range | Description |
|---|---|---|---|---|
engine | string | "rust" | "rust" | "typescript" | Indexer implementation |
concurrency | integer | 8 | 1–10 | Concurrent file-processing workers |
enableFileWatching | boolean | true | — | Auto-reindex on file changes |
maxWatchedFiles | integer | 25000 | min: 1 | Cap on tracked files |
watchDebounceMs | integer | 300 | 50–5000 | Debounce delay for file watch events (ms) |
workerPoolSize | integer? | Auto | 1–16 | Override worker pool thread count |