MCP Tools

Last modified by gabrielc on 2026/07/13 16:53

Content

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
toolstring 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
querystring optional Keyword search query. Supports Solr edismax syntax ("exact phrases", +required, -excluded, OR, wildcard*). Leave empty to browse by recency.
spacestring optional Space to filter by, including all subspaces.
authorstring optional Author to filter by (serialized user reference).
modifiedWithinstring optional Time window: day, week, month, year.
modifiedRangestring optional Explicit date range: 2024-01-01..2024-12-31.
sortstring optional Sort order: relevance (default), newest, oldest, title.
limitinteger optional Maximum results per page (capped at 25, default 10).
offsetinteger optional Results offset for pagination (default 0).
includeHiddenboolean optional Include hidden documents (default false).
wikistring 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
referencestring required Document reference (for example Space.Page).
renderedboolean optional Return the executed view instead of raw source (default false).
formatstring optional Output format for rendered content: plain (default) or html.
offsetinteger optional Source line number to start reading from (1-indexed).
limitinteger optional Maximum number of source lines to return.
outlineboolean optional Force heading outline mode (default false).
sectionstring optional Section anchor to read (from the outline). Rendered HTML only.
detailstring 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
referencestring required Document reference.
editsarray required Array of edits: {old_string, new_string, replace_all}.
titlestring optional New document title (retitle without body edits).
base_versionstring optional Version the agent read (best-effort conflict check).
commentstring optional Agent note appended as [AI] <comment> in the history.
majorboolean 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
referencestring required Document reference for the new or existing document.
contentstring required Full body content in XWiki 2.1 syntax.
titlestring optional Document title (defaults to the page name from the reference).
base_versionstring optional Required for overwriting an existing document. The agent must read first.
commentstring optional Agent note appended as [AI] <comment> in the history.
majorboolean 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
querystring required The text to search for.
collectionsarray optional Collection IDs to search in. Omit to search all accessible collections.
limitKeywordResultsinteger optional Maximum keyword search results (default 10).
limitSemanticResultsinteger 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.

Get Connected