Provides tools for interacting with a Wiki.js project, enabling full-text search, page retrieval, page listing, and optional page creation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WikiMCPsearch for the character profile of Kazalt"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
What this repo gives you
A Wiki.js stack (Wiki.js + Postgres) you can run locally with Docker.
An MCP server (Node/TypeScript) that exposes Wiki tools over stdio (spawned by a client like LM Studio / Cursor / Claude Desktop).
Receipts-first tooling:
wiki.quotereturns exact line ranges so answers can cite sources.
Architecture in one picture
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).
Quick Start (sample data)
Wiki.js opens at:
http://localhost:3030The stack includes sample content in
./wiki-content
Setup paths (choose your adventure)
1) Local with sample data (default)
Uses ./wiki-content (characters, locations, chapters, etc.).
2) Local with empty wiki
Creates ./wiki-content-empty with just the en/ locale folder (sample data stays untouched).
3) Local with custom content path
Points to any folder on your machine.
4) Reset everything (wipe DB, keep content)
Removes Docker volumes and rebuilds from scratch. Your content folder survives.
Wiki.js first-run setup
After containers start:
Open
http://localhost:3030Complete the Wiki.js setup wizard (create admin account)
Go to Administration → Storage → Local File System (or Git)
Set the path to:
file:///wiki-storageClick Apply and Import Everything
Your markdown files will appear in the wiki.
Connect an LLM / MCP client (the fun part)
WikiMCP communicates via stdio (stdin/stdout). Your MCP client spawns the server directly.
1) Build the MCP server
This produces dist/index.js.
2) Configure your MCP client
Cursor / Claude Desktop (example)
Add to your MCP config (example file: mcp-config.example.json):
Adjust paths for your system.
LM Studio (concept)
LM Studio can act as an MCP host as well. Add a server entry that spawns:
node dist/index.js…and passWIKI_REPO_PATHto point at your content directory.
MCP vs REST/Swagger (1-minute version)
If you’re used to normal APIs, MCP can feel weird at first. Here’s the simple mapping:
REST/Swagger: You design lots of URLs like
GET /pages/{id}and document them in OpenAPI.MCP: You expose a tool list (functions) like
wiki.search,wiki.get_page,wiki.quotewith JSON schemas.
In other words:
REST is resource-oriented (endpoints)
MCP is capability-oriented (tools)
A typical REST call:
GET /api/wiki/pages/Tim
A 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:
discovers the tool list
decides when to call a tool
feeds tool results back into the model
MCP Authentication (optional) (optional)
If MCP_AUTH_USERNAME and MCP_AUTH_PASSWORD are both set, every tool call must include:
Bootstrap helpers:
or:
Write operations
wiki.create_page is disabled by default.
Enable it by either:
.env:
set
WIKI_WRITE_ENABLED=trueensure your wiki content mount is not read-only
or
bootstrap flag:
Available MCP tools
Tool | Description |
| Full-text search with optional filters (type, tags, path prefix) |
| Retrieve full page content by path |
| Extract specific lines from a page (citations/receipts) |
| List pages, optionally filtered by type or tag |
| Rebuild the search index |
| Get everything about a topic: main page, related pages, summaries, citations |
| Create a new page (requires |
wiki.get_context_bundle (the power tool)
This is the bridge between librarian and editor. Instead of orchestrating multiple calls, ask:
Returns:
mainPage: Full content of the best-match page
relatedPages: Summaries of linked and related pages
citations: Version info for every page (receipts)
totalPagesFound: How many matches exist
The model can now say "give me everything about X" and get a ready-to-use context bundle.
Environment variables
Variable | Description | Default |
| Postgres database name |
|
| Postgres username |
|
| Postgres password | (required) |
| Content folder path (Docker/Wiki.js) |
|
| Enable |
|
| MCP auth username | (empty) |
| MCP auth password | (empty) |
| Content path used by MCP server |
|
| SQLite index path |
|
Project structure
Troubleshooting
“password authentication failed”
Old Postgres volume credentials. Reset:
“detected dubious ownership in repository”
Git safety check. The compose file configures safe.directory. Restart:
MCP server not connecting
Ensure
npm run buildsucceededEnsure absolute paths in the MCP client config
Ensure
WIKI_REPO_PATHpoints to real content
How this differs from a normal REST API (quick intuition)
WikiMCP is not a traditional HTTP API meant for humans or frontends.
A REST API exposes endpoints (URLs) and HTTP verbs.
An MCP server exposes tools (named capabilities with JSON schemas).
In practice:
Your MCP client (LM Studio, Cursor, Claude Desktop) spawns this server.
The server advertises its tools (e.g.
wiki.search,wiki.quote).The LLM decides which tool to call and with what arguments.
WikiMCP enforces validation, permissions, and returns structured results.
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.
When not to use WikiMCP
WikiMCP is intentionally simple. You probably should not use it if:
You only want a normal REST API over your wiki
You don’t need citations or exact quotes
You don’t plan to use an LLM with tool-calling
WikiMCP shines when:
You want an LLM to prove where it got information
You’re experimenting with agents, RAG, or MCP
You want a clean learning project that scales into something real
License
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:
Clear legal alignment with the upstream project
Transparency for anyone running modified versions as a service
A shared expectation that improvements remain open
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.