AX

alfredfs85/xwiki-mcp-server

Developer tools
4 stars 6 forks Quality 73 Trend 12MIT

MCP server for xWiki

Overview

MCP (Model Context Protocol) server for interacting with XWiki instances. This server allows you to search, read, and create pages in XWiki through the REST API. - : Search pages in XWiki using the search API - : Get the full content of any XWiki page - : Create or update pages in XWiki using XWiki syntax - Docker and Docker Compose installed - Node.js 20+ (if running without Docker) - Access to an XWiki instance with REST API enabled 2. Configure environment variables by creating a .env file: The server will be available at http://localhost:3000 If you need HTTPS, you can use the setup.sh script to generate self-signed SSL certificates: : Generated certificates (server.key and server.crt) are in .gitignore and will not be uploaded to the repository. Returns the server status and XWiki configuration.

README

XWiki MCP Server

MCP (Model Context Protocol) server for interacting with XWiki instances. This server allows you to search, read, and create pages in XWiki through the REST API.

🚀 Features

  • Article Search: Search pages in XWiki using the search API
  • Page Reading: Get the full content of any XWiki page
  • Page Creation/Update: Create or update pages in XWiki using XWiki syntax

📋 Prerequisites

  • Docker and Docker Compose installed
  • Node.js 20+ (if running without Docker)
  • Access to an XWiki instance with REST API enabled

🔧 Installation

  1. Clone the repository:
git clone https://github.com/alfredfs85/xwiki-mcp-server.git
cd xwiki-mcp-server
  1. Configure environment variables by creating a .env file:
XWIKI_URL=https://your-xwiki-instance.com
XWIKI_USERNAME=your_username
XWIKI_PASSWORD=your_password
XWIKI_WIKI=xwiki
  1. Build and run the container:
docker-compose up -d --build
  1. Verify the server is running:
curl http://localhost:3000/health

Option 2: Local Execution

  1. Install dependencies:
npm install
  1. Configure environment variables:
export XWIKI_URL=https://your-xwiki-instance.com
export XWIKI_USERNAME=your_username
export XWIKI_PASSWORD=your_password
export XWIKI_WIKI=xwiki
  1. Run the server:
node server.js

The server will be available at http://localhost:3000

🔐 SSL Configuration (Optional)

If you need HTTPS, you can use the setup.sh script to generate self-signed SSL certificates:

chmod +x setup.sh
./setup.sh --ssl

Note: Generated certificates (server.key and server.crt) are in .gitignore and will not be uploaded to the repository.

📡 Endpoints

Health Check

GET /health

Returns the server status and XWiki configuration.

MCP JSON-RPC

POST /mcp

Main endpoint for MCP communication using JSON-RPC 2.0.

Server-Sent Events (SSE)

GET /sse
POST /messages?sessionId={sessionId}

Alternative endpoints for communication via Server-Sent Events.

🛠️ Available Tools

search_xwiki

Searches for articles in XWiki.

Parameters:

  • query (required): Search term
  • limit (optional): Maximum number of results (default: 10)

Example:

{
  "method": "tools/call",
  "params": {
    "name": "search_xwiki",
    "arguments": {
      "query": "documentation",
      "limit": 5
    }
  }
}

get_xwiki_page

Gets the content of an XWiki page.

Parameters:

  • page_path (required): Page path (e.g., Main.WebHome or Space.Page)

Example:

{
  "method": "tools/call",
  "params": {
    "name": "get_xwiki_page",
    "arguments": {
      "page_path": "Main.WebHome"
    }
  }
}

create_xwiki_page

Creates or updates a page in XWiki.

Parameters:

  • page_path (required): Page path
  • title (required): Page title
  • content (required): Content in XWiki syntax

Example:

{
  "method": "tools/call",
  "params": {
    "name": "create_xwiki_page",
    "arguments": {
      "page_path": "Test.MyPage",
      "title": "My Test Page",
      "content": "= Title =\n\nPage content..."
    }
  }
}

🔌 Integration with Cursor/Claude Desktop

To use this MCP server with Cursor or Claude Desktop, add the following configuration to your MCP configuration file:

{
  "mcpServers": {
    "xwiki": {
      "url": "http://localhost:3000/mcp",
      "transport": "http"
    }
  }
}

🐳 Environment Variables

Variable Description Default
PORT Server port 3000
XWIKI_URL Your XWiki instance URL -
XWIKI_USERNAME Username for authentication -
XWIKI_PASSWORD Password for authentication -
XWIKI_WIKI Wiki name xwiki
MCP_MODE MCP operation mode http
NODE_TLS_REJECT_UNAUTHORIZED Disable SSL validation (development only) 0

📝 Security Notes

  • ⚠️ Never commit credentials to the repository
  • ⚠️ Self-signed SSL certificates are for development only
  • ⚠️ In production, use valid certificates and set NODE_TLS_REJECT_UNAUTHORIZED=1
  • ⚠️ The .env file is in .gitignore for security

🤝 Contributing

Contributions are welcome. Please:

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

📄 License

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

🐛 Reporting Issues

If you encounter any issues, please open an issue on the GitHub repository.

👤 Author

alfredfs85

🙏 Acknowledgments

  • XWiki for their excellent platform and REST API
  • The Model Context Protocol team for the MCP standard
View the full README on GitHub

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "xwiki": { "url": "http://localhost:3000/mcp", "transport": "http" } } }