Markus Michalski FAQ

Wiki.js MCP Server: Configuration

Configure the Wiki.js MCP Server: environment variables, .env lookup order, creating the API key and the limits that are built into the code.

Deutsche Version

Back to overview

Configuration

The server has exactly two settings. Everything else (timeout, size limits) is hard-wired in the code.

Environment variables

Variable Required Default Description
WIKIJS_API_URL yes none GraphQL endpoint of your Wiki.js instance, e.g. https://wiki.example.com/graphql
WIKIJS_API_TOKEN yes none Wiki.js API key, sent as a bearer token

If either variable is missing, the server exits at startup with exit code 1 and the message Error: Missing required environment variables. The server does not check that the URL ends in /graphql; it sends requests to the URL exactly as configured.

Where the server looks for the .env file

The order is fixed:

  1. If ~/.claude/mcp-servers/wikijs/.env exists (in the home directory of the user starting the server), only that file is loaded.
  2. Otherwise the server loads a .env from the current working directory of the process.

The .env in the repository is only found if the process is started with the repository as its working directory. If your MCP client launches the server from another directory, put the file at ~/.claude/mcp-servers/wikijs/.env or set the variables in the client configuration.

Variables that are already set in the process environment (for example through the client configuration) are not overridden by the .env file.

Example .env:

WIKIJS_API_URL=https://wiki.example.com/graphql
WIKIJS_API_TOKEN=your-api-token-here

Create the API key in Wiki.js

  1. In Wiki.js open the administration and go to API Access.
  2. Create a new key and give it a name, for example MCP Server.
  3. Copy the generated token into the .env file.

.env.example lists read:pages, write:pages and manage:pages as the required permissions. The server itself checks no permissions; whether a call is allowed is decided by Wiki.js alone. A key without write permissions makes the writing tools fail with an error message from Wiki.js, see Troubleshooting.

Fixed limits

These values cannot be configured.

Limit Value Effect
API timeout 30 seconds The request then aborts with Request timed out. Please try again.
Truncation on read 100,000 characters Longer page content is truncated on retrieval and marked with a notice
Content on write max. 500,000 characters Larger content values are rejected by validation
Tags per page max. 50, each max. 100 characters Validation
Pages per list call default 50, max. 200 Validation of limit
Title max. 200 characters Validation
Description max. 500 characters Validation
Search query 2 to 200 characters Validation
Page path 1 to 500 characters, see Tools reference Validation