Wiki MCP
README.md
# Wiki MCP ๐
[](https://github.com/Dreamernosleep/wiki-mcp/actions/workflows/ci.yml)
[](https://github.com/Dreamernosleep/wiki-mcp/releases)
[](https://opensource.org/licenses/MIT)
[](https://nodejs.org/)
[](https://www.typescriptlang.org/)
> **An open-source company knowledge wiki with AI superpowers.**
> Markdown files + Smart search + MCP server + Web UI + Docker
Wiki MCP is a self-hosted knowledge base that combines the simplicity of **Markdown files** with the power of **AI agents** through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). Your wiki is just a folder of `.md` files โ git-friendly, portable, and yours forever.
## โจ Features
| Feature | Description |
|---------|-------------|
| ๐ **Markdown Files** | Your wiki is just `.md` files with YAML frontmatter โ edit in any editor! |
| ๐ค **MCP Server** | AI agents (Claude, pi, Cursor, etc.) can read, write, and search your wiki |
| ๐ **Smart Search** | Typo-tolerant search with [Meilisearch](https://www.meilisearch.com/) (fallback: SQLite FTS5) |
| ๐ **Web UI** | Clean black-and-white editor built with React + [shadcn/ui](https://ui.shadcn.com) โ live preview, split view, autocomplete, light/dark |
| ๐ **Wiki Links** | `[[page-slug]]` or `[[category/page-slug]]` with autocomplete while typing |
| ๐ **Dynamic Categories** | Create custom folders (categories) on the fly โ not just finance/ops/service |
| ๐ณ **Docker Ready** | One command to run everything: `docker compose up -d` |
| ๐ **File Watcher** | Edit files in VS Code/Obsidian โ changes auto-sync to search index |
| ๐ **Graph View** | See how pages connect with a full link graph |
| ๐ **Dual Transport** | MCP over stdio (local) or Streamable HTTP (Docker/remote) |
## ๐๏ธ Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ docker compose up โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Meilisearch โ โ Wiki API โ โ Web UI โ โ
โ โ (search) โโโโ (MCP+REST) โโโโ (browser) โ โ
โ โ :7700 โ โ :3000 โ โ :80 โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Volumes: content/ (markdown), data/ (SQLite) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
๐ค AI Agents (MCP) ๐ค Humans (Browser)
pi, Claude, Cursor... View & Edit
```
## ๐ Quick Start
### Option 1: Guided setup (Recommended)
```bash
git clone https://github.com/Dreamernosleep/wiki-mcp.git
cd wiki-mcp
npm run setup
```
The setup script checks for Node 22+ and Docker, creates your `.env`, generates a search-engine
password, asks for the ports (defaults: UI on 80, API on 3000), starts everything with Docker
Compose, and prints the URLs plus an MCP config block to paste into your AI tool. Re-running it is
safe: existing `.env` values are kept. Use `npm run setup -- --yes` for a non-interactive install.
### Option 1b: Plain Docker Compose
```bash
git clone https://github.com/Dreamernosleep/wiki-mcp.git
cd wiki-mcp
cp .env.example .env # optional: edit ports and MEILISEARCH_KEY
docker compose up -d # Meilisearch + API + Web UI
# Open http://localhost in your browser!
```
> **About Meilisearch:** it is an open-source search engine that runs as a local container here.
> No account, no external service, no cost. `MEILISEARCH_KEY` is simply a password that locks your
> own instance. If the container is unavailable the wiki falls back to SQLite full-text search.
### Option 2: Local Development
```bash
# Prerequisites: Node.js 22+, Docker (for Meilisearch)
# Install dependencies
npm install
# Start Meilisearch
docker run -d -p 7700:7700 getmeili/meilisearch
# Run the API in development mode (http://localhost:3000)
npm run dev
# In a second terminal, run the web UI (http://localhost:5173, proxies /api to :3000)
cd ui && npm install && npm run dev
```
### Option 3: MCP Only (for AI agents)
```bash
npm install && npm run build
# Run as MCP server (stdio)
MCP_TRANSPORT=stdio node dist/server.js
```
## ๐ Connect AI Agents
### pi / Claude Desktop (Local)
```json
{
"mcpServers": {
"wiki": {
"command": "node",
"args": ["/path/to/wiki-mcp/dist/server.js"],
"env": {
"MCP_TRANSPORT": "stdio",
"MEILISEARCH_URL": "http://localhost:7700"
}
}
}
}
```
### Claude Code / Cursor / Remote Agents (HTTP)
```json
{
"mcpServers": {
"wiki": {
"url": "http://localhost:3000/mcp"
}
}
}
```
## ๐ ๏ธ MCP Tools (11)
| Tool | Description |
|------|-------------|
| `list_categories` | List all wiki categories |
| `create_category` | Create a new category (folder) |
| `create_page` | Create a new page with markdown |
| `get_page` | Get a page by category/slug |
| `update_page` | Update a page's content |
| `delete_page` | Delete a page |
| `list_pages` | List all pages (filter by category) |
| `search_pages` | Smart search (typo-tolerant, ranked) |
| `get_linked_pages` | Get pages linked to/from a page |
| `get_graph` | Get the full link graph |
| `sync_files` | Force sync from markdown files |
## ๐ REST API
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/categories` | List categories |
| `POST` | `/api/categories` | Create category |
| `DELETE` | `/api/categories/:id` | Delete empty category |
| `GET` | `/api/pages` | List pages (`?category=finance`) |
| `GET` | `/api/pages/:category/:slug` | Get a page |
| `POST` | `/api/pages` | Create a page |
| `PUT` | `/api/pages/:category/:slug` | Update a page |
| `DELETE` | `/api/pages/:category/:slug` | Delete a page |
| `GET` | `/api/search?q=...` | Search pages |
| `GET` | `/api/search/suggest?q=...` | Autocomplete suggestions |
| `GET` | `/api/graph` | Get link graph |
| `GET` | `/api/pages/:cat/:slug/links` | Get linked pages |
| `POST` | `/api/sync` | Force file sync |
| `GET` | `/api/raw/:category/:slug` | Get raw markdown |
| `GET` | `/health` | Health check |
## ๐ Project Structure
```
wiki-mcp/
โโโ .github/ # GitHub Actions, issue templates
โโโ src/
โ โโโ server.ts # MCP + REST API server
โ โโโ db.ts # SQLite (graph, metadata)
โ โโโ files.ts # Markdown file I/O
โ โโโ search.ts # Meilisearch client
โ โโโ watcher.ts # File watcher (auto-sync)
โ โโโ sync.ts # Manual sync script
โโโ ui/ # Web UI (Vite + React + shadcn/ui)
โ โโโ src/
โ โ โโโ App.tsx # App state and layout
โ โ โโโ components/ # Sidebar, editor, preview, dialogs (+ ui/ from shadcn)
โ โ โโโ lib/ # API client, markdown rendering
โ โ โโโ styles/
โ โ โโโ brand.css # โ
All colours, radius, fonts โ edit to re-theme
โ โ โโโ index.css # Tailwind + token mapping
โ โโโ BRANDING.md # How to change colours / name
โ โโโ Dockerfile # Builds the bundle, serves it with nginx
โ โโโ nginx.conf.template # Serves the app and proxies /api to the API
โโโ content/ # Your wiki (markdown files)
โ โโโ finance/
โ โโโ operations/
โ โโโ service/
โ โโโ clients/ # Custom categories!
โโโ data/ # SQLite database
โโโ docker-compose.yml # One-command setup
โโโ Dockerfile # Wiki API container
โโโ README.md
```
## ๐ Markdown Format
Pages are stored as markdown files with YAML frontmatter:
```markdown
---
id: abc123-uuid
category: finance
slug: q4-budget
title: Q4 Budget Planning
created: 2026-10-27
updated: 2026-10-27
created_by: agent
---
# Q4 Budget Planning
The Q4 budget depends on [[operations/procurement]] timelines.
## Key Figures
- Revenue target: $2.5M
```
## ๐ Wiki Links
Link pages with `[[slug]]` or `[[category/slug]]`:
```markdown
See [[operations/procurement]] for details.
Or use full path: [[finance/expense-policy]]
```
## ๐จ Theming the Web UI
The UI ships black-and-white with a light/dark toggle. Every colour, the corner radius and the fonts
live in **one file**: [`ui/src/styles/brand.css`](ui/src/styles/brand.css). Change `--primary` there
and every button, active row, focus ring and link follows. See [`ui/BRANDING.md`](ui/BRANDING.md)
for a walkthrough, including how to set a brand colour instead of black.
## ๐งช Development
```bash
# Run tests
npm test
# Test MCP client
npm run test:mcp
# Manual sync (rebuild DB from files)
npm run sync
# Docker commands
npm run docker:build
npm run docker:up
npm run docker:down
npm run docker:logs
```
## ๐ค Contributing
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
- ๐ [Report a Bug](.github/ISSUE_TEMPLATE/bug_report.md)
- ๐ก [Request a Feature](.github/ISSUE_TEMPLATE/feature_request.md)
- ๐ [Security Policy](SECURITY.md)
- ๐ [Code of Conduct](CODE_OF_CONDUCT.md)
## ๐ License
This project is licensed under the [MIT License](LICENSE) โ see the LICENSE file for details.
## ๐ Acknowledgments
- [Model Context Protocol](https://modelcontextprotocol.io/) โ AI agent integration
- [Meilisearch](https://www.meilisearch.com/) โ Smart search engine
- [shadcn/ui](https://ui.shadcn.com/) + [Tailwind CSS](https://tailwindcss.com/) โ Web UI components
- [Marked.js](https://marked.js.org/) โ Markdown rendering
- [Chokidar](https://github.com/paulmillr/chokidar) โ File watching
- [node:sqlite](https://nodejs.org/api/sqlite.html) โ Database
---
<p align="center">
Made with โค๏ธ for the open source community
</p>
<p align="center">
<a href="https://github.com/Dreamernosleep/wiki-mcp">โญ Star us on GitHub</a>
</p>
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues