ZimAgent

ZimAgent

Enables offline CRUD and semantic search on Wikipedia ZIM archives via MCP tools for reading, writing, editing, deleting, and searching articles.

Category
Visit Server

README

šŸ¤– ZimAgent Desktop

Offline CRUD + Semantic Search for Wikipedia ZIM Archives

A production-grade PyQt5 desktop application that lets you read, write, edit, and semantically search any Kiwix .zim archive — with local LLM question answering, animated pipeline visualisation, and a built-in MCP server for Claude Desktop / LangChain integration.

Fully offline. No internet connection required after initial model download.


šŸ“ø Screenshot

<img src=zim-agent-gui.png/>


šŸš€ Quick Start

1. Clone & Install

git clone https://github.com/yourname/zim-agent-gui
cd zim-agent-gui

# Create virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate       # Linux/macOS
.venv\Scripts\activate.bat      # Windows

# Install dependencies
pip install -r requirements.txt

2. Download a ZIM file

# Small Wikipedia excerpt for testing (~90 MB)
wget https://download.kiwix.org/zim/wikipedia/wikipedia_en_wp1_2023-11.zim \
     -O data/test.zim

3. Download GGUF Models (for RAG + LLM)

Place models in the models/ folder:

File Purpose Source
embeddinggemma-300m-q4_k_m.gguf Sentence embeddings HuggingFace
qwen-0.5b-q4_k_m.gguf Answer generation HuggingFace
# Install TurboRag
pip install turborag-ahx47

4. Launch

python run_app.py
# or
python -m zimagent

šŸ“¦ File Structure

zim-agent-gui/
ā”œā”€ā”€ zimagent/                    # Main Python package
│   ā”œā”€ā”€ __init__.py
│   ā”œā”€ā”€ __main__.py              # python -m zimagent
│   ā”œā”€ā”€ main.py                  # App entry-point (QApplication)
│   ā”œā”€ā”€ main_window.py           # Full PyQt5 UI (~600 lines)
│   ā”œā”€ā”€ zim_reader.py            # ZIM article reading (libzim)
│   ā”œā”€ā”€ zim_manager.py           # CRUD + SQLite overlay
│   ā”œā”€ā”€ mcp_server.py            # FastMCP tool server
│   ā”œā”€ā”€ indexer.py               # ZIM → TurboRag indexer
│   ā”œā”€ā”€ agent.py                 # High-level ZimAgent orchestrator
│   ā”œā”€ā”€ semantic_search.py       # TurboRag adapter
│   ā”œā”€ā”€ worker_threads.py        # QThread workers (index, MCP, stats)
│   └── resources/
│       └── style.qss            # Dark cyberpunk QSS theme
│
ā”œā”€ā”€ models/                      # GGUF models (user-provided)
│   ā”œā”€ā”€ embeddinggemma-300m-q4_k_m.gguf
│   └── qwen-0.5b-q4_k_m.gguf
│
ā”œā”€ā”€ data/                        # ZIM files + index
│
ā”œā”€ā”€ scripts/
│   ā”œā”€ā”€ build_exe.bat            # Windows .exe via PyInstaller
│   ā”œā”€ā”€ build_deb.sh             # Linux .deb package
│   └── DEBIAN/control
│
ā”œā”€ā”€ run_app.py                   # Standalone launcher
ā”œā”€ā”€ requirements.txt
ā”œā”€ā”€ setup.py
└── README.md

🧩 Features

Dashboard

  • ZIM Archive Input & CRUD — open any .zim, see file size + article count
  • Pipeline Visualization — animated dashed-arrow diagram: ZIM Reader → Chunking → Gemma Embedding → TurboVec Index + SQLite FTS5
  • Query & Results — ask a question, see semantic results + LLM answer
  • MCP Server mini-panel — one-click toggle with live status

CRUD Operations

  • Full article tree (namespaces A/, B/, …)
  • HTML viewer (QWebEngineView or plain text fallback)
  • Write new articles, edit existing, soft-delete with restore
  • Every change stored in SQLite overlay (base ZIM untouched)
  • Full action log

Semantic Search

  • Semantic search powered by TurboRag vector index
  • Relevance bar for each result
  • LLM-generated answer with source attribution
  • Runs in background thread (UI never blocks)

MCP Server

  • Exposes 8 MCP tools to Claude Desktop / any MCP client
  • SSE or stdio transport
  • Configurable host + port
  • Live server log

āš™ļø Configuration

Open āš™ Settings in the sidebar to configure:

  • Embedding model path
  • LLM model path
  • Vector index path

These are saved for the current session (persistent config coming in v1.1).


šŸ“¦ Building Installers

Windows .exe

pip install pyinstaller
scripts\build_exe.bat
# Output: dist\ZimAgent.exe

Linux .deb

sudo apt install fakeroot dpkg-dev
bash scripts/build_deb.sh
# Output: zimagent_1.0.0_amd64.deb
sudo dpkg -i zimagent_1.0.0_amd64.deb

šŸ”Œ MCP Integration (Claude Desktop)

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "zimagent": {
      "command": "python",
      "args": ["-m", "zim_agent.mcp_server",
               "--zim", "/path/to/wikipedia.zim",
               "--transport", "stdio"]
    }
  }
}

Or start SSE server from the MCP Server tab and connect via: http://127.0.0.1:8002/sse


šŸ“‹ MCP Tools Reference

Tool Parameters Description
zim_read_article path Read article by URL path
zim_search query, max_results Full-text + prefix search
zim_write_article path, title, html Create or replace article
zim_edit_article path, new_html, [new_title] Edit article content
zim_delete_article path Soft-delete article
zim_restore_article path Restore deleted article
zim_list_modified — List all overlay changes
zim_stats — Archive + index statistics

🧱 Dependencies

Package Purpose
PyQt5 GUI framework
PyQtWebEngine HTML article rendering
libzim ZIM file reading
turborag-ahx47 Semantic search + RAG
fastmcp MCP server
psutil CPU/RAM monitoring

šŸ“„ License

MIT — see LICENSE.

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