MCP Server

Last modified by Michael Hamann on 2026/05/08 09:54

 XWiki
 Feature
 Idea
 
No

Description

The idea of this proposal is to implement an MCP server as an extension that allows querying and modifying pages. Important design criteria:

  • The extension works out of the box without further configuration
  • User authentication and rights are fully supported
  • Write access can be disabled (might be disabled by default) to avoid uncontrolled changes by AI
  • Care is taken to ensure that tools are token-efficient and don't, e.g., flood the context of the LLM with huge page contents

Configuration

A configuration section for the administration area should be provided. It should provide the following main settings:

  • Name of the MCP server (default is shown, can be reset to default)
  • Description of the MCP server (default is shown, can be reset to default)
  • Allow edit access

An advanced configuration section should allow the following settings:

  • Which tools are exposed
  • Change names help and descriptions of the tools and their parameters, with the default values shown and the possibility to reset to the default

The idea of these configuration options is to allow users to adjust descriptions and tools to their wiki, providing the connecting AI agents, e.g., important information about the contents and the structure of the wiki that allows the agent to better decide when to use the MCP server or the descriptions of a page creation tool could inform the AI agent about page naming policies.

Internal API

A separate API module should provide a component role that allows any other module to implement MCP tools. The implementations of the role should expose the definition of the tool and the implementation that is called when the tool is called. The MCP server module should then depend on this API module and expose the tools as an actual MCP server API. It could further contain definitions of standard tools. The chunk retrieval search tool that is currently in the MCP server itself should be moved to the index for the LLM application which should depend on the API module of the MCP server. The MCP server shouldn't depend on the LLM application but it should still expose the chunk search when the index for the LLM application is installed. The API to define tools should be based on the MCP specification but research should also be performed on Java agent frameworks to understand how the defined tools could be re-used in a future agent in XWiki itself.

Exposed Tools

The MCP server should expose in some way tools for at least the following tasks:

  • Search using Solr search including a way for the agent to discover the way metadata is indexed to understand which fields can be queried. Facets could also be provided as an extra flag or tool. Search results should contain page names/titles and minimal snippets to allow agents to see which results are potentially relevant.
  • Retrieve the structure of a page (headings, list objects and their types)
  • Retrieve page contents including all metadata, with the ability to filter by structure and line/byte indexes.
  • Perform targeted edits by some search/replace tool (mirroring what coding agents use)
  • Verify edits by retrieving diffs

 


Get Connected