Deploy documcp MCP Server
This guide shows you how to deploy and configure the documcp MCP server for production use with AI clients.
Prerequisites
- Node.js 20 or higher installed
- npm package manager
- AI client that supports MCP (Claude Desktop, GitHub Copilot, etc.)
- Git repository access for documentation projects
Installation Methods
Method 1: NPM Installation (Recommended)
- Install documcp globally:
npm install -g documcp
- Verify installation:
documcp --version
Method 2: Local Development Setup
- Clone the repository:
git clone https://github.com/tosin2013/documcp.git
cd documcp
- Install dependencies:
npm install
- Build the project:
npm run build
- Start the MCP server:
npm run dev
MCP Client Configuration
Claude Desktop Configuration
-
Locate Claude Desktop's configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add documcp server configuration:
{
"mcpServers": {
"documcp": {
"command": "npx",
"args": ["documcp"]
}
}
}
Optional: Set default target repository:
{
"mcpServers": {
"documcp": {
"command": "npx",
"args": ["documcp"],
"env": {
"DOCUMCP_TARGET_REPO": "/path/to/your/project"
}
}
}
}
Alternative configuration (if npx doesn't work):
{
"mcpServers": {
"documcp": {
"command": "node",
"args": ["/usr/local/lib/node_modules/documcp/dist/index.js"]
}
}
}
- Restart Claude Desktop to load the configuration.
GitHub Copilot Configuration
- Install the MCP extension for your IDE
- Configure the MCP server endpoint:
{
"mcp.servers": {
"documcp": {
"transport": "stdio",
"command": "npx",
"args": ["documcp"]
}
}
}
Optional: Set default target repository:
{
"mcp.servers": {
"documcp": {
"transport": "stdio",
"command": "npx",
"args": ["documcp"],
"env": {
"DOCUMCP_TARGET_REPO": "/path/to/your/project"
}
}
}
}
Alternative configuration (if npx doesn't work):
{
"mcp.servers": {
"documcp": {
"transport": "stdio",
"command": "node",
"args": ["/usr/local/lib/node_modules/documcp/dist/index.js"]
}
}
}
Verification Steps
1. Test MCP Server Connection
In your AI client, try a basic command:
Can you analyze this repository using documcp?
The AI should respond with available documcp tools.
2. Verify Tool Availability
Check that all core tools are accessible:
analyzeRepository
recommendSSG
generateConfiguration
createDiataxisStructure
generateWorkflow
3. Test Complete Workflow
Run a full documentation setup:
Use documcp to analyze my project and set up complete documentation with GitHub Pages deployment.
Production Configuration
Environment Variables
Set these environment variables for production:
export NODE_ENV=production
export LOG_LEVEL=info
export MCP_SERVER_PORT=3000
Performance Optimization
- Memory Limits: Set Node.js memory limits for large repositories:
node --max-old-space-size=4096 dist/index.js
- Concurrent Processing: Configure worker thread limits:
export UV_THREADPOOL_SIZE=8
Security Configuration
- File System Access: Limit repository access paths:
{
"security": {
"allowedPaths": ["/home/user/projects", "/workspace"],
"maxFileSize": "100MB",
"maxAnalysisTime": "300s"
}
}
- Network Security: Configure firewall rules if needed:
# Allow only local connections
iptables -A INPUT -p tcp --dport 3000 -s 127.0.0.1 -j ACCEPT
Monitoring and Logging
Enable Detailed Logging
export DEBUG=documcp:*
npm start
Log File Configuration
{
"logging": {
"level": "info",
"file": "/var/log/documcp/server.log",
"maxSize": "10MB",
"maxFiles": 5
}
}
Health Check Endpoint
Test server health:
curl http://localhost:3000/health
Troubleshooting
Common Issues
MCP Server Not Found
- Verify the path in your AI client configuration
- Check that Node.js and npm are in your PATH
- Ensure the server process is running
Tool Execution Failures
- Check file permissions for repository access
- Verify Node.js version compatibility (20+)
- Review server logs for detailed error messages
Performance Issues
- Increase memory limits for large repositories
- Configure appropriate worker thread counts
- Monitor disk I/O for repository analysis
Debug Mode
Enable debug mode for troubleshooting:
NODE_ENV=development DEBUG=* npm run dev
Maintenance
Regular Updates
- Check for updates:
npm outdated -g documcp
- Update to latest version:
npm update -g documcp
Dependency Security
Run security audits regularly:
npm audit
npm audit fix