Wiki.js MCP Server

Wiki.js MCP Server

An MCP server that provides a unified interface to manage Wiki.js pages, users, and groups via GraphQL API, enabling AI agents to create, read, update, and delete content and perform administrative tasks.

Category
Visit Server

README

Wiki.js MCP Server

MCP License Node.js

Model Context Protocol (MCP) server for Wiki.js integration via GraphQL API.

šŸ“– Description

This project provides an MCP server for interacting with Wiki.js through GraphQL API. MCP (Model Context Protocol) is an open protocol developed by Anthropic that enables AI models to safely interact with external services and tools.

The server provides a unified interface for working with Wiki.js that can be used by various AI agents and tools supporting MCP.

✨ Features

šŸ“„ Page Management

  • Get Wiki.js pages by ID
  • Get page content by ID
  • List pages with sorting options
  • Search pages by query
  • Create new pages
  • Update existing pages
  • Delete pages
  • šŸ†• List all pages including unpublished
  • šŸ†• Search unpublished pages
  • šŸ†• Force delete pages (including unpublished)
  • šŸ†• Get page publication status
  • šŸ†• Publish unpublished pages

šŸ‘„ User Management

  • List users
  • Search users by query
  • Create new users
  • Update user information

šŸ”§ Group Management

  • List user groups

🌐 Transports

  • STDIO: for editor integration (Cursor, VS Code)
  • HTTP: for web integrations and API access

šŸš€ Quick Start

⚔ Want to start right now? See 5-Minute Guide

Installation

  1. Clone the repository:
git clone https://github.com/heAdz0r/wikijs-mcp-server.git
cd wikijs-mcp-server
  1. Run automatic setup:
npm run setup

This script will automatically:

  • Install dependencies
  • Create .env file based on example.env
  • Build TypeScript code

Configuration

  1. Edit the .env file and specify your Wiki.js settings:
# Port for HTTP MCP server
PORT=3200

# Base URL for Wiki.js (without /graphql)
WIKIJS_BASE_URL=http://localhost:3000

# Wiki.js API token
WIKIJS_TOKEN=your_wikijs_api_token_here
  1. Edit the .cursor/mcp.json file and replace your_wikijs_api_token_here with your real token

How to get Wiki.js API token:

  1. Log into Wiki.js admin panel
  2. Go to "API" section
  3. Create a new API key with necessary permissions
  4. Copy the token to .env AND to .cursor/mcp.json

šŸ“¦ Running

HTTP server (recommended)

# Start main HTTP server with Cursor MCP support
npm start
# or
npm run start:http

# Stop server
npm run stop

TypeScript version

npm run start:typescript

STDIO mode (for direct editor integration)

npm run server:stdio

Development mode

npm run dev

Testing

npm test

šŸ”Œ Editor Integration

Cursor IDE

āš ļø IMPORTANT: Without .cursor/mcp.json file, Cursor integration will NOT work!

Quick Setup

  1. Start HTTP server:
npm start
  1. Automatic configuration setup:
npm run setup:cursor
  1. Edit .cursor/mcp.json and specify your real token:
{
  "mcpServers": {
    "wikijs": {
      "transport": "http",
      "url": "http://localhost:3200/mcp",
      "events": "http://localhost:3200/mcp/events",
      "cwd": ".",
      "env": {
        "WIKIJS_BASE_URL": "http://localhost:3000",
        "WIKIJS_TOKEN": "your_real_wiki_js_token_here"
      }
    }
  }
}

Critical Parameters

  • transport: "http" - mandatory HTTP transport
  • url: "http://localhost:3200/mcp" - exact URL for JSON-RPC
  • events: "http://localhost:3200/mcp/events" - URL for Server-Sent Events
  • WIKIJS_TOKEN - real Wiki.js API token (not placeholder!)

Verification

After setup, tools with mcp_wikijs_* prefix should appear in Cursor:

  • mcp_wikijs_list_pages()
  • mcp_wikijs_search_pages()
  • mcp_wikijs_get_page()
  • And others...

VS Code (with MCP extension)

Add to VS Code settings:

{
  "mcp.servers": {
    "wikijs": {
      "command": "node",
      "args": ["lib/mcp_wikijs_stdin.js"],
      "cwd": "/path/to/wikijs-mcp"
    }
  }
}

šŸ›  Development

Project Structure

wikijs-mcp-server/
ā”œā”€ā”€ src/                    # TypeScript source code
│   ā”œā”€ā”€ server.ts          # HTTP server
│   ā”œā”€ā”€ tools.ts           # Tool definitions
│   ā”œā”€ā”€ api.ts             # Wiki.js API client
│   ā”œā”€ā”€ types.ts           # Data types
│   ā”œā”€ā”€ schemas.ts         # Zod validation schemas
│   └── README.md          # Source code documentation
ā”œā”€ā”€ lib/                   # JavaScript library files
│   ā”œā”€ā”€ fixed_mcp_http_server.js    # Main HTTP server (compiled)
│   ā”œā”€ā”€ mcp_wikijs_stdin.js         # STDIN server for editors
│   ā”œā”€ā”€ mcp_client.js               # Demo MCP client
│   ā”œā”€ā”€ mcp_wrapper.js              # MCP protocol utilities
│   └── README.md                   # Library documentation
ā”œā”€ā”€ scripts/               # Management scripts
│   ā”œā”€ā”€ setup.sh          # Initial setup
│   ā”œā”€ā”€ start_http.sh     # Start HTTP server
│   ā”œā”€ā”€ stop_server.sh    # Stop HTTP server
│   ā”œā”€ā”€ start_typescript.sh # Start TypeScript version
│   ā”œā”€ā”€ setup_cursor_mcp.sh # Cursor setup
│   ā”œā”€ā”€ test.sh           # Run tests
│   ā”œā”€ā”€ test_mcp.js       # Test HTTP server
│   ā”œā”€ā”€ test_mcp_stdin.js # Test STDIN server
│   └── README.md         # Scripts documentation
ā”œā”€ā”€ .cursor/               # Cursor MCP configuration
│   └── mcp.json          # MCP configuration file (CRITICALLY IMPORTANT!)
ā”œā”€ā”€ dist/                  # Compiled TypeScript code
ā”œā”€ā”€ package.json           # Project metadata
└── README.md             # Main documentation

🚨 CRITICALLY IMPORTANT: .cursor/mcp.json file is required for Cursor integration!

Available Scripts

Setup and Build

  • npm run setup - Initial project setup
  • npm run build - Build TypeScript project
  • npm run setup:cursor - Setup Cursor integration

Running Servers

  • npm start / npm run start:http - HTTP MCP server (port 3200)
  • npm run stop - Stop all MCP servers
  • npm run start:typescript - TypeScript version of server (port 8000)
  • npm run server:stdio - STDIO version for direct integration

Development and Testing

  • npm run dev - Development mode with hot reload
  • npm run demo - Capability demonstration
  • npm test - Run tests
  • npm run client - Run demo client

API Endpoints (HTTP mode)

  • GET /tools - List of available tools
  • GET /health - Server health check
  • POST /mcp - MCP JSON-RPC endpoint

Usage Examples

// Get list of pages
{
  "method": "list_pages",
  "params": {
    "limit": 10,
    "orderBy": "TITLE"
  }
}

// Create new page
{
  "method": "create_page",
  "params": {
    "title": "New Page",
    "content": "# Title\n\nContent...",
    "path": "folder/new-page"
  }
}

### Search for pages:
```python
# Search in all content and metadata
result = await mcp_client.call_tool("search_pages", {
    "query": "magic system",
    "limit": 5
})

Working with Unpublished Pages:

# Get all pages including unpublished ones
all_pages = await mcp_client.call_tool("list_all_pages", {
    "limit": 100,
    "includeUnpublished": True
})

# Search only unpublished pages
unpublished = await mcp_client.call_tool("search_unpublished_pages", {
    "query": "draft",
    "limit": 10
})

# Check page publication status
status = await mcp_client.call_tool("get_page_status", {
    "id": 42
})

# Publish an unpublished page
result = await mcp_client.call_tool("publish_page", {
    "id": 42
})

# Force delete page (works with unpublished pages)
result = await mcp_client.call_tool("force_delete_page", {
    "id": 42
})

User management:

# List all users
users = await mcp_client.call_tool("list_users")

# Search users by query
search_result = await mcp_client.call_tool("search_users", {
    "query": "John"
})

# Create new user
new_user = await mcp_client.call_tool("create_user", {
    "email": "john@example.com",
    "name": "John Doe",
    "passwordRaw": "password123",
    "providerKey": "local",
    "groups": [1],
    "mustChangePassword": false,
    "sendWelcomeEmail": true
})

# Update user information
updated_user = await mcp_client.call_tool("update_user", {
    "id": 1,
    "name": "John Doe Updated"
})

šŸ› Troubleshooting

Connection Issues

  1. Ensure Wiki.js is running and accessible
  2. Check WIKIJS_BASE_URL correctness
  3. Verify API token is valid

MCP Issues

  1. Check Node.js version (requires >=18.0.0)
  2. Ensure all dependencies are installed
  3. Check server logs for errors

šŸ“š Documentation

šŸ¤ Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

šŸ“„ License

This project is distributed under the MIT License. See LICENSE file for details.

šŸ”— Useful Links

⭐ Support

If this project helped you, please give it a ⭐ on GitHub!

Have questions? Create an Issue or refer to the documentation.

šŸ†• New Feature: Automatic URLs

Search Stages

Search works in 4 stages:

  1. GraphQL API search - fast search through indexed content
  2. Metadata search - search in titles, paths, and page descriptions
  3. HTTP content search - deep search in page content via HTTP
  4. Forced verification - fallback search on known pages

Usage Examples

Content Search

{
  "method": "search_pages",
  "params": {
    "query": "ZELEBOBA",
    "limit": 5
  }
}

Result:

[
  {
    "id": 103,
    "path": "test/test-page",
    "title": "Test Page",
    "description": "Test page to demonstrate Wiki.js API capabilities",
    "url": "http://localhost:8080/en/test/test-page"
  }
]

Title Search

{
  "method": "search_pages",
  "params": {
    "query": "find me",
    "limit": 3
  }
}

Result:

[
  {
    "id": 108,
    "path": "test/test-gemini-mcp",
    "title": "Test Gemini MCP Page (find me)",
    "url": "http://localhost:8080/en/test/test-gemini-mcp"
  }
]

New Search Benefits

  • āœ… Finds pages even with limited API permissions - uses HTTP fallback
  • āœ… Multi-level search - combines multiple strategies
  • āœ… Content search - finds text inside pages
  • āœ… Metadata search - titles, paths, descriptions
  • āœ… Fallback methods - guaranteed results for known pages
  • āœ… Correct URLs - all results contain ready-to-use links

Technical Details

HTML Content Processing

The system automatically extracts text from HTML using:

  • Search in <template slot="contents"> block
  • HTML tags and entities cleanup
  • Fallback to full page content

With limited GraphQL API permissions, the system:

  • Switches to HTTP method for content retrieval
  • Uses direct requests to HTML pages
  • Preserves all page metadata

šŸ“ Changelog

Version 1.3.0 - Unpublished Pages Management (Latest)

šŸ†• New Features:

  • list_all_pages - Get all pages including unpublished ones
  • search_unpublished_pages - Search specifically in unpublished pages
  • force_delete_page - Enhanced deletion that works with unpublished pages
  • get_page_status - Check publication status of any page
  • publish_page - Publish unpublished pages programmatically

šŸ”§ Improvements:

  • Enhanced server API with new routes for unpublished page management
  • Better error handling for page deletion operations
  • Comprehensive GraphQL mutation support for advanced page operations
  • Restructured project: Moved JavaScript files to lib/ directory for better organization

šŸ› Bug Fixes:

  • Fixed issues with accessing unpublished pages through standard APIs
  • Improved authentication handling for admin-level operations

Version 1.2.0 - International Release

šŸŒ Internationalization:

  • Complete English translation of documentation
  • README.md and QUICK_START.md now available in English
  • Prepared for international market expansion

Version 1.1.0 - Enhanced Search & User Management

✨ Features:

  • Smart multi-method page search (GraphQL + content + metadata)
  • User management tools (create, update, search)
  • Group management capabilities
  • Improved content extraction from HTML pages

šŸ› ļø Available Tools

šŸ“„ Page Tools

Tool Name Description Parameters
get_page Get page information by ID id: number
get_page_content Get page content by ID id: number
list_pages List pages with sorting limit?: number, orderBy?: string
search_pages Search pages by query query: string, limit?: number
create_page Create new page title: string, content: string, path: string, description?: string, tags?: string[]
update_page Update existing page id: number, content: string
delete_page Delete page id: number
list_all_pages šŸ†• List all pages including unpublished limit?: number, orderBy?: string, includeUnpublished?: boolean
search_unpublished_pages šŸ†• Search only unpublished pages query: string, limit?: number
force_delete_page šŸ†• Force delete page (works with unpublished) id: number
get_page_status šŸ†• Get page publication status id: number
publish_page šŸ†• Publish unpublished page id: number

šŸ‘„ User Tools

Tool Name Description Parameters
list_users List all users None
search_users Search users by query query: string
create_user Create new user email: string, name: string, passwordRaw: string, providerKey?: string, groups?: number[], mustChangePassword?: boolean, sendWelcomeEmail?: boolean
update_user Update user information id: number, name: string

šŸ”— Group Tools

Tool Name Description Parameters
list_groups List user groups None

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured