Knowledge that works offline.
OpenZIM MCP gives any AI model structured, secure access to ZIM archives — Wikipedia, MedlinePlus, the Stack Exchange dumps — without an internet connection.
uv tool install openzim-mcp - v2.5.1Latest release
- 1 + 8Simple / advanced tools
- 80%+Test coverage
- MITLicense
An MCP server for offline knowledge.
ZIM archives package Wikipedia, Project Gutenberg, MedlinePlus, the Stack Exchange network, and more into self-contained files you can carry on a USB stick. OpenZIM MCP is the Model Context Protocol server that turns those static files into intelligent, structured access for any LLM client — Claude Desktop, Cursor, Cline, or your own.
-
Offline
No network round-trips. The whole archive — every article, every link — sits on disk and stays accessible whether the network is up or down.
-
Secure
Path-traversal protection, sanitized error messages, bearer-token auth on HTTP, multi-arch container running as non-root.
-
Structured
Search, browse, summarize, traverse — one intelligent NL tool by default, or 8 specialized tools in advanced mode, designed for how LLMs actually consume knowledge.
- 0Known CVEs
- 80%+Test coverage
- 100%Type-annotated
Eight tools. Same surface area.
v2 collapses the 22-tool advanced mode into 8 consolidated tools — schema text drops from ~36KB to ~23.5KB, clearing the MCP Tax pain band for small-model dispatch.
-
8-tool advanced surface
zim_query,zim_search,zim_get,zim_get_section,zim_browse,zim_metadata,zim_links,zim_health. Every v1 operation still reachable via a mode parameter.{ "name": "zim_search", "arguments": { "zim_file_path": "wiki.zim", "query": "evolution", "mode": "fulltext" } } -
Simple mode unchanged
The natural-language
zim_querytool is identical to v1.2.0. Small-model clients see one tool; large-model clients can opt into the 8-tool surface with--mode advanced.openzim-mcp /data/zim/ # simple mode (default): one tool openzim-mcp --mode advanced /data/zim/ # advanced mode: 8 tools -
Dispatch quality validated
300-probe dispatch eval on Qwen-2.5-7B-Instruct (small-model deployment target). Gate decision baked into the release; drift between gate output and shipped constants is caught by a consistency test in CI.
tests/dispatch_eval/gate_0b_decision.json tests/test_phase_f_gate_decision_consistency.py -
Presets, links & health
Archive-type presets auto-tune retrieval per source (Stack Exchange dumps render as clean Q&A, not vote-score noise). Inbound link discovery answers "what links here." And
zim_health(zim_file_path=…)validates an archive (Archive.check()+ checksum), with identity and index introspection inzim_metadata.{ "name": "zim_health", "arguments": { "zim_file_path": "wiki.zim" } }
Three steps to a knowledge engine.
- 1
Install
uv tool install openzim-mcpdocker pull ghcr.io/cameronrye/openzim-mcp:2.5.1git clone https://github.com/cameronrye/openzim-mcp.git cd openzim-mcp uv sync - 2
Get a ZIM
Download an archive from the Kiwix library ↗.
mkdir ~/zim-files && cd ~/zim-files # place .zim files here - 3
Run it
uv run openzim-mcp ~/zim-filesOr as an HTTP service:
OPENZIM_MCP_AUTH_TOKEN=$TOKEN openzim-mcp --transport http --host 0.0.0.0 ~/zim-files
See it in action
Request
{
"name": "zim_query",
"arguments": {
"query": "summarize the article on Photosynthesis"
}
} Response
## Photosynthesis
Photosynthesis is the process by which
plants and other organisms convert light
energy into chemical energy that drives
the conversion of carbon dioxide and water
into glucose and oxygen.
The process consists of two main stages:
the light-dependent reactions and the
Calvin cycle (light-independent reactions). Request
{
"name": "zim_search",
"arguments": {
"zim_file_path": "wikipedia_en.zim",
"query": "artificial intelligence",
"mode": "fulltext",
"limit": 5
}
} Response
Found 42 matches, showing 1-5:
## 1. Artificial Intelligence
Path: C/Artificial_intelligence
Snippet: Artificial intelligence (AI) is
intelligence demonstrated by machines...
## 2. Machine Learning
Path: C/Machine_learning
Snippet: Machine learning is a subset of
artificial intelligence... Request
{
"name": "zim_browse",
"arguments": {
"zim_file_path": "wikipedia_en.zim",
"namespace": "C",
"mode": "page",
"limit": 10
}
} Response
{
"namespace": "C",
"total_in_namespace": 80000,
"returned_count": 10,
"has_more": true,
"entries": [
{ "path": "C/Biology",
"title": "Biology",
"preview": "Biology is the scientific
study of life..." }
]
} Subscribe
{
"method": "resources/subscribe",
"params": { "uri": "zim://files" }
} Notification (when archive changes)
{
"method": "notifications/resources/updated",
"params": { "uri": "zim://files" }
} Documentation & resources.
-
API Reference
Every MCP tool with parameters, response schema, and intent examples.
-
HTTP & Docker Deployment
Streamable HTTP, Docker, reverse proxies, auth tokens, multi-arch images.
-
Architecture
Modules, mixins, the
zim/package split, dependency injection. -
Configuration
Environment variables, cache tuning, content limits, logging levels.
-
Troubleshooting
Common failures, error-message decoder, performance hints.
-
Contributing
Local setup, Makefile workflow, test structure, PR conventions.