zimi-mcp 1.13.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Eric Pheterson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: zimi-mcp
3
+ Version: 1.13.0
4
+ Summary: Zimi's MCP server and search alone: search and read Wikipedia, Stack Overflow and other ZIM files offline, for AI agents
5
+ Author: Eric Pheterson
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/epheterson/Zimi
8
+ Project-URL: Documentation, https://github.com/epheterson/Zimi/blob/main/docs/features/api-and-mcp.md
9
+ Project-URL: Issues, https://github.com/epheterson/Zimi/issues
10
+ Keywords: zim,kiwix,offline,wikipedia,search,mcp,rag,llm
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Text Processing :: Indexing
17
+ Requires-Python: <3.15,>=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: libzim>=3.1.0
21
+ Requires-Dist: mcp<2.0,>=1.0
22
+ Requires-Dist: certifi>=2024.1.1
23
+ Provides-Extra: pdf
24
+ Requires-Dist: PyMuPDF>=1.23.0; extra == "pdf"
25
+ Dynamic: license-file
26
+
27
+ # zimi-mcp
28
+
29
+ [Zimi](https://github.com/epheterson/Zimi)'s MCP server and search, without the rest of Zimi. Search and read Wikipedia, Stack Overflow, dev docs and any other ZIM file offline, from Claude, Open WebUI or any MCP client.
30
+
31
+ ```bash
32
+ pip install zimi-mcp
33
+ zimi-mcp /path/to/zims
34
+ ```
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "zimi": { "command": "zimi-mcp", "args": ["/path/to/zims"] }
40
+ }
41
+ }
42
+ ```
43
+
44
+ Three tools by default (search, read a page as Markdown, read one section), about 330 tokens of schema, sized for small local models. `zimi-mcp --tools full` serves every tool Zimi has. Nothing listens on a port.
45
+
46
+ zimi-mcp is built from the same source as Zimi and released with it, same version. It depends on libzim and mcp only: no web app, downloads, BitTorrent, LAN discovery or desktop window. For text out of the PDFs in zimgit ZIMs, `pip install "zimi-mcp[pdf]"`.
47
+
48
+ Want the web app, the catalog and the rest? `pip install zimi` is the complete experience and includes the same `zimi-mcp` command. Install one or the other, not both: they share the `zimi` module.
49
+
50
+ Tools, options and measured numbers: [API & MCP](https://github.com/epheterson/Zimi/blob/main/docs/features/api-and-mcp.md#just-the-basics).
@@ -0,0 +1,24 @@
1
+ # zimi-mcp
2
+
3
+ [Zimi](https://github.com/epheterson/Zimi)'s MCP server and search, without the rest of Zimi. Search and read Wikipedia, Stack Overflow, dev docs and any other ZIM file offline, from Claude, Open WebUI or any MCP client.
4
+
5
+ ```bash
6
+ pip install zimi-mcp
7
+ zimi-mcp /path/to/zims
8
+ ```
9
+
10
+ ```json
11
+ {
12
+ "mcpServers": {
13
+ "zimi": { "command": "zimi-mcp", "args": ["/path/to/zims"] }
14
+ }
15
+ }
16
+ ```
17
+
18
+ Three tools by default (search, read a page as Markdown, read one section), about 330 tokens of schema, sized for small local models. `zimi-mcp --tools full` serves every tool Zimi has. Nothing listens on a port.
19
+
20
+ zimi-mcp is built from the same source as Zimi and released with it, same version. It depends on libzim and mcp only: no web app, downloads, BitTorrent, LAN discovery or desktop window. For text out of the PDFs in zimgit ZIMs, `pip install "zimi-mcp[pdf]"`.
21
+
22
+ Want the web app, the catalog and the rest? `pip install zimi` is the complete experience and includes the same `zimi-mcp` command. Install one or the other, not both: they share the `zimi` module.
23
+
24
+ Tools, options and measured numbers: [API & MCP](https://github.com/epheterson/Zimi/blob/main/docs/features/api-and-mcp.md#just-the-basics).
@@ -0,0 +1,48 @@
1
+ # zimi-mcp: staged and built by build.py beside this file, never in place.
2
+ # The version is the main package's, written over 1.13.0 at build time.
3
+ [build-system]
4
+ requires = ["setuptools>=68.0", "wheel"]
5
+ build-backend = "setuptools.build_meta"
6
+
7
+ [project]
8
+ name = "zimi-mcp"
9
+ version = "1.13.0"
10
+ description = "Zimi's MCP server and search alone: search and read Wikipedia, Stack Overflow and other ZIM files offline, for AI agents"
11
+ readme = "README.md"
12
+ license = {text = "MIT"}
13
+ requires-python = ">=3.10,<3.15"
14
+ authors = [{name = "Eric Pheterson"}]
15
+ keywords = ["zim", "kiwix", "offline", "wikipedia", "search", "mcp", "rag", "llm"]
16
+ classifiers = [
17
+ "Development Status :: 5 - Production/Stable",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Topic :: Text Processing :: Indexing",
23
+ ]
24
+ # Pinned as the main package pins them (mcp<2.0: see its pyproject).
25
+ dependencies = [
26
+ "libzim>=3.1.0",
27
+ "mcp>=1.0,<2.0",
28
+ "certifi>=2024.1.1",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ # Text out of the PDFs in zimgit ZIMs. Without it a PDF reads as one line
33
+ # saying PyMuPDF would extract its text.
34
+ pdf = ["PyMuPDF>=1.23.0"]
35
+
36
+ [project.scripts]
37
+ zimi-mcp = "zimi.server:mcp_main"
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/epheterson/Zimi"
41
+ Documentation = "https://github.com/epheterson/Zimi/blob/main/docs/features/api-and-mcp.md"
42
+ Issues = "https://github.com/epheterson/Zimi/issues"
43
+
44
+ [tool.setuptools]
45
+ packages = ["zimi"]
46
+
47
+ [tool.setuptools.package-data]
48
+ zimi = ["assets/lang-codes.json"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,56 @@
1
+ """Zimi -- Offline knowledge server for ZIM files.
2
+
3
+ Makes ``import zimi`` behave identically to the old flat-file layout.
4
+ Both attribute reads (``zimi.ZimHandler``) and writes (``zimi.ZIM_DIR = "/path"``)
5
+ operate on zimi.server's namespace, so existing code like zimi_desktop.py and
6
+ test files need zero changes.
7
+
8
+ How: a custom module subclass replaces this module in sys.modules.
9
+ Package-level attributes (__path__, __spec__, etc.) are stored on the proxy
10
+ itself so Python's import machinery works correctly. All other attribute
11
+ access is delegated to zimi.server.
12
+ """
13
+
14
+ import sys
15
+ import types
16
+ import importlib
17
+
18
+ _server = importlib.import_module("zimi.server")
19
+
20
+ # Attributes that belong to the package, not to zimi.server
21
+ _PACKAGE_ATTRS = frozenset(
22
+ {
23
+ "__name__",
24
+ "__package__",
25
+ "__path__",
26
+ "__file__",
27
+ "__spec__",
28
+ "__loader__",
29
+ "__doc__",
30
+ }
31
+ )
32
+
33
+
34
+ class _ZimiProxy(types.ModuleType):
35
+ """Module proxy that delegates attribute access to zimi.server."""
36
+
37
+ def __getattr__(self, name):
38
+ return getattr(_server, name)
39
+
40
+ def __setattr__(self, name, value):
41
+ if name in _PACKAGE_ATTRS:
42
+ # Store package metadata on the proxy itself
43
+ super().__setattr__(name, value)
44
+ else:
45
+ setattr(_server, name, value)
46
+
47
+ def __dir__(self):
48
+ return sorted(set(dir(_server)) | _PACKAGE_ATTRS)
49
+
50
+
51
+ _proxy = _ZimiProxy(__name__)
52
+ _proxy.__package__ = __package__
53
+ _proxy.__path__ = __path__
54
+ _proxy.__file__ = __file__
55
+ _proxy.__spec__ = __spec__
56
+ sys.modules[__name__] = _proxy
@@ -0,0 +1,187 @@
1
+ {"aar": "aa",
2
+ "abk": "ab",
3
+ "afr": "af",
4
+ "aka": "ak",
5
+ "amh": "am",
6
+ "ara": "ar",
7
+ "arg": "an",
8
+ "asm": "as",
9
+ "ava": "av",
10
+ "ave": "ae",
11
+ "aym": "ay",
12
+ "aze": "az",
13
+ "bak": "ba",
14
+ "bam": "bm",
15
+ "bel": "be",
16
+ "ben": "bn",
17
+ "bis": "bi",
18
+ "bod": "bo",
19
+ "bos": "bs",
20
+ "bre": "br",
21
+ "bul": "bg",
22
+ "cat": "ca",
23
+ "ces": "cs",
24
+ "cha": "ch",
25
+ "che": "ce",
26
+ "chu": "cu",
27
+ "chv": "cv",
28
+ "cor": "kw",
29
+ "cos": "co",
30
+ "cre": "cr",
31
+ "cym": "cy",
32
+ "dan": "da",
33
+ "deu": "de",
34
+ "div": "dv",
35
+ "dzo": "dz",
36
+ "ell": "el",
37
+ "eng": "en",
38
+ "epo": "eo",
39
+ "est": "et",
40
+ "eus": "eu",
41
+ "ewe": "ee",
42
+ "fao": "fo",
43
+ "fas": "fa",
44
+ "fij": "fj",
45
+ "fin": "fi",
46
+ "fra": "fr",
47
+ "fry": "fy",
48
+ "ful": "ff",
49
+ "gla": "gd",
50
+ "gle": "ga",
51
+ "glg": "gl",
52
+ "glv": "gv",
53
+ "grn": "gn",
54
+ "guj": "gu",
55
+ "hat": "ht",
56
+ "hau": "ha",
57
+ "hbs": "sh",
58
+ "heb": "he",
59
+ "her": "hz",
60
+ "hin": "hi",
61
+ "hmo": "ho",
62
+ "hrv": "hr",
63
+ "hun": "hu",
64
+ "hye": "hy",
65
+ "ibo": "ig",
66
+ "ido": "io",
67
+ "iii": "ii",
68
+ "iku": "iu",
69
+ "ile": "ie",
70
+ "ina": "ia",
71
+ "ind": "id",
72
+ "ipk": "ik",
73
+ "isl": "is",
74
+ "ita": "it",
75
+ "jav": "jv",
76
+ "jpn": "ja",
77
+ "kal": "kl",
78
+ "kan": "kn",
79
+ "kas": "ks",
80
+ "kat": "ka",
81
+ "kau": "kr",
82
+ "kaz": "kk",
83
+ "khm": "km",
84
+ "kik": "ki",
85
+ "kin": "rw",
86
+ "kir": "ky",
87
+ "kom": "kv",
88
+ "kon": "kg",
89
+ "kor": "ko",
90
+ "kua": "kj",
91
+ "kur": "ku",
92
+ "lao": "lo",
93
+ "lat": "la",
94
+ "lav": "lv",
95
+ "lim": "li",
96
+ "lin": "ln",
97
+ "lit": "lt",
98
+ "ltz": "lb",
99
+ "lub": "lu",
100
+ "lug": "lg",
101
+ "mah": "mh",
102
+ "mal": "ml",
103
+ "mar": "mr",
104
+ "mkd": "mk",
105
+ "mlg": "mg",
106
+ "mlt": "mt",
107
+ "mon": "mn",
108
+ "mri": "mi",
109
+ "msa": "ms",
110
+ "mul": "mul",
111
+ "mya": "my",
112
+ "nau": "na",
113
+ "nav": "nv",
114
+ "nbl": "nr",
115
+ "nde": "nd",
116
+ "ndo": "ng",
117
+ "nep": "ne",
118
+ "nld": "nl",
119
+ "nno": "nn",
120
+ "nob": "nb",
121
+ "nor": "no",
122
+ "nya": "ny",
123
+ "oci": "oc",
124
+ "oji": "oj",
125
+ "ori": "or",
126
+ "orm": "om",
127
+ "oss": "os",
128
+ "pam": "pam",
129
+ "pan": "pa",
130
+ "pli": "pi",
131
+ "pol": "pl",
132
+ "por": "pt",
133
+ "pus": "ps",
134
+ "que": "qu",
135
+ "roh": "rm",
136
+ "ron": "ro",
137
+ "run": "rn",
138
+ "rus": "ru",
139
+ "sag": "sg",
140
+ "sah": "sah",
141
+ "san": "sa",
142
+ "sin": "si",
143
+ "slk": "sk",
144
+ "slv": "sl",
145
+ "sme": "se",
146
+ "smo": "sm",
147
+ "sna": "sn",
148
+ "snd": "sd",
149
+ "som": "so",
150
+ "sot": "st",
151
+ "spa": "es",
152
+ "sqi": "sq",
153
+ "srd": "sc",
154
+ "srp": "sr",
155
+ "ssw": "ss",
156
+ "sun": "su",
157
+ "swa": "sw",
158
+ "swe": "sv",
159
+ "tah": "ty",
160
+ "tam": "ta",
161
+ "tat": "tt",
162
+ "tel": "te",
163
+ "tgk": "tg",
164
+ "tgl": "tl",
165
+ "tha": "th",
166
+ "tir": "ti",
167
+ "ton": "to",
168
+ "tsn": "tn",
169
+ "tso": "ts",
170
+ "tuk": "tk",
171
+ "tur": "tr",
172
+ "twi": "tw",
173
+ "uig": "ug",
174
+ "ukr": "uk",
175
+ "urd": "ur",
176
+ "uzb": "uz",
177
+ "ven": "ve",
178
+ "vie": "vi",
179
+ "vol": "vo",
180
+ "wln": "wa",
181
+ "wol": "wo",
182
+ "xho": "xh",
183
+ "yid": "yi",
184
+ "yor": "yo",
185
+ "zha": "za",
186
+ "zho": "zh",
187
+ "zul": "zu"}