Skip to main content

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

  1. Install documcp globally:
npm install -g documcp
  1. Verify installation:
documcp --version

Method 2: Local Development Setup

  1. Clone the repository:
git clone https://github.com/tosin2013/documcp.git
cd documcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Start the MCP server:
npm run dev

MCP Client Configuration

Claude Desktop Configuration

  1. Locate Claude Desktop's configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. 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"]
}
}
}
  1. Restart Claude Desktop to load the configuration.

GitHub Copilot Configuration

  1. Install the MCP extension for your IDE
  2. 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

  1. Memory Limits: Set Node.js memory limits for large repositories:
node --max-old-space-size=4096 dist/index.js
  1. Concurrent Processing: Configure worker thread limits:
export UV_THREADPOOL_SIZE=8

Security Configuration

  1. File System Access: Limit repository access paths:
{
"security": {
"allowedPaths": ["/home/user/projects", "/workspace"],
"maxFileSize": "100MB",
"maxAnalysisTime": "300s"
}
}
  1. 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

  1. Check for updates:
npm outdated -g documcp
  1. Update to latest version:
npm update -g documcp

Dependency Security

Run security audits regularly:

npm audit
npm audit fix