A Model Context Protocol (MCP) server that provides seamless integration between Claude Desktop and Wiki.js instances. This server enables AI assistants to interact with Wiki.js through a standardized protocol, allowing for comprehensive page management, user operations, and content search capabilities.
- π Page Management: Create, read, update, and delete Wiki.js pages
- π₯ User Operations: Search and retrieve user information
- π Group Management: List and manage user groups
- π Content Search: Search pages by title or content
- π SSL Support: Configurable SSL certificate handling
- β‘ Type Safety: Full TypeScript implementation with comprehensive type definitions
- π MCP Protocol: Standard Model Context Protocol implementation
- Node.js 18+
- npm or yarn
- Wiki.js instance with API access
- Valid Wiki.js API token
git clone <repository-url>
cd mcp-wikijs
npm installcp .env.example .envEdit the .env file:
WIKIJS_URL=https://your-wiki.example.com
WIKIJS_API_TOKEN=your_api_token_here
NODE_TLS_REJECT_UNAUTHORIZED=0 # Only for self-signed certificatesnpm run buildnode examples/test-connection.js| Variable | Description | Required | Default |
|---|---|---|---|
WIKIJS_URL |
Base URL of your Wiki.js instance | β Yes | - |
WIKIJS_API_TOKEN |
API token for authentication | β Yes | - |
NODE_TLS_REJECT_UNAUTHORIZED |
SSL certificate validation (0=disabled, 1=enabled) | β No | 1 |
Add the following configuration to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"wikijs": {
"command": "node",
"args": ["/absolute/path/to/mcp-wikijs/dist/index.js"],
"env": {
"WIKIJS_URL": "https://your-wiki.example.com",
"WIKIJS_API_TOKEN": "your_api_token_here"
}
}
}
}| Tool | Description | Parameters |
|---|---|---|
search_pages |
Search for pages by title or content | query, limit |
get_page |
Retrieve a specific page | id or path |
create_page |
Create a new page | title, content, path, etc. |
update_page |
Update an existing page | id, title, content, etc. |
delete_page |
Delete a page | id |
list_pages |
List all pages with pagination | limit, offset |
| Tool | Description | Parameters |
|---|---|---|
search_users |
Search for users | query, limit |
get_user |
Get user information by ID | id |
| Tool | Description | Parameters |
|---|---|---|
list_groups |
List all user groups | None |
const { WikiJsClient } = require('./dist/wikijs-client');
const client = new WikiJsClient({
baseUrl: process.env.WIKIJS_URL,
apiToken: process.env.WIKIJS_API_TOKEN
});
// Create a new page
const newPage = await client.createPage({
title: 'My New Page',
content: '# Welcome\n\nThis is my new page content.',
path: 'my-new-page',
description: 'A sample page created via API',
tags: ['documentation', 'api']
});
// Search for pages
const searchResults = await client.searchPages({
query: 'documentation',
limit: 10
});
// Get a specific page
const page = await client.getPage({ path: 'my-new-page' });
// Update a page
const updatedPage = await client.updatePage({
id: page.id,
title: 'Updated Page Title',
content: '# Updated Content\n\nThis page has been updated.'
});
// List all pages
const allPages = await client.listPages({ limit: 50, offset: 0 });
// Search users
const users = await client.searchUsers({ query: 'admin', limit: 5 });
// List groups
const groups = await client.listGroups();mcp-wikijs/
βββ π src/
β βββ π index.ts # MCP server implementation
β βββ π wikijs-client.ts # Wiki.js API client
βββ π dist/ # Compiled JavaScript
βββ π examples/ # Usage examples and tests
β βββ π test-connection.js
β βββ π usage-example.js
β βββ π claude-desktop-config.json
βββ π docs/ # Documentation
β βββ π journal.md # Development journal
βββ π .env.example # Environment template
βββ π package.json # Dependencies and scripts
βββ π tsconfig.json # TypeScript configuration
βββ π README.md # This file
new WikiJsClient(config: WikiJsConfig)Parameters:
config.baseUrl: Wiki.js instance URLconfig.apiToken: API authentication token
searchPages(params: SearchPagesParams)
interface SearchPagesParams {
query: string; // Search query string
limit?: number; // Maximum results (default: 10)
}getPage(params: GetPageParams)
interface GetPageParams {
id?: number; // Page ID (optional)
path?: string; // Page path (optional)
// Note: Either id or path must be provided
}createPage(params: CreatePageParams)
interface CreatePageParams {
title: string; // Page title
content: string; // Page content in markdown
path: string; // URL slug
description?: string; // Page description
tags?: string[]; // Array of tags
isPublished?: boolean; // Published status (default: true)
isPrivate?: boolean; // Private status (default: false)
locale?: string; // Page locale (default: 'en')
editor?: string; // Editor type (default: 'markdown')
}updatePage(params: UpdatePageParams)
interface UpdatePageParams {
id: number; // Page ID to update
title?: string; // New title
content?: string; // New content
description?: string; // New description
tags?: string[]; // New tags
isPublished?: boolean; // Published status
isPrivate?: boolean; // Private status
}deletePage(params: DeletePageParams)
interface DeletePageParams {
id: number; // Page ID to delete
}listPages(params: ListPagesParams)
interface ListPagesParams {
limit?: number; // Maximum pages (default: 50)
offset?: number; // Skip pages (default: 0)
}searchUsers(params: SearchUsersParams)
interface SearchUsersParams {
query: string; // Search query
limit?: number; // Maximum results (default: 10)
}getUser(params: GetUserParams)
interface GetUserParams {
id: number; // User ID
}listGroups()
- No parameters required
- Returns array of user groups
npm run build# Test connection
node examples/test-connection.js
# Run usage examples
node examples/usage-example.js
# Type checking
npx tsc --noEmit# Start the MCP server
node dist/index.js
# The server will run on stdio and wait for MCP protocol messagesError: self signed certificate
Solution: Set NODE_TLS_REJECT_UNAUTHORIZED=0 in your .env file for self-signed certificates (development only).
Wiki.js API Error: 401 - Unauthorized
Solution:
- Verify your API token is valid
- Check that the token has sufficient permissions
- Ensure the Wiki.js API endpoint is accessible
Wiki.js API Error: 400 - Bad Request
Solution:
- Ensure Wiki.js version compatibility
- Check API token permissions for specific operations
- Verify GraphQL query syntax
ERR_MODULE_NOT_FOUND
Solution:
- Run
npm installto ensure all dependencies are installed - Verify Node.js version (18+ required)
- Check that the project has been built with
npm run build
Enable debug logging:
DEBUG=wikijs-mcp:* node dist/index.jsIf you encounter MCP schema validation errors:
- Ensure
zod-to-json-schemais installed - Verify all tool definitions use
zodToJsonSchema()conversion - Check that JSON Schema format is properly applied
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Maintain comprehensive type definitions
- Update documentation for new features
- Add tests for new functionality
- Follow existing code style and patterns
MIT License - see LICENSE file for details.
For issues and questions:
- π Check the troubleshooting section
- π Review existing GitHub issues
- π Create a new issue with detailed information
- π Check the development journal for recent changes
- Model Context Protocol for the MCP specification
- Wiki.js for the excellent wiki platform
- Anthropic for Claude Desktop integration
Status: β
Production Ready
Last Updated: August 8, 2025
Version: 1.0.0