
alfredfs85/xwiki-mcp-server
Developer toolsMCP 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
Option 1: Using Docker (Recommended)
- Clone the repository:
git clone https://github.com/alfredfs85/xwiki-mcp-server.git
cd xwiki-mcp-server
- Configure environment variables by creating a
.envfile:
XWIKI_URL=https://your-xwiki-instance.com
XWIKI_USERNAME=your_username
XWIKI_PASSWORD=your_password
XWIKI_WIKI=xwiki
- Build and run the container:
docker-compose up -d --build
- Verify the server is running:
curl http://localhost:3000/health
Option 2: Local Execution
- Install dependencies:
npm install
- 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
- 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 termlimit(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.WebHomeorSpace.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 pathtitle(required): Page titlecontent(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
.envfile is in.gitignorefor security
🤝 Contributing
Contributions are welcome. Please:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - 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
- GitHub: @alfredfs85
🙏 Acknowledgments
- XWiki for their excellent platform and REST API
- The Model Context Protocol team for the MCP standard
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"
}
}
}