Skip to main content

Setting Up Your DocuMCP Development Environment

This guide will help you set up a complete development environment for contributing to DocuMCP, including the MCP server, documentation tools, and testing infrastructure.

Prerequisites

DocuMCP requires Node.js 20+ for optimal performance with the MCP SDK and TypeScript compilation.

Installing Node.js

  1. Install nvm:

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/latest/install.sh | bash
  2. Install and use Node.js 20 (required by DocuMCP):

    nvm install 20
    nvm use 20
  3. Verify installation:

    node --version  # Should show v20.x.x
    npm --version # Should show 10.x.x or higher

Clone and Setup DocuMCP

  1. Clone the repository:

    git clone https://github.com/tosin2013/documcp.git
    cd documcp
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build
  4. Verify the MCP server works:

    npm start

Development Tools

  • ESLint: Code quality and style enforcement
  • Prettier: Code formatting
  • TypeScript and JavaScript Language Features: Enhanced TypeScript support
  • GitLens: Git integration and history
  • MCP Protocol Support: For MCP server development (if available)

Debugging the MCP Server

Create a .vscode/launch.json file for debugging DocuMCP:

{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug DocuMCP Server",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/src/index.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"env": {
"NODE_ENV": "development"
}
},
{
"type": "node",
"request": "launch",
"name": "Debug MCP Tools",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/src/tools/analyze-repository.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
}
]
}

Testing Your Setup

  1. Run the test suite:

    npm test
  2. Test MCP server locally:

    npm run dev
  3. Test documentation generation:

    npm run test:docs

MCP Client Integration

To test DocuMCP with AI clients during development:

  1. Build the development version:

    npm run build
  2. Link for local testing:

    npm link
  3. Configure Claude Desktop for development:

    {
    "mcpServers": {
    "documcp-dev": {
    "command": "node",
    "args": ["/path/to/documcp/dist/index.js"],
    "env": {
    "DOCUMCP_TARGET_REPO": "/path/to/test/project"
    }
    }
    }
    }

Next Steps