kiwix-mcp

kiwix-mcp

An MCP server that enables interaction with Kiwix HTTP servers to browse, search, and retrieve content from offline ZIM books like Wikipedia. It provides tools for listing available library resources and fetching full-text articles as plain text.

Category
Visit Server

README

kiwix-mcp

Status: Active Run Unit Tests

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 catalog href attributes
  • Newer 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
kiwix_list_books List available ZIM books; optional title filter
kiwix_search Full-text search across all books or a specific book
kiwix_fetch_article Fetch an article as plain text by URL

Installation

pip install kiwix-mcp

Or with uv:

uv pip install kiwix-mcp

Usage

stdio (Claude Desktop / Claude Code)

kiwix-mcp --base-url http://localhost:8080
# or
KIWIX_BASE_URL=http://localhost:8080 kiwix-mcp

Claude 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:8080

Then point your MCP client at http://localhost:8000/sse.

HTTP (streamable)

kiwix-mcp --transport streamable-http --base-url http://localhost:8080

Then point your MCP client at http://localhost:8000/mcp.

Docker

docker run -e KIWIX_BASE_URL=http://your-kiwix-server:8080 \
  -p 8000:8000 \
  oscillatelabs/kiwix-mcp

Defaults 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 \
  -p 8000:8000 \
  oscillatelabs/kiwix-mcp

Options

Flag Default Env
--base-url KIWIX_BASE_URL
--transport stdio TRANSPORT
--host 127.0.0.1 HOST
--port 8000 PORT

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= params
  • Full-text search (/search?pattern=…&books.name=…&start=…) — HTML; 25 results/page; books.name= scopes to a specific ZIM slug
  • Articles (/{book_slug}/A/{path}) — HTML; use strip_html for 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured