MCP Server
kb-mcp runs as an MCP server when invoked with no arguments. It communicates over stdio using the JSON-RPC protocol.
Registration
Add to your project’s .mcp.json:
{
"mcpServers": {
"kb": {
"command": "kb-mcp",
"args": []
}
}
}
The binary must be in your PATH (install via just install-server or
cargo install --path crates/kb-mcp-server).
Startup
On startup, kb-mcp:
- Loads
collections.ron(see Configuration) - Scans all collection directories for
.mdfiles - Builds the BM25 search index in memory
- Starts the MCP stdio transport
Logs go to stderr. Startup typically takes <1s for ~200 documents.
Agent Workflow
A typical agent session:
- Call
list_sectionsto see what’s available - Call
searchto find relevant documents - Call
kb_contexton promising results to scan frontmatter + summary - Call
get_documentonly on documents worth reading in full - Call
kb_writeto capture new knowledge (writable collections only) - Call
reindexafter creating new files mid-session