Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

kb-mcp is configured via a collections.ron file that defines what markdown directories to index.

Config File

(
    // Optional: override cache directory (default: ~/.cache/kb-mcp)
    // cache_dir: "~/.cache/kb-mcp",
    collections: [
        (
            name: "docs",
            path: "docs",
            description: "Project documentation",
            writable: false,
            sections: [
                (prefix: "guides", description: "How-to guides"),
                (prefix: "reference", description: "API reference"),
            ],
        ),
        (
            name: "notes",
            path: "notes",
            description: "Working notes",
            writable: true,
            sections: [],
        ),
    ],
)

Fields

FieldTypeRequiredDescription
cache_dirStringNoCache directory for index files (default: ~/.cache/kb-mcp)
collectionsListYesOne or more collection definitions

Collection Fields

FieldTypeRequiredDescription
nameStringYesUnique identifier for the collection
pathStringYesDirectory path (relative to config file)
descriptionStringYesHuman-readable description
writableBoolNoAllow kb_write to create files (default: false)
sectionsListNoSection definitions for this collection

Section Fields

FieldTypeRequiredDescription
prefixStringYesDirectory prefix that identifies this section
descriptionStringYesHuman-readable description

Resolution Order

kb-mcp searches for configuration in this order:

  1. --config <path> CLI flag (explicit)
  2. KB_MCP_CONFIG environment variable
  3. ./collections.ron (current working directory)
  4. ~/.config/kb-mcp/collections.ron (user default)

Collection paths resolve relative to the config file’s parent directory.

Cross-Project Use

Install kb-mcp globally, then point other projects at a specific config:

{
  "mcpServers": {
    "kb": {
      "command": "kb-mcp",
      "env": {
        "KB_MCP_CONFIG": "/path/to/project/collections.ron"
      },
      "args": []
    }
  }
}