wiki-js-mcp-server 1.1.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) 2026 hub2rock
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,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: wiki-js-mcp-server
3
+ Version: 1.1.0
4
+ Summary: Wiki.js MCP server β€” 24 tools, dual transport stdio/HTTP, production-ready
5
+ Author: hub2rock
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/2rock-Inc/wiki-js-mcp-server
8
+ Project-URL: Repository, https://github.com/2rock-Inc/wiki-js-mcp-server
9
+ Requires-Python: >=3.11
10
+ License-File: LICENSE
11
+ Requires-Dist: fastmcp>=2.0.0
12
+ Requires-Dist: httpx>=0.27.0
13
+ Requires-Dist: pydantic>=2.0.0
14
+ Requires-Dist: pydantic-settings>=2.0.0
15
+ Requires-Dist: python-slugify>=8.0.0
16
+ Requires-Dist: python-dotenv>=1.0.0
17
+ Requires-Dist: sqlalchemy>=2.0.0
18
+ Requires-Dist: tenacity>=8.0.0
19
+ Requires-Dist: uvicorn[standard]>=0.24.0
20
+ Requires-Dist: tzdata>=2024.1; sys_platform == "win32"
21
+ Dynamic: license-file
@@ -0,0 +1,423 @@
1
+ # Wiki.js MCP Server
2
+
3
+ > A comprehensive **Model Context Protocol (MCP) server** for Wiki.js β€” 24 tools, dual transport (stdio + HTTP/SSE), built for production self-hosted infrastructure.
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B%20%7C%203.14-blue)](https://www.python.org/)
7
+ [![FastMCP](https://img.shields.io/badge/FastMCP-3.x-green)](https://gofastmcp.com)
8
+ [![Wiki.js](https://img.shields.io/badge/Wiki.js-2.x-blueviolet)](https://js.wiki/)
9
+ [![Docker](https://img.shields.io/badge/Docker-hub2rock%2Fwiki--js--mcp--server-blue?logo=docker)](https://hub.docker.com/r/hub2rock/wiki-js-mcp-server)
10
+
11
+ Connect **Claude Desktop** or any MCP-compatible client directly to your Wiki.js instance. Read pages, create structured documentation, sync code changes, manage hierarchies β€” all through natural language.
12
+
13
+ ---
14
+
15
+ ## 🎯 What This Does
16
+
17
+ Once connected, you can ask Claude to:
18
+
19
+ - πŸ” **Search** your wiki for any topic
20
+ - πŸ“– **Read** any page by path or ID
21
+ - ✏️ **Create & update** documentation
22
+ - πŸ—‚οΈ **Organize** pages by moving them around
23
+ - πŸ—οΈ **Scaffold** full repo documentation structures
24
+ - πŸ”— **Sync** source code changes to linked wiki pages
25
+ - πŸ—‘οΈ **Clean up** outdated pages and hierarchies
26
+
27
+ ---
28
+
29
+ ## πŸš€ Quick Start
30
+
31
+ ### Prerequisites
32
+
33
+ - Python **3.11+** β€” compatible up to **3.14** (3.12 recommended)
34
+ - A running [Wiki.js](https://js.wiki/) instance (v2.x)
35
+ - A Wiki.js **API key** with Full Access (see [Getting an API key](#-getting-a-wikijs-api-key))
36
+
37
+ ### Install for Claude Code (recommended β€” via `uvx`)
38
+
39
+ No clone, no venv. Requires [`uv`](https://docs.astral.sh/uv/) on each Mac. Every user runs the server locally with **their own** Wiki.js API key, so per-user permissions are preserved:
40
+
41
+ ```bash
42
+ claude mcp add wikijs \
43
+ --env WIKIJS_URL=https://your-wiki.example.com \
44
+ --env WIKIJS_API_KEY=your_api_key_here \
45
+ -- uvx wiki-js-mcp-server@latest
46
+ ```
47
+
48
+ `uvx` fetches the package from PyPI and runs it β€” nothing to install or maintain. Verify with *"Check my Wiki.js connection status"*; the reply includes a `server_version` field.
49
+
50
+ **Updates β€” pick your policy:**
51
+
52
+ | Config arg | Behaviour |
53
+ |---|---|
54
+ | `uvx wiki-js-mcp-server@latest` | Always newest. Each Claude Code restart re-resolves PyPI and picks up new releases automatically. |
55
+ | `uvx wiki-js-mcp-server@1.1.0` | Pinned. Never changes until you edit the version. |
56
+ | `uvx wiki-js-mcp-server` | Uses whatever `uvx` cached; run `uv cache clean wiki-js-mcp-server` to force a refresh. |
57
+
58
+ > Because each Mac runs its own process, `WIKIJS_API_KEY` stays per-user β€” one Mac, one Wiki.js user, one key.
59
+
60
+ ---
61
+
62
+ ### Install from source (Claude Desktop / development)
63
+
64
+ ```bash
65
+ git clone https://github.com/2rock-Inc/wiki-js-mcp-server.git
66
+ cd wiki-js-mcp-server
67
+ chmod +x setup.sh start.sh
68
+ ./setup.sh
69
+ ```
70
+
71
+ The setup script creates a Python virtual environment and installs all dependencies.
72
+
73
+ ### 2. Configure
74
+
75
+ Edit `.env` at the project root:
76
+
77
+ ```env
78
+ WIKIJS_URL=https://your-wiki.example.com
79
+ WIKIJS_API_KEY=your_api_key_here
80
+ ```
81
+
82
+ > ⚠️ **Important for Claude Desktop (stdio mode):** use **absolute paths** for `WIKIJS_MCP_DB` and `LOG_FILE`. Claude Desktop launches the process from `/`, so relative paths will fail.
83
+
84
+ ```env
85
+ WIKIJS_MCP_DB=/absolute/path/to/wiki-js-mcp-server/wikijs_mappings.db
86
+ LOG_FILE=/absolute/path/to/wiki-js-mcp-server/wikijs_mcp.log
87
+ ```
88
+
89
+ ### 3. Configure Claude Desktop
90
+
91
+ Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
92
+
93
+ ```json
94
+ {
95
+ "mcpServers": {
96
+ "wikijs": {
97
+ "command": "/absolute/path/to/wiki-js-mcp-server/venv/bin/python",
98
+ "args": ["/absolute/path/to/wiki-js-mcp-server/src/server.py", "--stdio"]
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ Restart Claude Desktop β†’ **Settings β†’ Developer** β†’ you should see `wikijs` with a 🟒 green dot and 24 tools listed.
105
+
106
+ ### 4. Verify the connection
107
+
108
+ Ask Claude: *"Check my Wiki.js connection status"* or *"List all pages in my wiki"*.
109
+
110
+ ---
111
+
112
+ ## πŸ“Š MCP Tools (24 Total)
113
+
114
+ ### πŸ”§ Connection
115
+
116
+ | Tool | Description |
117
+ |------|-------------|
118
+ | `wikijs_connection_status` | Check connection & authentication health |
119
+
120
+ ### πŸ“ Core Page Management
121
+
122
+ | Tool | Description |
123
+ |------|-------------|
124
+ | `wikijs_create_page` | Create a new page with optional path or parent |
125
+ | `wikijs_get_page` | Retrieve a page by ID or path (with content size controls) |
126
+ | `wikijs_get_page_metadata` | Retrieve page metadata only β€” no content, always fast |
127
+ | `wikijs_update_page` | Update content, title, description, or tags |
128
+ | `wikijs_delete_page` | Delete a page by ID or path |
129
+ | `wikijs_move_page` | Move a page to a new path or locale |
130
+ | `wikijs_search_pages` | Full-text search with fallback to list filter |
131
+ | `wikijs_list_pages` | List all pages with metadata |
132
+ | `wikijs_get_tree` | Get the full page tree structure |
133
+
134
+ ### πŸ—οΈ Hierarchical Documentation
135
+
136
+ | Tool | Description |
137
+ |------|-------------|
138
+ | `wikijs_get_page_children` | List direct children of a page |
139
+ | `wikijs_create_nested_page` | Create a page under a path, auto-creates parents |
140
+ | `wikijs_create_repo_structure` | Scaffold a complete repository documentation structure |
141
+ | `wikijs_create_documentation_hierarchy` | Auto-organize project files into categorized docs |
142
+
143
+ ### πŸ—‚οΈ Spaces & Organization
144
+
145
+ | Tool | Description |
146
+ |------|-------------|
147
+ | `wikijs_list_spaces` | List top-level documentation spaces |
148
+ | `wikijs_create_space` | Create a new top-level space |
149
+
150
+ ### πŸ—‘οΈ Deletion & Cleanup
151
+
152
+ | Tool | Description |
153
+ |------|-------------|
154
+ | `wikijs_batch_delete_pages` | Delete multiple pages by IDs, paths, or glob pattern |
155
+ | `wikijs_delete_hierarchy` | Delete an entire page hierarchy |
156
+
157
+ ### πŸ”— File↔Page Sync (Code/Doc Integration)
158
+
159
+ | Tool | Description |
160
+ |------|-------------|
161
+ | `wikijs_link_file_to_page` | Persist a link between a source file and a wiki page |
162
+ | `wikijs_sync_file_docs` | Append a change note to a file's linked wiki page |
163
+ | `wikijs_generate_file_overview` | Auto-generate documentation for a Python source file |
164
+ | `wikijs_bulk_update_project_docs` | Batch sync multiple changed files to their wiki pages |
165
+ | `wikijs_cleanup_orphaned_mappings` | Remove mappings to deleted wiki pages |
166
+ | `wikijs_repository_context` | Show current repo context and active mappings |
167
+
168
+ ---
169
+
170
+ ## πŸ“„ Handling Large Pages
171
+
172
+ Wiki.js pages with embedded images (base64 inline) can exceed the MCP response size limit. Two tools address this:
173
+
174
+ **`wikijs_get_page`** now accepts:
175
+ - `include_content=False` β€” returns metadata only, no content
176
+ - `max_content_chars=800000` β€” auto-truncates at ~800KB with a warning
177
+
178
+ **`wikijs_get_page_metadata`** β€” always fast, returns size info:
179
+ ```json
180
+ {
181
+ "pageId": 8,
182
+ "title": "Proxmox",
183
+ "content_size_kb": 2400.5,
184
+ "has_large_content": true,
185
+ "tip": "Use wikijs_get_page with include_content=False..."
186
+ }
187
+ ```
188
+
189
+ ---
190
+
191
+ ## 🐳 Docker Deployment (Remote HTTP Mode)
192
+
193
+ The Docker image is published on Docker Hub β€” no build required.
194
+
195
+ ### 1. Deploy on your server
196
+
197
+ ```bash
198
+ mkdir wiki-js-mcp && cd wiki-js-mcp
199
+ curl -O https://raw.githubusercontent.com/2rock-Inc/wiki-js-mcp-server/main/docker-compose.yml
200
+ curl -O https://raw.githubusercontent.com/2rock-Inc/wiki-js-mcp-server/main/config/example.env
201
+ cp example.env .env
202
+ nano .env
203
+ docker compose up -d
204
+ docker compose logs -f
205
+ ```
206
+
207
+ `.env` for Docker mode:
208
+
209
+ ```env
210
+ WIKIJS_URL=http://your-wiki-internal-ip:8090
211
+ WIKIJS_API_KEY=your_api_key_here
212
+ MCP_TRANSPORT=http
213
+ HTTP_HOST=0.0.0.0
214
+ HTTP_PORT=8000
215
+ WIKIJS_MCP_DB=/app/data/wikijs_mappings.db
216
+ LOG_FILE=/app/data/wikijs_mcp.log
217
+ ```
218
+
219
+ ### 2. Nginx reverse proxy
220
+
221
+ ```nginx
222
+ server {
223
+ listen 443 ssl;
224
+ server_name mcp-wiki.your-domain.com;
225
+
226
+ ssl_certificate /path/to/fullchain.pem;
227
+ ssl_certificate_key /path/to/privkey.pem;
228
+
229
+ auth_basic "Wiki MCP";
230
+ auth_basic_user_file /etc/nginx/.htpasswd-mcp;
231
+
232
+ location / {
233
+ proxy_pass http://your-server:8000;
234
+ proxy_http_version 1.1;
235
+
236
+ # Required for SSE / streaming
237
+ proxy_set_header Connection '';
238
+ proxy_buffering off;
239
+ proxy_cache off;
240
+ chunked_transfer_encoding on;
241
+ proxy_read_timeout 3600s;
242
+
243
+ proxy_set_header Host $host;
244
+ proxy_set_header X-Real-IP $remote_addr;
245
+ }
246
+ }
247
+ ```
248
+
249
+ ```bash
250
+ htpasswd -c /etc/nginx/.htpasswd-mcp your-user
251
+ nginx -t && systemctl reload nginx
252
+ ```
253
+
254
+ ### 3. Claude Desktop config (HTTP mode)
255
+
256
+ ```json
257
+ {
258
+ "mcpServers": {
259
+ "wikijs": {
260
+ "type": "http",
261
+ "url": "https://mcp-wiki.your-domain.com/mcp",
262
+ "headers": {
263
+ "Authorization": "Basic <base64(user:password)>"
264
+ }
265
+ }
266
+ }
267
+ }
268
+ ```
269
+
270
+ Generate the base64 value:
271
+ ```bash
272
+ echo -n "user:password" | base64
273
+ ```
274
+
275
+ ---
276
+
277
+ ## βš™οΈ Environment Variables
278
+
279
+ | Variable | Default | Description |
280
+ |----------|---------|-------------|
281
+ | `WIKIJS_URL` | `http://localhost:3000` | Wiki.js base URL |
282
+ | `WIKIJS_API_KEY` | β€” | API key (Full Access) |
283
+ | `WIKIJS_GRAPHQL_ENDPOINT` | `/graphql` | GraphQL endpoint path |
284
+ | `MCP_TRANSPORT` | `stdio` | `stdio` or `http` |
285
+ | `HTTP_HOST` | `0.0.0.0` | HTTP bind address |
286
+ | `HTTP_PORT` | `8000` | HTTP listen port |
287
+ | `WIKIJS_MCP_DB` | `./wikijs_mappings.db` | SQLite DB for file↔page mappings |
288
+ | `LOG_FILE` | `./wikijs_mcp.log` | Log file path (**use absolute path in stdio mode**) |
289
+ | `WIKIJS_DEFAULT_LOCALE` | *(empty)* | Locale for created/read pages. Empty = auto-detect the wiki's own default locale; set (e.g. `en`, `fr`) to force one |
290
+ | `LOG_LEVEL` | `INFO` | `DEBUG` / `INFO` / `WARNING` / `ERROR` |
291
+ | `DEFAULT_SPACE_NAME` | `Documentation` | Default space name for new structures |
292
+
293
+ ---
294
+
295
+ ## πŸ”‘ Getting a Wiki.js API Key
296
+
297
+ 1. Log into your Wiki.js instance as an administrator
298
+ 2. Navigate to **Administration β†’ API Access**
299
+ 3. Enable the API if not already enabled
300
+ 4. Click **New Key**
301
+ 5. Give it a name (e.g. `mcp-server`) and set permissions to **Full Access**
302
+ 6. Copy the key immediately β€” it won't be shown again
303
+
304
+ ---
305
+
306
+ ## πŸ” Troubleshooting
307
+
308
+ ### Claude Desktop: `Operation not permitted`
309
+ The shell script can't be executed due to macOS Gatekeeper. Use the Python binary directly instead:
310
+ ```json
311
+ "command": "/path/to/venv/bin/python",
312
+ "args": ["/path/to/src/server.py", "--stdio"]
313
+ ```
314
+
315
+ ### `Read-only file system` error on startup
316
+ You're using relative paths for `LOG_FILE` or `WIKIJS_MCP_DB`. Claude Desktop launches from `/`. Use absolute paths in `.env`.
317
+
318
+ ### `ModuleNotFoundError: No module named 'slugify'`
319
+ The venv may have been created with the wrong Python version. Recreate it:
320
+ ```bash
321
+ rm -rf venv
322
+ python3.12 -m venv venv
323
+ source venv/bin/activate
324
+ pip install -r requirements.txt
325
+ python -c "from slugify import slugify; print('OK')"
326
+ ```
327
+
328
+ ### Page too large β€” MCP response size exceeded
329
+ Use `wikijs_get_page_metadata` to check the page size, then either:
330
+ - Use `wikijs_get_page(include_content=False)` for metadata only
331
+ - Use `wikijs_get_page(max_content_chars=500000)` to truncate
332
+ - Clean up embedded base64 images in the Wiki.js editor (replace with proper media assets)
333
+
334
+ ### Connection or authentication errors
335
+ - Verify your `WIKIJS_URL` has no trailing slash
336
+ - Ensure the API is enabled in Wiki.js Administration
337
+ - Check that the API key has Full Access permissions
338
+ - Run `wikijs_connection_status` from Claude to get a detailed status
339
+
340
+ ---
341
+
342
+ ## πŸ“ Project Structure
343
+
344
+ ```
345
+ wiki-js-mcp-server/
346
+ β”œβ”€β”€ src/
347
+ β”‚ └── server.py # MCP server β€” all 24 tools
348
+ β”œβ”€β”€ config/
349
+ β”‚ └── example.env # Configuration template
350
+ β”œβ”€β”€ Dockerfile # python:3.12-slim, non-root user
351
+ β”œβ”€β”€ docker-compose.yml # Pulls hub2rock/wiki-js-mcp-server:latest
352
+ β”œβ”€β”€ setup.sh # Local setup script (Mac/Linux)
353
+ β”œβ”€β”€ start.sh # stdio launcher for Claude Desktop
354
+ β”œβ”€β”€ requirements.txt # Python dependencies
355
+ β”œβ”€β”€ pyproject.toml # Package metadata
356
+ └── LICENSE # MIT
357
+ ```
358
+
359
+ ---
360
+
361
+ ## 🏒 Example Workflows
362
+
363
+ ### Documentation-first development
364
+
365
+ Before writing any code, ask Claude to check existing patterns:
366
+ ```
367
+ Search my wiki for authentication patterns before I implement the login feature.
368
+ ```
369
+
370
+ ### Auto-scaffold a new project
371
+
372
+ ```
373
+ Create a complete documentation structure for my project "infra-2rock"
374
+ with sections: Overview, Architecture, Networking, Security, Runbooks.
375
+ ```
376
+
377
+ ### Sync a code change to docs
378
+
379
+ ```
380
+ I just refactored the Zabbix monitoring module. Sync the change to its wiki page
381
+ with this summary: "Migrated alert thresholds to external config file".
382
+ ```
383
+
384
+ ### Clean up after a project ends
385
+
386
+ ```
387
+ Delete the entire hierarchy under "old-project" including its root page.
388
+ ```
389
+
390
+ ---
391
+
392
+ ## πŸ› οΈ Technical Stack
393
+
394
+ - **[FastMCP 3.x](https://gofastmcp.com)** β€” Python MCP SDK
395
+ - **[httpx](https://www.python-httpx.org/)** β€” Async HTTP client for GraphQL
396
+ - **[SQLAlchemy](https://www.sqlalchemy.org/)** β€” SQLite ORM for file↔page mappings
397
+ - **[Pydantic Settings](https://docs.pydantic.dev/latest/concepts/pydantic_settings/)** β€” Environment configuration
398
+ - **[tenacity](https://tenacity.readthedocs.io/)** β€” Retry logic with exponential backoff
399
+ - **[uvicorn](https://www.uvicorn.org/)** β€” ASGI server for HTTP mode
400
+
401
+ ---
402
+
403
+ ## 🀝 Contributing
404
+
405
+ 1. Fork the repository
406
+ 2. Create a feature branch (`git checkout -b feature/my-feature`)
407
+ 3. Commit your changes (`git commit -m 'feat: add my feature'`)
408
+ 4. Push to the branch (`git push origin feature/my-feature`)
409
+ 5. Open a Pull Request
410
+
411
+ ---
412
+
413
+ ## πŸ™ Credits
414
+
415
+ Built on top of:
416
+ - **[talosdeus/wiki-js-mcp](https://github.com/talosdeus/wiki-js-mcp)** β€” hierarchical documentation tools, file↔page sync, SQLite mapping DB
417
+ - **[jaalbin24/wikijs-mcp-server](https://github.com/jaalbin24/wikijs-mcp-server)** β€” `move`, `list`, `tree` tools, HTTP/SSE transport architecture, Docker setup
418
+
419
+ ---
420
+
421
+ ## πŸ“„ License
422
+
423
+ [MIT](LICENSE) β€” free to use, modify, and redistribute with attribution.
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "wiki-js-mcp-server"
7
+ dynamic = ["version"]
8
+ description = "Wiki.js MCP server β€” 24 tools, dual transport stdio/HTTP, production-ready"
9
+ authors = [{name = "hub2rock"}]
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.11"
12
+ dependencies = [
13
+ "fastmcp>=2.0.0",
14
+ "httpx>=0.27.0",
15
+ "pydantic>=2.0.0",
16
+ "pydantic-settings>=2.0.0",
17
+ "python-slugify>=8.0.0",
18
+ "python-dotenv>=1.0.0",
19
+ "sqlalchemy>=2.0.0",
20
+ "tenacity>=8.0.0",
21
+ "uvicorn[standard]>=0.24.0",
22
+ "tzdata>=2024.1; sys_platform == 'win32'",
23
+ ]
24
+
25
+ [project.scripts]
26
+ wiki-js-mcp-server = "server:main"
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/2rock-Inc/wiki-js-mcp-server"
30
+ Repository = "https://github.com/2rock-Inc/wiki-js-mcp-server"
31
+
32
+ [tool.setuptools]
33
+ package-dir = {"" = "src"}
34
+ py-modules = ["server"]
35
+
36
+ [tool.setuptools.dynamic]
37
+ version = {attr = "server.__version__"}
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+