The Model Context Protocol (MCP) is an open protocol that enables AI assistants like Claude to interact with external tools and services. An MCP server provides a collection of "tools" (functions) that Claude can call during a conversation.
Benefits of MCP:
Without MCP Server:
With MCP Server:
This MCP server enables Claude to interact directly with your Wiki.js instance:
1. Automatic Documentation After Plugin Development
You: "I just finished developing the Ticket Merge Plugin.
Create comprehensive technical documentation in Wiki.js."
Claude: *Analyzes the code, architecture, and API*
*Automatically creates a structured wiki page with:*
- Technical overview
- Architecture diagrams
- API documentation
- Code examples
- Troubleshooting guide
2. Knowledge Management During Development
You: "Search Wiki.js for all osTicket plugin documentations
and show me the naming conventions."
Claude: *Searches in Wiki.js*
*Extracts relevant information*
*Applies it to your current code*
3. Content Reorganization
You: "All pages under /legacy/ should be moved to /archive/."
Claude: *Lists all /legacy/ pages*
*Systematically moves them to /archive/*
*Updates internal links*
# Create MCP server directory
mkdir -p ~/.claude/mcp-servers/wikijs
# Clone repository
git clone https://github.com/markus-michalski/wikijs-mcp-server.git ~/.claude/mcp-servers/wikijs
cd ~/.claude/mcp-servers/wikijs
npm install
cd ~/.claude/mcp-servers/wikijs
cp .env.example .env
Edit ~/.claude/mcp-servers/wikijs/.env:
WIKIJS_API_URL=https://your-wiki-instance.com/graphql
WIKIJS_API_TOKEN=your-api-token-here
Important: The server automatically loads the .env file when started.
Claude Code MCP Serverread:pages - Read pageswrite:pages - Create and update pagesmanage:pages - Delete and move pages~/.claude/mcp-servers/wikijs/.envEdit ~/.claude.json and add the wikijs server to the global mcpServers section:
{
"mcpServers": {
"wikijs": {
"type": "stdio",
"command": "node",
"args": [
"/home/YOUR_USERNAME/.claude/mcp-servers/wikijs/index.js"
],
"env": {}
}
}
}
Note: Replace /home/YOUR_USERNAME/ with your actual home directory path.
# Exit Claude Code
/exit
# Restart Claude Code
claude
Verify the connection:
/mcp
You should see "wikijs" with status "β connected".
Creates a new page in Wiki.js.
Parameters:
path (required) - Page path (e.g., "osticket/plugin-name")title (required) - Page titlecontent (required) - Page content (Markdown or HTML)description (required) - Short page descriptionlocale (optional) - Language (default: "en")editor (optional) - Editor type: "markdown", "code", "ckeditor" (default: "markdown")isPublished (optional) - Publish immediately (default: true)isPrivate (optional) - Private page with restricted access (default: false)tags (optional) - Array of tags (default: [])Example:
{
"path": "osticket/ticket-merge-plugin",
"title": "Ticket Merge Plugin - Technical Documentation",
"content": "# Technical Documentation\\n\\n...",
"description": "Detailed technical documentation for the Ticket Merge Plugin",
"locale": "en",
"editor": "markdown",
"isPublished": true,
"isPrivate": false,
"tags": ["osticket", "plugin", "development"]
}
Updates an existing page.
Parameters:
id (required) - Page IDcontent (optional) - New contenttitle (optional) - New titledescription (optional) - New descriptionisPublished (optional) - Publication statustags (optional) - New tags arrayExample:
{
"id": 8,
"content": "# Updated Content\\n\\nNew information...",
"tags": ["osticket", "plugin", "updated"]
}
Retrieves a page by ID or path.
Parameters:
id (optional) - Page IDpath (optional) - Page path (required if no ID)locale (optional) - Language (required when using path)Examples:
// By ID
{ "id": 5 }
// By path
{ "path": "osticket/plugin-name", "locale": "en" }
β οΈ Important Note on Tags:
The get_page tool does not return tags. This is a limitation of the Wiki.js GraphQL API - the tags field is only supported by pages.list(), not by pages.single() or pages.singleByPath().
Workaround: If you need tags for a specific page, use list_pages instead and filter the results by ID or path.
Lists all pages with optional filtering. This tool also returns tags!
Parameters:
locale (optional) - Filter by languagelimit (optional) - Maximum results (default: 100)Example:
{
"locale": "en",
"limit": 50
}
Searches pages by query string.
Parameters:
query (required) - Search querylocale (optional) - Filter by languageExample:
{
"query": "osTicket plugin",
"locale": "en"
}
Deletes a page (irreversible!).
Parameters:
id (required) - Page ID to deleteExample:
{ "id": 123 }
Moves a page to a new path.
Parameters:
id (required) - Page IDdestinationPath (required) - New pathdestinationLocale (optional) - Target language (default: "en")Example:
{
"id": 8,
"destinationPath": "projects/osticket/ticket-merge",
"destinationLocale": "en"
}
After finishing a plugin, automatically create comprehensive Wiki.js documentation:
You in Claude Code:
"I just finished developing the Ticket Merge Plugin.
Create a comprehensive technical wiki page"
Claude:
1. Analyzes the code in src/
2. Reads the README.md
3. Extracts API endpoints, classes, methods
4. Generates structured Markdown documentation
5. Automatically creates wiki page with:
- Architecture overview
- Component structure
- API documentation
- Code examples
- Troubleshooting tips
You: "Add a section about performance optimization to the
Ticket Merge Plugin page"
Claude:
1. Retrieves current page via get_page
2. Analyzes existing content
3. Generates new section
4. Updates page via update_page
You: "Find all osTicket pages and move them under projects/osticket/"
Claude:
1. Searches via search_pages for "osTicket"
2. Lists found pages
3. Moves each page via move_page to new path
4. Provides summary
Typical Workflow:
Benefits:
Problem: .env file not found or incomplete
Solution:
.env exists at ~/.claude/mcp-servers/wikijs/.envWIKIJS_API_URL and WIKIJS_API_TOKEN are set.env.example for correct formatProblem: API token lacks required permissions
Solution:
read:pageswrite:pagesmanage:pagesProblem: Wrong API URL
Solution:
WIKIJS_API_URL in ~/.claude/mcp-servers/wikijs/.env/graphqlhttps://your-wiki.com/graphqlProblem: MCP configuration not loaded or server startup failed
Solution:
~/.claude.json syntax (must be valid JSON)index.js is correct.env file exists/mcp in Claude Code to see server status/exit then restart)wikijs-mcp-server/
βββ index.js # MCP server entry point
βββ package.json # Dependencies
βββ .env # Configuration (not in Git)
βββ .env.example # Configuration template
βββ src/
β βββ client.js # Wiki.js GraphQL client
β βββ tools/
β βββ create-page.js
β βββ update-page.js
β βββ get-page.js
β βββ list-pages.js
β βββ search-pages.js
β βββ delete-page.js
β βββ move-page.js
βββ README.md
Use a clear hierarchy for wiki paths:
projects/osticket/plugins/ticket-merge
projects/oxid/modules/payment-gateway
tutorials/symfony/testing
Use tags for better searchability:
tags: ["osticket", "plugin", "api", "development"]
Good descriptions help with search:
description: "Technical documentation for osTicket Ticket Merge Plugin with API reference"
MIT License - See LICENSE file for details
Markus Michalski