Docs
中文 EN

settings.json, Plugin Toggles & mcp.json

CONTENTS

Mizar parses config files with strict JSON (serde_json): UTF-8 BOM is stripped automatically, but JSONC comments and trailing commas are rejected. Syntax errors pinpoint file path and line number in the startup banner.

FIG 05 Four-Tier Config Precedence & Dual-Track Merge
PRECEDENCE CHAIN · LOWEST ─────────────────────────────▶ HIGHEST PRIORITY L1 Global LOW ~/.mizar/ Set via MIZAR_HOME settings · models · mcp defaultModel: "gpt-4o" L2 Workspace PROJECT <workspace>/.mizar/ Project-local overrides toolsPreset: "minimal" excludeTools: ["bash"] L3 Env Vars ENV Runtime Env Overrides API_KEY · MODEL · BASE_URL PROTOCOL · WORKSPACE MIZAR_SESSIONS_DIR L4 CLI Flags HIGH mizar [FLAGS] --minimal / --read-only -t / -xt / -C / --approve --no-persist / --inline Dual-Track Merge Dispatch Track A · Scalar Override LAST-WRITE-WINS L1 Global "gpt-4o" L2 Project "minimal" L3/L4 $MODEL Active Override Scalar fields: defaultModel · toolsPreset · maxSteps reasoningEffort · restrictToWorkspace · sessionsDir compaction · codemode · ui (/settings persisted) Track B · Union Append (Dedup) UNION APPEND L1: "mcp__prod__*" L2: "bash" L4: -xt "rm_*" Deduped Union · Additive ["mcp__prod__*", "bash", "rm_*"] Union fields: excludeTools (Global + Proj + -xt) skills.customDirs (Global + Project deduped) disabledPlugins (Global + Project sorted & deduped) Strict JSON Parsing (Validated at Startup) ✓ Strips UTF-8 BOM ✕ No JSONC / trailing commas Syntax errors report file path & line in top banner Merged config drives runtime defaults & safety rules Model Routing & Credential Resolution 1. Explicit API_KEY or keyless models.json → direct route 2. models.json resolves $VAR / ${VAR} / !command 3. Pass --provider mock for keyless demo (else error)
FIG 05: Four-tier config precedence — scalar fields use last-write-wins while list exclusions union-append cleanly.

Locations & Merge Semantics

Two on-disk scopes merge in ascending priority before env vars and CLI flags (both skipped under --isolated):

  1. Global: ~/.mizar/settings.json (overridable via MIZAR_HOME)
  2. Project: <workspace>/.mizar/settings.json
  3. Live Persistence: Toggling settings or plugins via /settings atomically patches settings.json.

Dual-track merge behavior:

  • Scalars & nested objects (defaultModel, compaction.triggerRatio, ui.theme): Project keys override global keys field by field.
  • Set/list fields: excludeTools, skills.customDirs, and disabledPlugins union-append and deduplicate, so project configs never silently erase global guardrails.

Complete settings.json Schema

All JSON keys use camelCase:

Top-Level Fields

KeyTypeDefaultDescription
defaultProviderstringnullDefault provider ID (built-in or models.json key)
defaultModelstringnullDefault model ID
reasoningEffortstringnullDefault effort (alias defaultThinkingLevel): off..max
maxStepsnumbernull (unlimited)Max tool steps per turn
personalitystringnullOptional communication style inserted after identity (omitted/blank = 0 bytes)
toolsPresetstring"minimal"Preset: "minimal" | "minimal-coding" | "all" | "read-only" | "readonly"
toolsstring[]nullExplicit tool allowlist (same as --tools)
excludeToolsstring[][]Glob patterns forced to Hidden (union-merged across layers)
disabledPluginsstring[][]Cordis module or host extension IDs to disable (sorted/deduped union)
restrictToWorkspacebooleanfalseScope built-in file tools to canonical workspace tree (does NOT restrict bash)
sessionsDirstring~/.mizar/sessionsJSONL sessions directory; "none", "off", or "memory" disables disk persistence

codemode — On-Demand QuickJS Sandbox

codemode stays dormant by default and activates on demand when --tools codemode, codemode.enabled: true, codemode.onlyMode: true, or an enabled MCP server / toolExposure uses codemode. Set enabled: false, or add "codemode" to disabledPlugins / excludeTools, to disable it completely:

KeyTypeDefaultDescription
codemode.enabledbooleannull (on-demand)Explicit opt-in (true) or opt-out (false); defaults to onlyMode or static MCP config
codemode.onlyModebooleanfalseHide Direct coding schemas from model so all tool calls go through codemode JS
codemode.inlineBudgetnumber3000Max inline character budget for tool synopsis descriptions
codemode.timeoutMsnumber120000QuickJS execution timeout in milliseconds

toolSearch — MCP BM25 Lazy Discovery

KeyTypeDefaultDescription
toolSearch.autoEnablebooleantrueAuto-enable tool_search when external Codemode / Deferred MCP tools exist
toolSearch.defaultLimitnumber8Default max hits returned per BM25 search

skills — Progressive Skill Discovery

KeyTypeDefaultDescription
skills.enabledbooleantrueEnable SKILL.md scanning, <available_skills> injection (when read/bash declared), and /<name> expansion
skills.customDirsstring[][]Additional skill root directories (union-merged)
skills.bundledDirstringnullOverride bundled skills directory path
skills.catalogDescriptionMaxLengthnumber500Max chars per skill description in catalog

instructions — Startup-Static Instructions

KeyTypeDefaultDescription
instructions.enabledbooleantrueEnable startup AGENTS.md / CLAUDE.md injection
instructions.candidatesstring[]["AGENTS.md", "CLAUDE.md"]Primary instruction filenames
instructions.localCandidatesstring[]["AGENTS.local.md", "CLAUDE.local.md"]Local override filenames
instructions.projectRootMarkersstring[][".git"]Ancestor walk boundary markers
instructions.maxBytesnumber65536Total byte cap across all loaded instruction files (evicts furthest ancestors first)
instructions.maxSourceBytesnumber1048576Max bytes read from any single instruction file (1 MiB)

compaction — Hot-Cache-Aware Tail Pruning & B-5 Compaction

KeyTypeDefaultDescription
compaction.enabledbooleantrueEnable compaction runtime and FileGuardTracker
compaction.autoCompactbooleantrueAutomatically summarize when usage crosses trigger threshold
compaction.defaultContextWindownumber128000Default context window fallback when catalog, env var, and CLI override are unset
compaction.maxContextTokensnumbernullOptional ceiling capping computed effective_window
compaction.triggerRationumber0.80Fraction of effective_window that triggers auto-compaction
compaction.keepRecentTokensnumber20000Minimum recent context tokens preserved verbatim across compaction
compaction.supersedeReadsbooleantrueTail-prune older read outputs superseded by a full re-read (protects hot cache & 8k suffix)
compaction.dropUselessbooleantrueTail-prune zero-hit noise outputs (always protects SKILL.md reads, hot cache, and 8k suffix)

sessionTitle & ui

KeyTypeDefaultDescription
sessionTitle.enabledbooleantrueEnable async background session title generation
sessionTitle.modelstringnullDedicated model ID for title generation (defaults to active session route)
sessionTitle.thinkingLevelstring"low"Thinking level used when generating titles (falls back to "low")
ui.themestring"auto"Active TUI theme
ui.screenModestring"fullscreen"Launch viewport: "fullscreen" | "inline"
ui.showThinkingbooleantrueExpand reasoning blocks by default (Ctrl+O)
ui.verboseExpandedbooleanfalseRender tiered tool arguments, outputs, and diff previews in transcript (toggled via /settings)
ui.sidePanelOpenbooleanfalseOpen split side panel on startup when terminal is wide enough
ui.mouseCapturebooleantrue (Fullscreen)Enable mouse capture (false by default in Inline mode)
ui.approvalModestring"auto"Default mutating tool gate: "auto" | "ask"
~/.mizar/settings.json (Recommended Developer Baseline)
{
  "defaultProvider": "deepseek",
  "defaultModel": "deepseek-chat",
  "restrictToWorkspace": true,
  "codemode": {
    "timeoutMs": 120000
  },
  "compaction": {
    "triggerRatio": 0.80,
    "keepRecentTokens": 20000,
    "supersedeReads": true,
    "dropUseless": true
  },
  "ui": {
    "theme": "auto",
    "approvalMode": "ask"
  }
}

Complete disabledPlugins IDs

1. Optional Built-In Cordis Modules (12 IDs)

Can be toggled at startup via settings.json or live in /settings:

compaction, tool-time, tool-fs, tools-coding, tool-search, codemode, mcp, skills, instructions, session-title, trajectory, repeat-guard

2. Official Host & TUI Extension IDs (10 KNOWN_HOST_EXTENSION_IDS)

Controlled by mizar-client and mizar-tui ("tui" cascades to all tui-* UI features and refuses to enter terminal raw mode):

file-mentions, local-bash, approval-gate, tui, tui-emphasis, tui-side-panel, tui-timeline-rail, tui-trajectory-view, tui-selection, tui-clipboard

3. Protected Core Services (6 IDs — Cannot Be Disabled)

Protected by Gate 2 inside SpinePlugins:

llm, sessions, tools, systemPrompt, agentLoop, spinePlugins

Complete mcp.json Schema

Loads ~/.mizar/mcp.json and <workspace>/.mizar/mcp.json. Workspace entries that omit both command and url merge as partial overrides (enabled, exposure, toolExposure, etc.) on top of matching global entries.

KeyTypeDefaultDescription
autoEnableCodemodebooleantrueTop-level toggle: auto-activates codemode when any enabled server or override uses codemode
mcpServers.<name>.commandstringnullStdio executable path/name (mutually exclusive with url)
mcpServers.<name>.argsstring[][]Stdio CLI arguments
mcpServers.<name>.envRecord<string, string>{}Environment variables passed to stdio child
mcpServers.<name>.cwdstringnullWorking directory for stdio child
mcpServers.<name>.urlstringnullStreamable HTTP / SSE server endpoint URL
mcpServers.<name>.headersRecord<string, string>{}Extra HTTP headers (e.g. Authorization)
mcpServers.<name>.enabledbooleantrueConnect and register tools from this server
mcpServers.<name>.exposure"codemode" | "deferred" | "direct" | "hidden""codemode"Server-wide default exposure tier
mcpServers.<name>.toolExposureRecord<string, Exposure>{}Per-tool or glob override (longest specific match wins)
mcpServers.<name>.descriptionstringnullHuman-readable note
mcpServers.<name>.timeoutMsnumbernullPer-call RPC timeout in milliseconds
.mizar/mcp.json (Stdio & HTTP Examples)
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..." },
      "exposure": "codemode",
      "toolExposure": {
        "delete_*": "hidden",
        "search_code": "direct"
      }
    },
    "docs": {
      "url": "https://docs.example.com/mcp",
      "headers": { "Authorization": "Bearer ${DOCS_TOKEN}" },
      "exposure": "deferred",
      "timeoutMs": 30000
    }
  }
}

Search Mizar Docs