MCP Tools
Reference
The MCP server exposes tools for AI assistants to interact with the wiki. Each tool is described below with its parameters and purpose.
Write tools (edit_document, write_document) are disabled by default. Administrators must enable them per wiki.
man
Self-documentation about all available MCP tools.
| Parameter | Type | Required | Description |
|---|---|---|---|
tool | string | optional | Tool name to get documentation for. Omit for the catalog of all tools. |
Built-in reference pages include xwiki-syntax (XWiki 2.1 syntax cheat-sheet).
query_documents
Search and browse XWiki documents using the wiki's Solr index.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | optional | Keyword search query. Supports Solr edismax syntax ("exact phrases", +required, -excluded, OR, wildcard*). Leave empty to browse by recency. |
space | string | optional | Space to filter by, including all subspaces. |
author | string | optional | Author to filter by (serialized user reference). |
modifiedWithin | string | optional | Time window: day, week, month, year. |
modifiedRange | string | optional | Explicit date range: 2024-01-01..2024-12-31. |
sort | string | optional | Sort order: relevance (default), newest, oldest, title. |
limit | integer | optional | Maximum results per page (capped at 25, default 10). |
offset | integer | optional | Results offset for pagination (default 0). |
includeHidden | boolean | optional | Include hidden documents (default false). |
wiki | string | optional | Target wiki id, or all for every reachable wiki. Only present when cross-wiki reach is enabled. |
Each result includes: title, document reference, modification date, author, and a relevance snippet.
get_document
Read an XWiki document's content as raw source (line-numbered) or rendered output.
| Parameter | Type | Required | Description |
|---|---|---|---|
reference | string | required | Document reference (for example Space.Page). |
rendered | boolean | optional | Return the executed view instead of raw source (default false). |
format | string | optional | Output format for rendered content: plain (default) or html. |
offset | integer | optional | Source line number to start reading from (1-indexed). |
limit | integer | optional | Maximum number of source lines to return. |
outline | boolean | optional | Force heading outline mode (default false). |
section | string | optional | Section anchor to read (from the outline). Rendered HTML only. |
detail | string | optional | Attribute detail level for rendered HTML: normal (default) or full. |
Returns: full content (up to ~6000 tokens), heading outline (for longer content), or the specified section/chunk.
edit_document
Edit a document by exact string replacement. Write tool — disabled by default.
| Parameter | Type | Required | Description |
|---|---|---|---|
reference | string | required | Document reference. |
edits | array | required | Array of edits: {old_string, new_string, replace_all}. |
title | string | optional | New document title (retitle without body edits). |
base_version | string | optional | Version the agent read (best-effort conflict check). |
comment | string | optional | Agent note appended as [AI] <comment> in the history. |
major | boolean | optional | Force major version bump (default false, minor edit). |
Edits apply in order as one save. Each old_string must match exactly and uniquely in the current source. Saves stamped [AI] with a compare-versions link.
write_document
Create a new document or replace an existing document's entire body. Write tool — disabled by default.
| Parameter | Type | Required | Description |
|---|---|---|---|
reference | string | required | Document reference for the new or existing document. |
content | string | required | Full body content in XWiki 2.1 syntax. |
title | string | optional | Document title (defaults to the page name from the reference). |
base_version | string | optional | Required for overwriting an existing document. The agent must read first. |
comment | string | optional | Agent note appended as [AI] <comment> in the history. |
major | boolean | optional | Force major version bump for overwrites (default false). |
Overwrites body content only. Objects, attachments, and rights are untouched.
list_wikis
List all wikis reachable from this MCP endpoint. No parameters.
Only registered when cross-wiki reach is enabled. Each listed wiki id is valid for the wiki parameter of query_documents and as a wiki prefix in document references.
search_collections (index module)
Search indexed collections using semantic similarity. Only available when the AI-LLM indexing module is installed.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | The text to search for. |
collections | array | optional | Collection IDs to search in. Omit to search all accessible collections. |
limitKeywordResults | integer | optional | Maximum keyword search results (default 10). |
limitSemanticResults | integer | optional | Maximum semantic similarity results (default 10). |
list_collections (index module)
List all collections available for searching. No parameters.
Only available when the AI-LLM indexing module is installed.