kiwix-mcp
This server lets you browse, search, and read content from a Kiwix ZIM library.
List books: List available ZIM books, optionally filtering by title keyword.
Search: Run full-text search across all books or a specific book, with pagination via
start, returning article titles, snippets, and URLs.Fetch articles: Retrieve a full article by URL and return it as plain text.
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 "Deploy 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-mcp search 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
Related MCP server: openzim-mcp
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 --transport http kiwix https://your-kiwix-mcp-host/mcp/SSE
kiwix-mcp --transport sse --base-url http://localhost:8080Then point your MCP client at http://localhost:8000/sse.
HTTP (streamable)
kiwix-mcp --transport streamable-http --base-url http://localhost:8080Then point your MCP client at http://localhost:8000/mcp.
CORS (browser-based clients)
When using HTTP transports with browser-based MCP clients (e.g. llama-server WebUI), CORS headers are added automatically. By default all origins are allowed.
To restrict allowed origins:
kiwix-mcp --transport streamable-http --base-url http://localhost:8080 \
--cors-allow-origins "http://localhost:3000,http://myapp.example.com"
# or
CORS_ALLOW_ORIGINS="http://localhost:3000" kiwix-mcp --transport streamable-http --base-url http://localhost:8080CORS has no effect on stdio transport.
Docker
Multi-arch images (amd64, arm64) are published to GitHub Container Registry on each release, tagged with the release version (e.g. 1.5.2) and latest.
docker run -e KIWIX_BASE_URL=http://your-kiwix-server:8080 \
-p 8000:8000 \
ghcr.io/oscillatelabsllc/kiwix-mcpDefaults to streamable-http transport bound on 0.0.0.0:8000. Override with env vars:
docker run \
-e KIWIX_BASE_URL=http://your-kiwix-server:8080 \
-e TRANSPORT=sse \
-e HOST=0.0.0.0 \
-e PORT=8000 \
-e CORS_ALLOW_ORIGINS="http://localhost:3000" \
-p 8000:8000 \
ghcr.io/oscillatelabsllc/kiwix-mcpOptions
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)
pytestAvailable Tools
3 toolskiwix_fetch_articleA
Fetch an article from the Kiwix server and return its content as plain text. Use the URL field from kiwix_search results.
Inputs: url (required). Returns: result
kiwix_list_booksA
List ZIM books available on the Kiwix server. Optionally filter by title keyword.
Inputs: query. Returns: result
kiwix_searchA
Full-text search across Kiwix ZIM books. Returns article titles, snippets, and URLs. Use kiwix_fetch_article to retrieve full content.
Inputs: query (required), book, start. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct purpose: listing books, full-text search, and fetching articles. No overlap in functionality.
All tools share the 'kiwix_' prefix and follow a verb_noun pattern (list_books, search, fetch_article), ensuring predictable naming.
With only 3 tools, the set is minimal but covers the core read-only workflow for a Kiwix ZIM server. Slightly low but not deficient.
The tools cover the essential operations: listing available books, searching within them, and retrieving full articles. Missing book metadata or browsing, but acceptable for a basic reader.
Maintenance
Related MCP Connectors
MCP server for Project Gutenberg: 78,000+ public-domain ebooks with full plain-text retrieval.
Read-only MCP server exposing a user ORANO library to their own AI agent.
An MCP server that provides tools to discover and retrieve podcast episodes transcripts.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that provides offline access to ZIM file archives, including Wikipedia, medical knowledge, and maps. It dynamically exposes tools like search, article retrieval, and driving route planning based on available ZIM files.4MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for reading and searching ZIM archives, optimized for single-user deployments with a persistent Wikipedia archive.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for searching and reading Wikipedia articles, including summaries, full text, targeted sections, nearby pages, and language editions.696 npm6Apache 2.0
- AlicenseNot gradedqualityBmaintenanceOpenZIM MCP Server provides AI models structured, offline access to ZIM format knowledge archives (Wikipedia, Wiktionary, Stack Exchange, Kiwix Library) via a Model Context Protocol server with smart namespace navigation, full-text search with suggestions, structure-aware retrieval (sections, tables of contents, related articles), link-graph extraction, archive-type presets, and both Simple (single natural-language tool) and Advanced (8 specialized tools) modes with streamable HTTP transport, bearer auth, and per-entry resources with subscriptions.MIT