loading…
Search for a command to run...
loading…
An MCP server for Wiki.js projects that enables full-text search, page retrieval, and page management capabilities. It allows LLMs to interact with wiki content
An MCP server for Wiki.js projects that enables full-text search, page retrieval, and page management capabilities. It allows LLMs to interact with wiki content through specialized tools for searching, listing, and creating pages.
MCP server for a Wiki.js project. Provides full-text search, page retrieval, and optional page creation via the Model Context Protocol.
wiki.quote returns exact line ranges so answers can cite sources.┌──────────────┐ ┌───────────────────────┐
│ MCP Client │ │ Wiki.js (UI) │
│ (LM Studio / │ │ + Postgres │
│ Cursor / …) │ └──────────┬────────────┘
└──────┬───────┘ │
│ spawns (stdio) │
▼ │ reads/imports
┌───────────────────────┐ │ markdown
│ WikiMCP (this repo) │◄─────────┘
│ - tools: search/get/ │
│ quote/list/(create) │
└───────────────────────┘
Important: Docker is for Wiki.js + Postgres. The MCP server is typically spawned directly by your MCP client (no Docker required for the MCP server unless you want it).
git clone https://github.com/raydeStar/WikiMCP WikiMCP
cd WikiMCP
.\bootstrap-local.ps1 -OpenUi
http://localhost:3030./wiki-content.\bootstrap-local.ps1 -OpenUi
Uses ./wiki-content (characters, locations, chapters, etc.).
.\bootstrap-local.ps1 -ContentMode Empty -OpenUi
Creates ./wiki-content-empty with just the en/ locale folder (sample data stays untouched).
.\bootstrap-local.ps1 -ContentMode Path -ContentPath "D:\my-wiki" -OpenUi
Points to any folder on your machine.
.\bootstrap-local.ps1 -Reset -OpenUi
Removes Docker volumes and rebuilds from scratch. Your content folder survives.
After containers start:
http://localhost:3030file:///wiki-storageYour markdown files will appear in the wiki.
WikiMCP communicates via stdio (stdin/stdout). Your MCP client spawns the server directly.
npm install
npm run build
This produces dist/index.js.
Add to your MCP config (example file: mcp-config.example.json):
{
"mcpServers": {
"novel-wiki": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "C:/Users/YourName/WikiMCP",
"env": {
"WIKI_REPO_PATH": "C:/Users/YourName/WikiMCP/wiki-content",
"WIKI_WRITE_ENABLED": "false",
"MCP_AUTH_USERNAME": "",
"MCP_AUTH_PASSWORD": ""
}
}
}
}
Adjust paths for your system.
LM Studio can act as an MCP host as well. Add a server entry that spawns:
node dist/index.js …and pass WIKI_REPO_PATH to point at your content directory.If you’re used to normal APIs, MCP can feel weird at first. Here’s the simple mapping:
GET /pages/{id} and document them in OpenAPI.wiki.search, wiki.get_page, wiki.quote with JSON schemas.In other words:
A typical REST call:
GET /api/wiki/pages/TimA typical MCP call (conceptually):
call tool wiki.get_page({ path: "/characters/white-bunny" })The MCP client/host (LM Studio, Cursor, etc.) is the thing that:
If MCP_AUTH_USERNAME and MCP_AUTH_PASSWORD are both set, every tool call must include:
{
"auth": {
"username": "your-user",
"password": "your-pass"
},
"query": "The Knights who say Ni"
}
Bootstrap helpers:
.\bootstrap-local.ps1 -AuthFromDb
or:
.\bootstrap-local.ps1 -McpAuthUsername "admin" -McpAuthPassword "secret"
wiki.create_page is disabled by default.
Enable it by either:
.env:WIKI_WRITE_ENABLED=trueor
.\bootstrap-local.ps1 -WriteEnabled
| Tool | Description |
|---|---|
wiki.search |
Full-text search with optional filters (type, tags, path prefix) |
wiki.get_page |
Retrieve full page content by path |
wiki.quote |
Extract specific lines from a page (citations/receipts) |
wiki.list |
List pages, optionally filtered by type or tag |
wiki.reindex |
Rebuild the search index |
wiki.get_context_bundle |
Get everything about a topic: main page, related pages, summaries, citations |
wiki.create_page |
Create a new page (requires WIKI_WRITE_ENABLED=true) |
This is the bridge between librarian and editor. Instead of orchestrating multiple calls, ask:
{ "topic": "Kazalt", "maxPages": 5 }
Returns:
The model can now say "give me everything about X" and get a ready-to-use context bundle.
| Variable | Description | Default |
|---|---|---|
WIKI_DB_NAME |
Postgres database name | wikijs |
WIKI_DB_USER |
Postgres username | wikijs |
WIKI_DB_PASSWORD |
Postgres password | (required) |
WIKI_CONTENT_DIR |
Content folder path (Docker/Wiki.js) | ./wiki-content |
WIKI_WRITE_ENABLED |
Enable wiki.create_page |
false |
MCP_AUTH_USERNAME |
MCP auth username | (empty) |
MCP_AUTH_PASSWORD |
MCP auth password | (empty) |
WIKI_REPO_PATH |
Content path used by MCP server | /wiki |
DB_PATH |
SQLite index path | /app/data/wiki-index.db |
WikiMCP/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── indexer.ts # SQLite FTS indexer
│ └── config.ts # Environment config
├── wiki-content/ # Sample markdown content
├── docker-compose.yml # Local dev stack (Wiki.js + Postgres)
├── docker-compose.prod.yml # Production overrides
├── bootstrap-local.ps1 # PowerShell setup script
├── Dockerfile # Optional container for MCP server
└── .env.example # Environment template
Old Postgres volume credentials. Reset:
.\bootstrap-local.ps1 -Reset
Git safety check. The compose file configures safe.directory. Restart:
docker compose restart wiki-js
npm run build succeededWIKI_REPO_PATH points to real contentWikiMCP is not a traditional HTTP API meant for humans or frontends.
In practice:
wiki.search, wiki.quote).Think of it as "controllers for an AI client" rather than endpoints for a web app.
If you understand that one sentence, you understand MCP well enough to build useful things.
WikiMCP is intentionally simple. You probably should not use it if:
WikiMCP shines when:
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
WikiMCP intentionally mirrors the license of Wiki.js, which is also AGPL-3.0. This ensures:
If you are unfamiliar with AGPL, the practical takeaway is simple:
If you modify this project and make it available to users over a network, you must provide the source code of your modified version.
For personal use, learning, tinkering, and local deployments, AGPL imposes no additional burden.
See the LICENSE file for full terms.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"wikimcp": {
"command": "npx",
"args": []
}
}
}PRs, issues, code search, CI status
Database, auth and storage
Reference / test server with prompts, resources, and tools.
Secure file operations with configurable access controls.