llmwiki serve turns your compiled wiki into a live capability for AI agents. It starts an MCP (Model Context Protocol) server over stdio, exposing the full llmwiki pipeline as structured tools and read-only resources that any MCP-compatible client can call.
With the server running, an agent can ingest new sources, trigger a compile, query the wiki for grounded answers, retrieve citation-aware context packs, run quality checks, and read individual pages - all without touching the CLI or parsing terminal output. Read-only tools work immediately with no credentials; tools that call an LLM check for a configured provider on each invocation.
Syntax
Client configuration
To connect Claude Desktop, Cursor, or Claude Code, add llmwiki to your MCP client’s server configuration:claude_desktop_config.json. For Cursor, add it to your MCP settings file. The env block is where you supply your LLM provider credentials - the server process inherits them from there.
MCP tools
The server registers 11 tools. Read-only tools work without credentials; tools that invoke the LLM pipeline validate provider configuration on each call.get_context_pack vs. query_wiki
These two tools serve different purposes:
get_context_packpackages evidence. It assembles a structured pack of relevant pages, semantic chunks, graph neighbors, and citations for the agent to reason over directly. It doesn’t generate any prose.query_wikigenerates answers. It runs the full two-step retrieval and answer pipeline, returning a grounded natural-language response with citations.
get_context_pack when you want the agent to do its own reasoning with full source visibility. Use query_wiki when you want a ready-made answer.
includeSources opt-in
get_context_pack supports an includeSources: true parameter that materializes raw source text snippets alongside the primary page citations. This opt-in is disabled by default because it can return content from files under sources/.
sources/ directory, but only enable source windows for agents you trust with the ingested source text.
Checking the review queue
wiki_status includes a pendingCandidates field with the current count of pages waiting in the review queue. Agents can poll this field to decide whether to prompt the user to run llmwiki review list before continuing.
Importing OKF through MCP
import_okf is intentionally staging-only. Agents can preview a bundle with dryRun, or stage it for human review, but cannot bypass review and write imported knowledge directly into wiki/. Use llmwiki review list/show/approve to inspect and approve staged imports.
MCP resources
The server exposes 7 read-only resources under thellmwiki:// URI scheme. MCP clients can attach these as passive context without invoking a tool.
llmwiki next
When an agent needs to know what to do next but doesn’t want to parse terminal output, llmwiki next is the right tool:
llmwiki next reads the current project state - including the lint cache, pending source changes, and review queue depth - and recommends the single most useful next action. With --json, the output is a stable envelope with a command field, an args array, and a reason string, so an agent can execute the recommendation programmatically without parsing prose.
llmwiki next is read-only. It never modifies the workspace. It’s safe to call as a status check at any point in an agent workflow.For a full walkthrough of connecting llmwiki to Claude Desktop, Cursor, and Claude Code - including multi-project setups and agent workflow patterns - see the MCP Agent Integration guide.