requarks-wiki-mcp
An MCP server that enables AI agents to interact with Wiki.js as a knowledge base through a comprehensive set of 29 tools for content retrieval and management. It supports full-text search, page versioning, and asset browsing with optional write operations secured by safety gates.
README
requarks-wiki-mcp
MCP server for a Wiki.js instance that lets agents use it like a knowledge base.
Features:
- 29 tools (19 read + 10 write) covering pages, comments, tags, assets, users, navigation, and system info.
- Search, list, and browse pages for retrieval workflows (RAG-like usage).
- Fetch page content by path or page ID, view version history and restore previous versions.
- Browse site hierarchy with page tree, page links graph, and navigation structure.
- Full comment system: list, read, create, update, and delete comments on pages.
- Asset and folder browsing for media file discovery.
- User context: current user profile and user search.
- System diagnostics: version info, site config, and navigation tree.
- Tag management: list, search, update, and delete tags.
- Optional page create/update/delete/move/restore tools with explicit safety gates.
- Built-in resources: markdown syntax guide, Mermaid diagram guide, and API permissions guide.
- Typed error taxonomy with LLM-friendly error messages.
- GraphQL client with timeout, exponential-backoff retry, and request correlation.
- Security hardening: sensitive field filtering, URL validation, input length limits.
Requirements
- Node.js 20+
- A reachable Wiki.js hostname
- Wiki.js API key (JWT) with proper permissions
Setup
cp .env.example .env
npm install
Configure .env:
WIKI_BASE_URL=https://your-wiki-hostname
WIKI_API_TOKEN=your_wikijs_api_key_jwt
WIKI_GRAPHQL_PATH=/graphql
WIKI_DEFAULT_LOCALE=en
WIKI_DEFAULT_EDITOR=markdown
# Mutating operations are disabled by default
WIKI_MUTATIONS_ENABLED=false
# Optional extra safety gate for writes. If set, write tools must pass matching confirm.
WIKI_MUTATION_CONFIRM_TOKEN=
WIKI_MUTATION_DRY_RUN=true
# Comma-separated path prefixes without leading slash (empty = no prefix restriction)
WIKI_ALLOWED_MUTATION_PATH_PREFIXES=
# HTTP resilience
WIKI_HTTP_TIMEOUT_MS=15000
WIKI_HTTP_MAX_RETRIES=2
Environment variable reference:
| Variable | Required | Default | Description |
|---|---|---|---|
WIKI_BASE_URL |
Yes | - | Base Wiki.js URL (for example, https://wiki.example.com). |
WIKI_API_TOKEN |
Yes | - | Wiki.js API key JWT used in Authorization: Bearer .... |
WIKI_GRAPHQL_PATH |
No | /graphql |
GraphQL endpoint path appended to WIKI_BASE_URL. |
WIKI_DEFAULT_LOCALE |
No | en |
Default locale used when tool input does not provide locale. |
WIKI_DEFAULT_EDITOR |
No | markdown |
Default editor used for page creation when not specified. |
WIKI_MUTATIONS_ENABLED |
No | false |
Enables all write tools (page, comment, and tag mutations) when set to true. |
WIKI_MUTATION_CONFIRM_TOKEN |
No | `` (empty) | Optional extra safety gate. When set, write tool calls must provide matching confirm. |
WIKI_MUTATION_DRY_RUN |
No | true |
When true, mutation tools return preview only and do not write to Wiki.js. |
WIKI_ALLOWED_MUTATION_PATH_PREFIXES |
No | `` (empty) | Comma-separated path prefixes (without leading slash) allowed for mutations. Empty means no prefix restriction. |
WIKI_HTTP_TIMEOUT_MS |
No | 15000 |
HTTP request timeout in milliseconds (including body reads). Minimum 1. |
WIKI_HTTP_MAX_RETRIES |
No | 2 |
Max retries for transient read failures (408, 502-504). Mutations are never retried. Minimum 0. |
Wiki.js prerequisite (GraphQL + API key):
- This MCP uses Wiki.js GraphQL internally.
- In Wiki.js admin, go to
Administration -> APIand enable API access. - Create an API key and set it as
WIKI_API_TOKEN.
MCP Client Config Example (~/.mcp.json)
{
"mcpServers": {
"requarks-wiki": {
"command": "npx",
"args": ["-y", "@yowu-dev/requarks-wiki-mcp@latest"],
"env": {
"WIKI_BASE_URL": "https://wiki.your-domain.dev",
"WIKI_API_TOKEN": "your_wikijs_api_key_jwt",
"WIKI_GRAPHQL_PATH": "/graphql",
"WIKI_DEFAULT_LOCALE": "en",
"WIKI_DEFAULT_EDITOR": "markdown",
"WIKI_MUTATIONS_ENABLED": "true",
"WIKI_MUTATION_CONFIRM_TOKEN": "CONFIRM_UPDATE",
"WIKI_MUTATION_DRY_RUN": "false",
"WIKI_ALLOWED_MUTATION_PATH_PREFIXES": "",
"WIKI_HTTP_TIMEOUT_MS": "15000",
"WIKI_HTTP_MAX_RETRIES": "2"
}
}
}
}
Register MCP Via Local Path (Without npm Publish)
You can register this MCP server directly from your local project path without publishing/installing from npm.
- Build in this repository
npm install
npm run build
- Register local absolute path in
~/.mcp.json
{
"mcpServers": {
"requarks-wiki-local": {
"command": "node",
"args": ["/absolute/path/to/requarks-wiki-mcp/dist/index.js"],
"env": {
"WIKI_BASE_URL": "https://wiki.your-domain.dev",
"WIKI_API_TOKEN": "your_wikijs_api_key_jwt",
"WIKI_GRAPHQL_PATH": "/graphql",
"WIKI_DEFAULT_LOCALE": "en",
"WIKI_DEFAULT_EDITOR": "markdown",
"WIKI_MUTATIONS_ENABLED": "true",
"WIKI_MUTATION_CONFIRM_TOKEN": "",
"WIKI_MUTATION_DRY_RUN": "false",
"WIKI_ALLOWED_MUTATION_PATH_PREFIXES": "",
"WIKI_HTTP_TIMEOUT_MS": "15000",
"WIKI_HTTP_MAX_RETRIES": "2"
}
}
}
}
Notes:
- Always use an absolute path.
- Re-run
npm run buildafter code changes sodist/index.jsstays up to date.
Run
Development:
npm run dev
Build + run:
npm run build
npm start
MCP Tools
Read Tools (19)
Pages:
| Tool | Description |
|---|---|
wikijs_search_pages |
Full-text search across wiki pages. |
wikijs_list_pages |
List pages with optional locale filter and limit. |
wikijs_get_page_by_path |
Get full page content by path + locale. |
wikijs_get_page_by_id |
Get full page content by numeric ID. |
wikijs_get_page_tree |
Browse site hierarchy (folders, pages, or both). |
wikijs_get_page_history |
View edit history trail for a page. |
wikijs_get_page_version |
Get a specific version's full content. |
wikijs_get_page_links |
Get page link relationships (knowledge graph). |
Tags:
| Tool | Description |
|---|---|
wikijs_list_tags |
List all tags for content taxonomy discovery. |
wikijs_search_tags |
Search for tags matching a query string. |
Comments:
| Tool | Description |
|---|---|
wikijs_list_comments |
List all comments for a page by path and locale. |
wikijs_get_comment |
Get a single comment by ID. |
System & Navigation:
| Tool | Description |
|---|---|
wikijs_get_system_info |
Wiki.js version, database type, and usage statistics. |
wikijs_get_navigation |
Navigation tree structure. |
wikijs_get_site_config |
Site configuration (non-sensitive fields). |
Assets:
| Tool | Description |
|---|---|
wikijs_list_assets |
List assets with optional folder and kind filter. |
wikijs_list_asset_folders |
List asset folders. |
Users:
| Tool | Description |
|---|---|
wikijs_get_current_user |
Get the currently authenticated API user's profile. |
wikijs_search_users |
Search users by name or email. |
Write Tools (10, disabled unless WIKI_MUTATIONS_ENABLED=true)
Page Mutations:
| Tool | Description |
|---|---|
wikijs_create_page |
Create a new page with content, tags, and metadata. |
wikijs_update_page |
Update an existing page by ID. |
wikijs_delete_page |
Delete a page by ID. May need manage:pages or delete:pages. |
wikijs_move_page |
Move/rename a page to a new path or locale. |
wikijs_restore_page |
Restore a page to a previous version. |
Comment Mutations:
| Tool | Description |
|---|---|
wikijs_create_comment |
Create a comment on a page. |
wikijs_update_comment |
Update an existing comment by ID. |
wikijs_delete_comment |
Delete a comment by ID. |
Tag Mutations:
| Tool | Description |
|---|---|
wikijs_update_tag |
Update a tag's slug and title. |
wikijs_delete_tag |
Delete a tag from all pages. |
Mutation Safety
- When
WIKI_MUTATION_CONFIRM_TOKENis set, mutation tools require a matchingconfirmargument. - When
WIKI_MUTATION_DRY_RUN=true, write tools return a preview and do not mutate Wiki.js. - If
WIKI_ALLOWED_MUTATION_PATH_PREFIXESis set, page and comment-create mutations are limited to those path prefixes. - All mutation attempts write a structured audit line to stderr.
MCP Resources
| Resource URI | Description |
|---|---|
wikijs://markdown-guide |
Wiki.js markdown syntax guide (CommonMark/GFM + Wiki.js-specific extensions) intended for page authoring and updates. |
wikijs://mermaid-guide |
Mermaid 8.8.2 diagram syntax guide for Wiki.js (9 supported diagram types, unsupported feature warnings, version restrictions). |
wikijs://api-permissions-guide |
Wiki.js API permission model, error codes, and API key configuration guide for self-diagnosing permission errors. |
Permission Notes (Wiki.js)
Wiki.js permission behavior can be surprising for API keys. In particular:
- Some operations may require
manage:pages/delete:pagesrules at page-rule level. - Reading
contentmay requireread:sourcedepending on schema/field-level checks. - Comment operations require
read:comments,write:comments, ormanage:comments. - System info and navigation require admin-level API key permissions.
Common error codes:
| Code | Meaning |
|---|---|
| 6013 | PageViewForbidden — check group permissions + page rules for read:pages/read:source |
| 6003 | Page does not exist |
| 8002 | CommentPostForbidden |
| 8003 | CommentNotFound |
| 8004 | CommentViewForbidden |
| 8005 | CommentManageForbidden |
For more details, read the wikijs://api-permissions-guide resource.
Suggested Minimum API Key Permissions
For read-heavy KB use:
read:pages,read:sourceread:comments(for comment browsing)- Page rules allowing those permissions for intended paths/locales
For write workflows:
write:pages(create and update)manage:pagesordelete:pages(for delete/move operations)write:comments,manage:comments(for comment mutations)manage:system(for tag management)
Security Guidance
- Keep API token server-side only.
- Start with read-only permissions.
- Keep
WIKI_MUTATIONS_ENABLED=falseunless updates are needed. - Optional hardening: set a strong random
WIKI_MUTATION_CONFIRM_TOKENand pass matchingconfirmfor write calls. - Keep
WIKI_MUTATION_DRY_RUN=trueuntil you are ready for real writes. - Use
WIKI_ALLOWED_MUTATION_PATH_PREFIXESto constrain write scope. wikijs_get_system_infofilters sensitive infrastructure fields (dbHost, configFile, etc.) by default.scriptJs/scriptCssfields in page create/update are length-limited (10,000 chars) and include browser execution warnings.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。