Kiwix MCP Server
This server provides offline access to Wikipedia and other ZIM-format content libraries through a local Kiwix instance, enabling AI models to retrieve encyclopedic information without an internet connection.
Search ZIM files (
search_zim): Perform keyword searches within specific ZIM files, with configurable result counts (default: 3).Search with snippets (
search_with_snippets): Search for articles and receive short ~200-character content previews to efficiently assess relevance before fetching full content — the most token-efficient exploration method.Retrieve full article content (
get_content): Fetch complete plain-text article body, with tables, navigation elements, citations, and low-value sections automatically stripped to reduce token usage.Retrieve article summaries (
get_content_summary): Get only the introductory paragraphs of an article (default: 2), offering a token-efficient alternative to full content retrieval.List available ZIM files (
list_all_zims): Discover all ZIM libraries currently loaded in your Kiwix instance (e.g., Wikipedia, Wiktionary), including their names, titles, and descriptions.Offline operation: Works entirely offline once ZIM files are loaded, with multi-ZIM support for accessing different content libraries.
Provides tools for searching and retrieving content from a local Kiwix server, enabling offline access to Wikipedia and other ZIM files through search, full article retrieval, and summaries.
Allows offline querying of Wikipedia content via a local Kiwix server, with capabilities including search, full article retrieval, and token-efficient summaries.
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 MCP ServerGet me a summary of the article about the Moon"
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.
Offline Kiwix Wikipedia MCP Server
An MCP (Model Context Protocol) server that provides offline access to Wikipedia and other ZIM content through a local Kiwix instance.
Overview
This MCP server bridges AI language models (like those in LM Studio) with your local Kiwix server, enabling:
Offline Wikipedia searches — No internet required once ZIM files are loaded
Multi-ZIM support — Access Wikipedia, Wiktionary, and other ZIM libraries
Token-efficient summaries — Get just the intro paragraphs to conserve context window
Full article retrieval — Pull complete article text when needed
Related MCP server: Kiwix Wiki MCP Server
Features
Feature | Description |
Search | Search within specific ZIM files |
Search with Snippets | Search and get short content previews (~200 chars) for relevance evaluation (token-saving) |
Full Content | Retrieve complete article text |
Summaries | Get only introductory paragraphs (token-saving) |
ZIM Listing | Discover all available ZIM files in your Kiwix instance |
Prerequisites
Kiwix server running with ZIM files loaded
Node.js 18+ installed
Local network access to the Kiwix server
Installation
1. Clone and install dependencies
npm install2. Configure environment
Copy the example environment file and update it for your setup:
cp .env.example .envEdit .env to point to your Kiwix server:
# Kiwix server address
KIWIX_BASE_URL=http://192.168.1.5:8080
# Default ZIM file (can be overridden per-tool call)
DEFAULT_ZIM=wikipedia_en_all_maxi_2026-02Variable | Description | Default |
| URL of your Kiwix server |
|
| Default ZIM file name |
|
Available Tools
search_zim
Search for entries within a specific ZIM file.
Parameters:
Parameter | Required | Description |
| Yes | Search query string |
| No | Target ZIM file (defaults to |
| No | Number of results (default: 3) |
Example:
{
"name": "search_zim",
"arguments": {
"query": "quantum physics",
"zim_file": "wikipedia_en_all_maxi_2026-02",
"count": 5
}
}search_with_snippets
Search for articles and return short content snippets (~200 chars) from each result. Use this to evaluate relevance before fetching full content with get_content. This is the most token-efficient way to explore multiple articles at once.
Parameters:
Parameter | Required | Description |
| Yes | Search query string |
| No | Target ZIM file (defaults to |
| No | Number of results (default: 3). Each result includes a ~200 character content snippet. |
Example:
{
"name": "search_with_snippets",
"arguments": {
"query": "quantum physics",
"zim_file": "wikipedia_en_all_maxi_2026-02",
"count": 3
}
}Response format (JSON array):
[
{
"title": "Quantum mechanics",
"snippet": "Quantum mechanics is a fundamental theory in physics that describes the physical properties of nature at the scale of atoms and subatomic particles. It provides a mathematical framework for understanding phenomena...",
"url": "/wikipedia_en_all_maxi_2026-02/Quantum_mechanics"
},
{
"title": "Quantum field theory",
"snippet": "Quantum field theory (QFT) is the theoretical framework describing the physics of quantum fields. QFT is used in particle physics and condensed matter physics to construct physical models...",
"url": "/wikipedia_en_all_maxi_2026-02/Quantum_field_theory"
}
]Token-efficient workflow:
Use
search_with_snippetsto get previews of multiple articlesEvaluate relevance from the snippets (~200 chars each)
Only call
get_contentorget_content_summaryfor the most relevant article(s)
get_content
Retrieve the full text content of an article. Tables (infoboxes, comparison tables), navigation elements, images, and reference footers are automatically stripped to minimize token usage while preserving article body text.
Parameters:
Parameter | Required | Description |
| Yes | Article title |
| Yes | Target ZIM file |
Example:
{
"name": "get_content",
"arguments": {
"title": "Quantum mechanics",
"zim_file": "wikipedia_en_all_maxi_2026-02"
}
}get_content_summary
Get only the introductory summary of an article (token-efficient).
Parameters:
Parameter | Required | Description |
| Yes | Article title |
| No | Target ZIM file (defaults to |
| No | Number of paragraphs to return (default: 2) |
Example:
{
"name": "get_content_summary",
"arguments": {
"title": "Quantum mechanics",
"paragraphs": 3
}
}list_all_zims
List all ZIM files available in your Kiwix instance.
Parameters: None
Usage in LM Studio
Open LM Studio
Navigate to the MCP Servers settings (under the AI Server tab)
Click + Add MCP Server
Configure:
Name:
kiwix-wikiType:
stdioCommand:
node server.jsWorking Directory: Path to this project (e.g.,
c:\Users\scott\kiwix-wiki-mcp)
The server will start automatically and make the tools available to your AI model.
Usage in Other MCP Clients
This server uses the stdio transport protocol, which is supported by most MCP clients. Configure it with:
Transport:
stdioCommand:
node server.jsWorking Directory: Project root
Testing
A comprehensive test harness is included to verify your Kiwix instance is working correctly.
Run All Tests
npm testThis runs 17 tests covering:
Category | Tests |
Connectivity | Server reachability, home page content |
ZIM Files | List all available ZIM files (XML/JSON parsing) |
Search | Basic search, no results, count parameter, special characters, multi-ZIM |
Content | Article retrieval, invalid ZIM handling |
Performance | Search response time, content response time |
Search with Snippets | Basic functionality, count parameter, empty results, content quality |
Test Output
Results are printed to the console and saved to test-results.json:
{
"timestamp": "2026-06-13T07:42:24.152Z",
"target": "http://192.168.1.5:8080",
"defaultZim": "wikipedia_en_all_maxi_2026-02",
"totalTests": 17,
"passedTests": 17,
"failedTests": 0,
"successRate": "100.0%",
"results": [...]
}Custom Configuration
Override defaults via environment variables:
KIWIX_BASE_URL=http://192.168.1.100:8080 DEFAULT_ZIM=my_custom_zim npm testRunning Manually
For development or testing:
npm startThe server runs in stdio mode — it reads from stdin and writes to stdout. To test interactively, you can use an MCP client SDK or the @modelcontextprotocol/cli:
npx @modelcontextprotocol/cli install
npx @modelcontextprotocol/cli list-toolsProject Structure
kiwix-wiki-mcp/
├── .env.example # Environment template
├── .env # Your configuration (gitignored)
├── .gitignore # Git ignore rules
├── server.js # MCP server implementation
├── test-harness.js # Test harness for Kiwix connectivity testing
├── test-results.json # Generated test results (JSON format)
├── package.json # Dependencies and scripts
└── README.md # This fileToken Optimization Tips
Automatic Optimizations
Feature | Description | Savings |
Table stripping | Infoboxes, comparison tables, and reference footers are excluded from | 10-30% per article |
Navigation stripping | Sidebars, category links, and navigation elements are removed | ~5-10% per article |
Citation removal | Numeric citation brackets like | ~200-800 tokens per article |
[edit] marker removal | Section heading markers like | ~50-200 tokens per article |
Low-value section removal | "See also", "Further reading", "External links", and "References" sections are stripped from | ~1,000-4,000 tokens per full article |
Recommended Workflow
For the most token-efficient RAG workflow, follow this pattern:
1. search_with_snippets → Get ~200 char previews of N articles (~500-800 tokens total)
2. Evaluate relevance from snippets (no additional tokens consumed)
3. get_content_summary → Fetch only the most relevant article's intro (~200-400 tokens)
4. get_content → Only if full details are needed (~5,000-20,000+ tokens)Best Practices
Practice | Benefit |
Always start with | Avoid fetching content for irrelevant articles |
Use | Limit results to the most relevant articles |
Prefer | Get intro paragraphs at ~5% of the token cost |
Specify | Avoid searching wrong ZIM files and wasting queries |
Use descriptive search queries | More specific queries return more relevant results |
License
MIT License. See LICENSE file for details.

Available Tools
4 toolsget_contentA
Retrieve the complete text content of an article from a ZIM file. Returns all sections as plain text (no HTML). Use this when you need full article details; for quick overviews, use 'get_content_summary' instead. WARNING: Full articles can be very long and token-intensive.
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Article or entry title (spaces are automatically converted) | |
| zim_file | Yes | Name of the ZIM file (required). Example: 'wikipedia_en_all_maxi_2026-02' |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses that articles can be 'very long and token-intensive', which is a key behavioral trait. It also states output format ('plain text, no HTML'). Missing details about potential errors or exactness of title matching, but overall informative.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, each earning its place: first sentence states purpose and output format, second provides usage guidance and sibling reference, third warns about length. No redundant information. Well front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, no output schema, and simple parameters, the description covers purpose, usage, and a behavioral warning. It could mention if the tool returns an error for missing titles, but completeness is adequate for the complexity level.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (both parameters have descriptions). Description adds value: for 'title' it notes 'spaces are automatically converted', and for 'zim_file' provides an example format. These extras help beyond the schema definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Retrieve the complete text content of an article from a ZIM file'. It specifies returns 'plain text (no HTML)' and distinguishes from sibling 'get_content_summary'. The verb 'Retrieve' and resource 'complete text content of an article from a ZIM file' are specific.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly tells when to use ('need full article details') and when not ('for quick overviews, use 'get_content_summary' instead'). Also includes a warning about token intensity, guiding agents on resource implications.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_content_summaryA
Get the first few paragraphs of an article's introduction section. Returns plain text (no HTML) containing only the opening section of the page. Use this for quick topic overviews instead of 'get_content' which returns the full article.
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Article title (spaces are automatically converted to underscores) | |
| zim_file | No | ZIM file name. Only specify if different from your default ZIM file. Example: 'wikipedia_en_all_maxi_2026-02' | |
| paragraphs | No | Number of opening paragraphs to return (default: 2). Use 1-2 for brief overview, 3-5 for detailed summary. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, but description discloses return format (plain text, no HTML) and scope (opening section only). Implies read-only behavior, but does not explicitly state no side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, no wasted words. Action verb 'Get' at start. Information well-structured and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Complete for a simple tool without output schema. Covers purpose, usage, parameter details, and differentiation from sibling tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%. Description adds valuable guidance: for 'paragraphs' suggests 1-2 vs 3-5 range, for 'title' notes underscore conversion, for 'zim_file' explains default vs override.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Get the first few paragraphs of an article's introduction section' with a specific verb and resource. It distinguishes from sibling 'get_content' which returns the full article.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly advises 'Use this for quick topic overviews instead of 'get_content' which returns the full article', providing clear when-to-use and alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_all_zimsA
List all available ZIM files currently loaded in your Kiwix instance. Returns JSON with file details including names, titles, and descriptions.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states it returns JSON with details, but does not mention any potential side effects, authentication needs, rate limits, or error scenarios. For a read-only list, this minimal disclosure is slightly lacking.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description consists of two clear sentences with no superfluous information. It is front-loaded with the main action and scope, and every sentence contributes value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (listing all ZIMs with details) and lack of output schema, the description is mostly complete. However, it could mention typical fields returned or any limitations (e.g., no pagination, no filtering). For a basic list, this is adequate but not exhaustive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and schema description coverage is 100% (trivially). The description does not need to add parameter semantics, and the high coverage yields a baseline of 4. No additional value is needed or missing.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') and resource ('ZIM files') and clearly states the scope ('currently loaded in your Kiwix instance'). It effectively distinguishes from sibling tools like get_content or search_zim which operate on content within ZIMs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for getting an overview of available ZIMs, but provides no explicit guidance on when to use vs alternatives or when not to use. There are no exclusions or context boundaries stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_zimC
Search for entries within a specific ZIM file. Returns results in JSON format with entry titles and URLs. Use keyword search terms to find relevant articles.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search terms or keywords to find in the ZIM file content | |
| zim_file | No | The specific ZIM file to search. If omitted, defaults to your default ZIM file. | |
| count | No | Maximum number of results to return (default: 3). Use lower values (1-3) to save tokens. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose behavioral traits like whether it is read-only, performance implications, or any side effects. The description bears full burden but adds little beyond basic functionality.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, concise and front-loaded. No unnecessary words, but could benefit from slightly more structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Mentions return format (JSON with titles and URLs) and search terms, but lacks details on error handling, default behavior for 'zim_file', or pagination. Adequate for a simple search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents parameters adequately. The description does not add additional meaning beyond what is in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it searches within a ZIM file and returns results with titles and URLs. However, it does not explicitly differentiate from sibling tools like 'get_content' or 'list_all_zims'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Only says 'use keyword search terms' but provides no guidance on when to use this tool versus alternatives such as 'get_content' or 'list_all_zims'. No exclusions or context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: get_content for full articles, get_content_summary for quick overviews, list_all_zims for available ZIM files, and search_zim for finding entries. No ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case, making the pattern predictable and easy to understand.
With 4 tools, the server is slightly on the smaller side but well-scoped for its purpose of accessing ZIM content. Each tool is necessary and there is no bloat.
The tool set covers the core workflows: listing ZIMs, searching, retrieving summaries, and full content. Minor gaps like a dedicated get_metadata tool are absent but agents can work around.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Wikipedia, Wikidata and Wiktionary as clean JSON, not HTML. 1.9M searchable. Free, no auth.
Live Wikipedia edit feed, page summaries, trending pages, and Wikidata search.
Connect to your MediaWiki using simple credentials and manage content without OAuth. Search, read,…
Wiktionary MCP — multilingual dictionary via Wikimedia REST + MediaWiki Action API
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables AI models to access and search offline Wikipedia and other knowledge bases stored in ZIM format files. Provides intelligent content retrieval, structured browsing, advanced search capabilities, and metadata extraction for comprehensive offline knowledge access.8125MIT
- FlicenseNot gradedqualityDmaintenanceProvides access to offline Wikipedia and other content through Kiwix, enabling search and retrieval of articles from local ZIM files.17
- AlicenseNot gradedqualityDmaintenanceEnables offline CRUD and semantic search on Wikipedia ZIM archives via MCP tools for reading, writing, editing, deleting, and searching articles.1MIT
- AlicenseNot gradedqualityDmaintenanceProvides offline search and retrieval of Wikipedia articles using Kiwix .zim files, enabling LLMs to access full Wikipedia content without internet.2MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/scottyphillips/kiwix-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server