No description
  • Python 97.2%
  • HTML 1.4%
  • CSS 0.8%
  • JavaScript 0.3%
  • Makefile 0.2%
Find a file
sibyl 4da9808c29
Some checks failed
CodeQL Security Analysis / Analyze Code (push) Failing after 2s
Performance Benchmarks / Performance Benchmarks (push) Failing after 2s
Performance Benchmarks / Memory Profiling (push) Failing after 7s
Release Please / release-please (push) Failing after 1s
CI / Test Python 3.12 on ubuntu-latest (push) Failing after 2s
CI / Test Python 3.13 on ubuntu-latest (push) Failing after 2s
CI / Security Scanning (push) Failing after 2s
CI / Comprehensive Testing (push) Failing after 2s
Release Please / notify-release-pr (push) Has been skipped
Release Please / validate-release (push) Has been skipped
Release Please / trigger-release (push) Has been skipped
Release Please / trigger-docker-publish (push) Has been skipped
CI / Test Python 3.12 on macos-latest (push) Has been cancelled
CI / Test Python 3.13 on macos-latest (push) Has been cancelled
CI / Test Python 3.12 on windows-latest (push) Has been cancelled
CI / Test Python 3.13 on windows-latest (push) Has been cancelled
New slash prompts to fill out the feature set and stabilize the product
2026-05-19 12:57:47 -04:00
.github ci(deps): bump actions/github-script from 8 to 9 (#122) 2026-05-11 10:32:09 -04:00
docs feat(v2): search-engine-style zim_query (A14) (#135) 2026-05-15 18:56:30 -04:00
openzim_mcp New slash prompts to fill out the feature set and stabilize the product 2026-05-19 12:57:47 -04:00
scripts chore(sonar): clear all 214 open SonarCloud issues (#83) 2026-05-03 21:28:41 -04:00
tests New slash prompts to fill out the feature set and stabilize the product 2026-05-19 12:57:47 -04:00
website chore(release): v2.0.0a16 — post-a15 beta-test sweep shipped (#141) 2026-05-17 19:59:51 -04:00
.dockerignore v1.0.0 — Production-stable release (#82) 2026-05-03 18:50:22 -04:00
.flake8 fix: release 0.8.2 with bug fixes and improvements 2026-01-30 00:12:28 -05:00
.gitattributes feat(v2): Phase A — quality wins (#1, #2, #4, #5, #14) (#108) 2026-05-08 16:15:03 -04:00
.gitignore feat: add binary content retrieval for PDFs, images, and media files (#52) 2026-01-28 14:25:29 -05:00
.markdownlint.json fix: release 0.8.2 with bug fixes and improvements 2026-01-30 00:12:28 -05:00
.pre-commit-config.yaml feat(http): operator-acknowledged auth bypass + rate-limit env-var docs (#104) 2026-05-05 20:41:56 -04:00
.python-version Initial Release 2025-09-14 20:36:57 -04:00
.release-please-manifest.json chore(release): v2.0.0a16 — post-a15 beta-test sweep shipped (#141) 2026-05-17 19:59:51 -04:00
CHANGELOG.md Fork release 2.0.1 2026-05-19 10:48:44 -04:00
CODE_OF_CONDUCT.md v1.0.0 — Production-stable release (#82) 2026-05-03 18:50:22 -04:00
CONTRIBUTING.md v1.0.0 — Production-stable release (#82) 2026-05-03 18:50:22 -04:00
Dockerfile chore(sonar): clear all 214 open SonarCloud issues (#83) 2026-05-03 21:28:41 -04:00
LICENSE v1.0.0 — Production-stable release (#82) 2026-05-03 18:50:22 -04:00
Makefile chore(release): v2.0.0a8 — re-cut of a7 with urllib3 CVE fix 2026-05-11 12:15:40 -04:00
pyproject.toml Rename repo metadata to mcp-openzim 2026-05-19 10:53:18 -04:00
README.md New slash prompts to fill out the feature set and stabilize the product 2026-05-19 12:57:47 -04:00
release-please-config.json v1.0.0 — Production-stable release (#82) 2026-05-03 18:50:22 -04:00
SECURITY.md chore: prep for v1.1.0 release (#97) 2026-05-05 09:40:40 -04:00
sonar-project.properties chore(sonar): clear all 214 open SonarCloud issues (#83) 2026-05-03 21:28:41 -04:00
uv.lock Fork release 2.0.1 2026-05-19 10:48:44 -04:00

OpenZIM MCP Server

openzim-mcp is an MCP server for reading and searching ZIM archives.

This fork keeps the same package name but is intentionally opinionated for a single-user deployment:

  • bare-metal, not Docker-first
  • systemd-managed HTTP service
  • simple mode as the default operating model
  • one persistent Wikipedia archive at a known path
  • reduced prompt surface: /research only

Current fork version: 2.0.1

Maintainer: sibyl

What This Fork Changes

Compared with upstream, this fork is optimized for a narrow and stable setup.

  • simple mode still exposes zim_query
  • simple mode exposes only the /research MCP prompt
  • summarize and explore prompts are not registered
  • when a client mistakenly passes an entry path into zim_file_path, simple mode treats that as a slot error and falls back to the single loaded archive

That last point matters for small models and weak MCP clients. A payload like this:

{
  "compact": true,
  "query": "summary of A/Marcellina_(gnostic)",
  "zim_file_path": "A/Marcellina_(gnostic)"
}

now resolves against the real archive instead of treating A/Marcellina_(gnostic) as a filesystem path.

Intended Deployment

This fork is written around a single persistent archive:

/srv/zim/wikipedia_en_all_maxi_2022-05.zim

and a local HTTP service bound to loopback, typically behind a reverse proxy.

Example service command:

uv run openzim-mcp --mode simple --transport http --host 127.0.0.1 --port 3338 /srv/zim

Features Kept In This Fork

  • zim_query natural-language interface
  • advanced mode codepath and tooling
  • HTTP transport
  • search, article retrieval, structure, links, title lookup
  • compact simple-mode rendering
  • single registered MCP prompt: /research

Features Intentionally De-Emphasized

  • Docker-first deployment guidance
  • broad multi-client prompt workflows
  • prompt flows that require the caller to supply zim_file_path

The code still contains far more capability than this README emphasizes. The difference is intentional: this document is for operating this fork, not for advertising every upstream feature.

Installation

Requirements:

  • Python 3.12+
  • uv
  • a readable directory containing your .zim files

Clone the repo:

git clone <your-fork-url>
cd openzim-mcp

Install dependencies:

uv sync

Run locally:

uv run openzim-mcp --mode simple /srv/zim

Run over HTTP:

uv run openzim-mcp --mode simple --transport http --host 127.0.0.1 --port 3338 /srv/zim

Bare-Metal systemd Deployment

This fork is expected to run directly on a host, not in a container.

Example unit:

[Unit]
Description=OpenZIM MCP Server
After=network-online.target
Wants=network-online.target

[Service]
User=openzim-mcp
Group=openzim-mcp
WorkingDirectory=/opt/openzim-mcp/app
EnvironmentFile=/etc/openzim-mcp/openzim-mcp.env

ExecStart=/var/lib/openzim-mcp/.local/bin/uv run openzim-mcp --mode simple --transport http --host 127.0.0.1 --port 3338 /srv/zim

Restart=always
RestartSec=5

NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadOnlyPaths=/srv/zim /opt/openzim-mcp
ReadWritePaths=/var/lib/openzim-mcp
RestrictSUIDSGID=true
LockPersonality=true

[Install]
WantedBy=multi-user.target

Enable it:

sudo systemctl daemon-reload
sudo systemctl enable --now openzim-mcp
sudo systemctl status openzim-mcp

Updating The Deployment

For this setup, do not copy local virtual environments into the server tree.

Deploy source only:

  • copy or pull the repo into /opt/openzim-mcp/app
  • keep .venv off the server copy
  • rebuild the environment on the target host with uv sync

Typical update flow:

sudo systemctl stop openzim-mcp
cd /opt/openzim-mcp/app
git pull
sudo -u openzim-mcp /var/lib/openzim-mcp/.local/bin/uv sync
sudo systemctl start openzim-mcp

If you are deploying by copying files rather than pulling on-host, replace the whole app tree rather than pasting selected files over an existing checkout.

MCP Surface In Simple Mode

Simple mode in this fork is intentionally small.

Tools:

  • zim_query

Prompts:

  • /research
  • /article
  • /compare
  • /timeline
  • /map

That is the interface you should expect clients to see.

All prompts are workflow macros over zim_query; they do not reference the advanced-mode tools. They assume a single offline Wikipedia archive and tell clients to omit zim_file_path so the server can auto-select the loaded archive.

Example Queries

These are the kinds of simple-mode requests this fork is tuned for:

  • tell me about Marcellina
  • summary of A/Marcellina_(gnostic)
  • show structure of Photosynthesis
  • links in Ada Lovelace
  • find article titled Hypatia
  • search for gnosticism

Versioning

This fork now uses a normal release version:

  • 2.0.1

That replaces the upstream alpha train version that was present in this tree.

Development Notes

Useful commands:

uv run pytest tests/test_server.py tests/test_simple_tools.py tests/test_prompts.py -q
uv run pytest -q

The fork-specific behavior currently pinned by tests includes:

  • simple mode prompt registration
  • entry-like zim_file_path fallback in single-archive mode
  • reduced prompt surface
  • Wikipedia-oriented simple-mode prompts over zim_query

License

This repository remains under the existing project license unless you change it separately.