Enables interaction with Kiwix HTTP servers to browse available ZIM library books, perform full-text searches across offline content, and retrieve articles as plain text.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kiwix-mcpsearch for 'quantum physics' in the Wikipedia book"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kiwix-mcp
MCP server and Python client library for Kiwix HTTP servers.
Compatibility
Tested against kiwix-tools (Debian bookworm package) and newer libkiwix-based deployments. Any standard kiwix-serve deployment should work.
Known quirks handled transparently:
kiwix-serve emits unescaped
&in OPDS cataloghrefattributesNewer servers require a book scope when the library spans multiple languages — the client returns a clear error with instructions in that case
Newer servers use a path-prefixed URL scheme (e.g.
/kiwix/content/book_slug) — slug and article URL handling adapts automatically
Tools
Tool | Description |
| List available ZIM books; optional title filter |
| Full-text search across all books or a specific book |
| Fetch an article as plain text by URL |
Installation
pip install kiwix-mcpOr with uv:
uv pip install kiwix-mcpUsage
stdio (Claude Desktop / Claude Code)
kiwix-mcp --base-url http://localhost:8080
# or
KIWIX_BASE_URL=http://localhost:8080 kiwix-mcpClaude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"kiwix": {
"command": "kiwix-mcp",
"args": ["--base-url", "http://localhost:8080"]
}
}
}Claude Code — add at user scope so it's available in all projects:
claude mcp add --scope user kiwix --transport sse http://localhost:7474/sseSSE
kiwix-mcp --transport sse --base-url http://localhost:8080Then point your MCP client at http://localhost:8080/sse.
HTTP (streamable)
kiwix-mcp --transport streamable-http --base-url http://localhost:8080Options
Flag | Default | Env |
| — |
|
|
| — |
Client library
from kiwix_client import KiwixClient, strip_html
c = KiwixClient("http://localhost:8080")
# List all books
books = c.list_books()
# Filter by title keyword
books = c.list_books(q="wikipedia")
# Search
sr = c.search("query")
# Search within a specific book
sr = c.search("query", books="devdocs_en_rust_2025-10")
# Fetch article as plain text
html = c.fetch_article(sr.results[0].url)
plain = strip_html(html)How the Kiwix API works
kiwix-serve exposes three HTTP surfaces used by this client:
OPDS catalog (
/catalog/v2/entries) — Atom XML with book metadata and slugs; supports?q=,?count=,?start=paramsFull-text search (
/search?pattern=…&books.name=…&start=…) — HTML; 25 results/page;books.name=scopes to a specific ZIM slugArticles (
/{book_slug}/A/{path}) — HTML; usestrip_htmlfor plain text
There is no JSON API. Full-text search requires ZIMs built with _ftindex:yes — not all ZIMs include it. Servers with books spanning multiple languages require a book scope for any search request.
Testing
# Install with dev dependencies
pip install -e ".[dev]"
# Run the test suite (no network required)
pytest