Odoo-by-Endare/dokuwiki-mcp
If you are the rightful owner of dokuwiki-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Docker-based solution that provides AI assistants with authenticated access to DokuWiki documentation via the Model Context Protocol (MCP).
DokuWiki MCP Server
A Docker-based solution that provides AI assistants with authenticated access to DokuWiki documentation via the Model Context Protocol (MCP).
Architecture: Claude Code → DokuWiki (with native MCP plugin) → DokuWiki XML-RPC API
Features
- Native MCP Integration: Uses DokuWiki's official MCP plugin - no Python middleware needed
- Bearer Token Authentication: Secure token-based authentication
- HTTPS Ready: Supports both local development (self-signed) and production (Lightsail automatic HTTPS)
- 30+ MCP Tools: Full access to DokuWiki's Remote API
- Single Container: Simple, lightweight deployment
Quick Start
Local Development
- Start the stack:
docker-compose up -d
-
Access DokuWiki: http://localhost:8080
- Username:
admin - Password:
change_this_password(set in docker-compose.yml)
- Username:
-
Generate Bearer Token:
- Login to DokuWiki
- Go to your profile
- Copy the auto-generated Bearer token
-
Connect Claude Code:
claude mcp add --transport http dokuwiki http://localhost:8080/lib/plugins/mcp/mcp.php \
--header "Authorization: Bearer YOUR_TOKEN_HERE"
Production Deployment (AWS Lightsail)
- Configure credentials:
cp .env.production.example .env.production
# Edit .env.production with your values
-
Update Docker Hub username in
deploy-lightsail.sh -
Deploy:
./deploy-lightsail.sh
-
Generate Bearer Token from your production DokuWiki instance
-
Connect Claude Code:
claude mcp add --transport http dokuwiki https://your-domain.amazonlightsail.com/lib/plugins/mcp/mcp.php \
--header "Authorization: Bearer YOUR_TOKEN_HERE"
MCP Tools Available
The native plugin exposes 30+ tools including:
Page Operations:
core_getPage- Read wiki page contentcore_savePage- Save/update pagescore_appendPage- Append to pagescore_getPageHTML- Get rendered HTMLcore_getPageInfo- Get page metadatacore_getPageHistory- Get revision history
Search & Discovery:
core_listPages- List all pagescore_searchPages- Full-text searchcore_getPageBackLinks- Find backlinkscore_getPageLinks- Get page links
Media Files:
core_getMedia- Download filescore_saveMedia- Upload filescore_listMedia- List media filescore_deleteMedia- Delete files
Other:
core_getRecentPageChanges- Recent changescore_lockPages/core_unlockPages- Page locking
Architecture
Single Container Setup
┌─────────────────────────────────────┐
│ Docker Container │
│ │
│ ┌──────────────────────────────┐ │
│ │ DokuWiki │ │
│ │ ┌────────────────────────┐ │ │
│ │ │ Native MCP Plugin │ │ │
│ │ │ (PHP) │ │ │
│ │ └────────────────────────┘ │ │
│ │ │ │ │
│ │ │ │ │
│ │ ┌──────▼──────────────────┐ │ │
│ │ │ XML-RPC API │ │ │
│ │ └─────────────────────────┘ │ │
│ └──────────────────────────────┘ │
│ │
│ Apache (HTTP/HTTPS) │
└─────────────────────────────────────┘
│
│ Bearer Token Auth
▼
Claude Code MCP Client
Why This Approach?
The previous implementation used a Python MCP server as middleware between Claude and DokuWiki's XML-RPC API. This new approach:
- ✅ Simpler: Single container vs 3 containers (DokuWiki + Python MCP + Nginx)
- ✅ Native: Uses official DokuWiki MCP plugin
- ✅ Lightweight: No Python dependencies
- ✅ Maintainable: Follows DokuWiki's official patterns
- ✅ Secure: Bearer token authentication built into DokuWiki
Configuration
Environment Variables
docker-compose.yml (local development):
environment:
- DOKUWIKI_USERNAME=admin
- DOKUWIKI_PASSWORD=change_this_password
- DOKUWIKI_EMAIL=admin@localhost
.env.production (AWS Lightsail):
# DokuWiki Admin Credentials
DOKUWIKI_USERNAME=admin
DOKUWIKI_PASSWORD=your-secure-password
DOKUWIKI_EMAIL=admin@example.com
DokuWiki Configuration
The init.sh script automatically configures:
$conf['remote'] = 1; // Enable Remote API
$conf['remoteuser'] = '@admin'; // Allow admin group
$conf['useacl'] = 1; // Enable ACL
$conf['superuser'] = '@admin'; // Admin group permissions
Development
Local Testing
# Start services
docker-compose up -d
# View logs
docker-compose logs -f
# Restart after changes
docker-compose up -d --build
# Stop services
docker-compose down
Testing MCP Tools
# Test without authentication (should fail)
curl -X POST http://localhost:8080/lib/plugins/mcp/mcp.php \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"core_listPages","arguments":{}},"id":1}'
# Test with Bearer token
curl -X POST http://localhost:8080/lib/plugins/mcp/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"core_listPages","arguments":{}},"id":1}'
Deployment
AWS Lightsail Requirements
- AWS CLI configured
- Docker Hub account
- Lightsail container service (created automatically by script)
Deployment Process
The deploy-lightsail.sh script:
- Builds Docker image
- Pushes to Docker Hub
- Creates/updates Lightsail deployment
- Waits for deployment to complete
- Tests the endpoint
Cost: ~$10/month (Lightsail small container)
Security
Bearer Tokens
- Generated automatically in DokuWiki user profile
- JWT format with HMAC-SHA256 signature
- Stored in DokuWiki's
data/meta/jwt/directory - No expiration by default (can be configured)
HTTPS
- Local: Self-signed certificates for development
- Production: Lightsail provides automatic HTTPS with managed certificates
Best Practices
- Use strong admin password in
.env.production - Keep
.env.productionout of git (in.gitignore) - Rotate Bearer tokens periodically
- Use HTTPS in production (automatic with Lightsail)
- Restrict remote API access via DokuWiki ACL
Troubleshooting
Local Development
MCP connection fails:
- Check Docker containers are running:
docker-compose ps - Verify token is valid: login to DokuWiki and regenerate
- Check logs:
docker-compose logs -f
Certificate errors:
- For local HTTPS, add certificate to system trust store:
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/dokuwiki.crt
- Or use HTTP endpoint for local testing
Production
401 Unauthorized:
- Regenerate Bearer token from DokuWiki profile
- Verify token is correctly configured in Claude Code
Deployment fails:
- Check AWS CLI credentials:
aws sts get-caller-identity - Verify Docker Hub login:
docker login - Check Lightsail service status:
aws lightsail get-container-services --service-name dokuwiki-mcp --region eu-central-1
View logs:
aws lightsail get-container-log --service-name dokuwiki-mcp --container-name dokuwiki --region eu-central-1
Documentation
License
This project uses:
- DokuWiki: GPL v2
- DokuWiki MCP Plugin: GPL v2
Contributing
Issues and pull requests welcome!