mcp-offline-wikipedia
Provides tools to search and read content from any Kiwix archive (.zim file), including Wikipedia, Wiktionary, and Stack Overflow, enabling offline access to knowledge bases.
Allows searching and retrieving articles from offline Wikipedia archives (.zim files), enabling access to Wikipedia content without an internet connection.
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., "@mcp-offline-wikipediasearch for quantum mechanics"
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 Wikipedia MCP Server ๐๐
A fast, completely offline Model Context Protocol (MCP) server that connects local or cloud LLMs to locally downloaded Kiwix archives (.zim files).
This project bridges the gap between Large Language Models (running locally in LM Studio, Claude Desktop, or Cursor) and massive offline knowledge bases. By using the official Python MCP SDK and libzim, your LLM can search and read full Wikipedia articles โ and any other Kiwix archive โ without an internet connection.
โจ Features
๐ Smart search โ uses full-text index search with automatic fallback to title/prefix search
๐ Multi-archive support โ point at a folder and every
.zimfile inside is loaded automatically๐ Direct article lookup โ retrieve a specific article by exact title, bypassing search
๐ท๏ธ Source labelling โ results show which archive they came from (e.g.
[wikipedia_en_wp1-0.8_nopic_2026-04])๐งน Clean output โ strips HTML, scripts, tables, citation numbers
[1], and[edit]markersโ๏ธ Configurable truncation โ prevent context-window overflows with
WIKI_MAX_CHARS๐ Thread-safe โ double-checked locking for safe use in concurrent MCP environments
๐ฆ Any
.zimfile โ works with Wikipedia, Wiktionary, Stack Overflow, and other Kiwix archives
Related MCP server: ZIM RAG MCP Server
๐ ๏ธ Tools Exposed to the LLM
Tool | Description |
| Search all loaded archives using full-text index with fallback to title/prefix search |
| Fetch a specific article by its exact title, searching across all loaded archives |
๐ฅ Step 1 โ Download Kiwix .zim Archives
Because LLMs only process text, it is highly recommended to download "nopic" (no pictures) versions to save disk space.
Go to the Kiwix Library: https://library.kiwix.org/?lang=eng&q=wikipedia
Recommended files:
Wikipedia English (wp1/Mini, nopic) โ most important articles, no images (~2 GB)
Wikipedia English (Maxi, nopic) โ full Wikipedia, no images (~22 GB)
Save all
.zimfiles into a single dedicated folder (e.g.~/kiwix-zim/). The server will load every.zimfile in that folder automatically.
โ ๏ธ macOS users: Do not store your
.zimfiles inside~/Documents,~/Desktop, or~/Downloads. macOS restricts app access to those folders and will cause anError opening ZIM file. Use your home directory or a custom folder instead (e.g.~/kiwix-zim/).
๐ Step 2 โ Installation
git clone https://github.com/Rome-NotBeepBoop/mcp-offline-wikipedia.git
cd mcp-offline-wikipedia
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtโ๏ธ Step 3 โ Configure Your MCP Client
Replace the example paths below with your actual paths.
โ ๏ธ Always use the full path to the venv Python (
venv/bin/python), not the systempython3. This guarantees the correctlibzimversion is used.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"offline-wikipedia": {
"command": "/absolute/path/to/mcp-offline-wikipedia/venv/bin/python",
"args": ["/absolute/path/to/mcp-offline-wikipedia/mcp_wiki_server.py"],
"env": {
"WIKI_ZIM_DIR": "/absolute/path/to/your/kiwix-zim/",
"WIKI_MAX_CHARS": "15000"
}
}
}
}Cursor
Add the following to your Cursor MCP config (.cursor/mcp.json):
{
"mcpServers": {
"offline-wikipedia": {
"command": "/absolute/path/to/mcp-offline-wikipedia/venv/bin/python",
"args": ["/absolute/path/to/mcp-offline-wikipedia/mcp_wiki_server.py"],
"env": {
"WIKI_ZIM_DIR": "/absolute/path/to/your/kiwix-zim/"
}
}
}
}LM Studio
In LM Studio, go to Developer โ mcp.json and fill in:
{
"mcpServers": {
"offline-wikipedia": {
"command": "/absolute/path/to/mcp-offline-wikipedia/venv/bin/python",
"args": ["/absolute/path/to/mcp-offline-wikipedia/mcp_wiki_server.py"],
"env": {
"WIKI_ZIM_DIR": "/absolute/path/to/your/kiwix-zim/",
"WIKI_MAX_CHARS": "15000"
}
}
}
}๐ Environment Variables
Variable | Required | Default | Description |
| โ Preferred | โ | Path to a folder โ every |
| Legacy | โ | Path to a single |
| No |
| Max characters returned per article |
WIKI_ZIM_DIRtakes priority overWIKI_ZIM_PATHif both are set.
โ Troubleshooting
Neither WIKI_ZIM_DIR nor WIKI_ZIM_PATH is set
โ Make sure the env block is present in your MCP client config with the correct variable name.
ZIM archive not found at: ...
โ Double-check the path. On Windows, use forward slashes or escaped backslashes: C:/Users/you/kiwix-zim/.
macOS: Error opening ZIM file even though the file exists and the path is correct
โ macOS restricts app access to ~/Documents, ~/Desktop, and ~/Downloads without explicit permission. LM Studio (and the Python process it spawns) may be silently blocked. Two fixes:
Quick fix: Move your
.zimfiles to~/kiwix-zim/or any other folder you created yourself, and updateWIKI_ZIM_DIRaccordingly.Proper fix: Go to System Settings โ Privacy & Security โ Files and Folders and grant LM Studio access to the folder containing your
.zimfiles.
Error opening ZIM file โ but the file opens fine in a Python terminal
โ LM Studio is using a different Python than your terminal. Always use the venv Python in your MCP config (venv/bin/python), not the system python3. Verify it has the right libzim:
/absolute/path/to/venv/bin/python -c "import libzim; print('ok')"Server starts but the LLM says it can't find any articles
โ Some .zim files don't have a full-text index. The server will automatically fall back to title search, but results may be less accurate for vague queries. Try using the exact article title.
High memory usage
โ Each .zim archive is loaded on first use. Larger archives (Maxi) will use more RAM. The Mini/nopic version is recommended for most use cases.
๐ค Contributing
Contributions are welcome! Please open an issue first to discuss what you'd like to change. Pull requests should target the main branch.
Fork the repo
Create a feature branch (
git checkout -b feature/my-improvement)Commit your changes (
git commit -m 'Add some improvement')Push to your branch (
git push origin feature/my-improvement)Open a Pull Request
๐ License
This project is licensed under the MIT License โ see the LICENSE file for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/Rome-NotBeepBoop/mcp-offline-wikipedia'
If you have feedback or need assistance with the MCP directory API, please join our Discord server