### Local Development Setup for DocuMCP Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Instructions for setting up the DocuMCP project locally. This includes cloning the repository, installing Node.js dependencies, building the project, running it in development mode, and executing tests and linting checks. ```bash # Clone DocuMCP repository git clone https://github.com/tosin2013/documcp.git cd documcp # Install dependencies npm install # Build the project npm run build # Run in development mode npm run dev # Run tests npm test # Run linting npm run lint ``` -------------------------------- ### AI Assistant Context Reference Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/getting-started.md Provides instructions on how to reference the LLM_CONTEXT.md file for AI assistants to gain full context of DocuMCP's tools, examples, and memory system. ```markdown ``` @LLM_CONTEXT.md help me set up documentation for my TypeScript project ``` ``` -------------------------------- ### Populate Documentation Structure with Content Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/first-deployment.md Automatically generates starter content for the documentation structure based on the project's analysis. Creates tutorials, API docs, installation guides, and configuration examples tailored to the project. ```bash # Prompt: "populate the documentation structure with content based on my project analysis" ``` -------------------------------- ### Set Up API Documentation Structure with Examples Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Initializes API documentation directory structure using Docusaurus SSG and includes example files. Creates complete folder organization with sample files for API documentation projects. ```bash documcp setup-structure --path ./api-docs --ssg docusaurus --include-examples ``` -------------------------------- ### Repository Analysis Response Example Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/getting-started.md An example JSON response from a repository analysis, detailing project structure, detected dependencies, and smart recommendations for documentation. ```json { "id": "analysis_abc123xyz", "structure": { "totalFiles": 150, "languages": { ".ts": 45, ".js": 12, ".md": 8 }, "hasTests": true, "hasCI": true }, "dependencies": { "ecosystem": "javascript", "packages": ["react", "typescript"] }, "recommendations": { "primaryLanguage": "typescript", "projectType": "library" } } ``` -------------------------------- ### Integration Testing Setup Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Demonstrates how to set up a test repository using Git, initialize it, and then use the `documcp analyze-repository` command to perform an analysis with a specified path and depth. ```bash # Create test repository mkdir test-repo cd test-repo git init echo "# Test Repository" > README.md git add README.md git commit -m "Initial commit" # Test DocuMCP with test repository cd .. documcp analyze-repository --path ./test-repo --depth quick ``` -------------------------------- ### Diataxis Documentation Structure Setup Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/getting-started.md Sets up a documentation structure based on the Diataxis framework for a chosen SSG, including the documentation path and an option to include examples. ```javascript // Setup documentation structure { "path": "/path/to/your/repository/docs", "ssg": "docusaurus", "includeExamples": true } ``` -------------------------------- ### Check Prerequisites for DocuMCP Installation Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Verifies that Node.js, npm, Git, and optionally GitHub CLI are installed and meet the minimum version requirements for DocuMCP. This is a crucial first step before proceeding with the installation. ```bash # Check Node.js version (requires 20.0.0+) node --version # Check npm version (requires 8.0.0+) npm --version # Check Git version git --version # Check GitHub CLI (optional but recommended) gh --version ``` -------------------------------- ### Set Up Documentation with Comprehensive Population Level Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Initializes documentation structure and populates with comprehensive content level. Creates complete documentation setup with extensive content generation for maximum coverage. ```bash documcp populate-content --analysis-id $ANALYSIS_ID --docs-path ./docs --population-level comprehensive ``` -------------------------------- ### Performance Testing Setup Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Provides commands to execute performance benchmarks using `documcp benchmark run` with a specified repository and number of iterations, and then to check the current performance metrics. ```bash # Run performance benchmarks documcp benchmark run --repository ./test-repo --iterations 10 # Check performance metrics documcp benchmark current ``` -------------------------------- ### Unit Testing Setup with Jest Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Installs Jest and related dependencies for unit testing, configures `jest.config.js` for TypeScript projects using `ts-jest`, and defines test patterns and coverage reporting. Includes commands to run tests. ```bash # Install testing dependencies npm install --save-dev jest @types/jest ts-jest # Create jest.config.js cat > jest.config.js << EOF module.exports = { preset: 'ts-jest', testEnvironment: 'node', testMatch: ['**/__tests__/**/*.test.ts'], collectCoverage: true, coverageDirectory: 'coverage', coverageReporters: ['text', 'lcov', 'html'] }; EOF # Run tests npm test ``` -------------------------------- ### DocuMCP Quick Start Workflow Examples Source: https://github.com/tosin2013/documcp/blob/main/docs/api/index.html Examples of how to prompt DocuMCP for different tasks, ranging from a complete workflow to step-by-step commands. These demonstrate the natural language interaction capabilities of DocuMCP. ```bash # Complete workflow "analyze my repository and deploy documentation to GitHub Pages" ``` ```bash # Step by step "analyze my repository for documentation needs" "recommend the best static site generator for my project" "set up documentation structure and deploy to GitHub Pages" ``` -------------------------------- ### SSG Recommendation Response Example Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/getting-started.md Example response from the SSG recommendation system, including the top recommended SSG, confidence score, reasoning, and alternative options with pros and cons. ```json { "recommended": "docusaurus", "confidence": 0.85, "reasoning": [ "JavaScript/TypeScript ecosystem detected", "Modern React-based framework aligns with project stack", "Strong community support and active development" ], "alternatives": [ { "name": "MkDocs", "score": 0.75, "pros": ["Simple setup", "Great themes"], "cons": ["Limited React component support"] } ] } ``` -------------------------------- ### Install DocuMCP Globally or Locally Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Installs DocuMCP either globally on your system for command-line access or locally as a development dependency within a project. Ensure Node.js and npm are installed and meet the version requirements. ```bash # Install DocuMCP globally npm install -g documcp # Or install locally in your project npm install documcp --save-dev ``` -------------------------------- ### Set Up Documentation Structure Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Creates a Diataxis-compliant documentation structure in a specified path for a given SSG. Options include whether to include example files. ```bash # Set up documentation structure documcp setup-structure --path ./docs --ssg docusaurus --include-examples # Minimal structure for existing projects documcp setup-structure --path ./site --ssg hugo --include-examples false ``` -------------------------------- ### Set Up Minimal Enterprise Documentation Structure Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Initializes a minimal documentation directory structure for enterprise documentation using Hugo SSG without including example files. Creates the foundational folder organization for enterprise-focused content. ```bash documcp setup-structure --path ./enterprise-docs --ssg hugo --include-examples false ``` -------------------------------- ### Start DocuMCP Server using npx, global, or Node.js Source: https://github.com/tosin2013/documcp/blob/main/docs/reference/cli.md These commands demonstrate the different methods to start the DocuMCP server. 'npx' is recommended for ease of use without global installation. Global installation requires prior setup, and direct Node.js execution is for specific use cases. ```bash # Using npx (recommended) npx documcp # Using global installation documcp # Using Node.js directly node dist/index.js ``` -------------------------------- ### Get SSG Recommendations with Simplified Priority Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Retrieves SSG recommendations prioritized for simplicity across any ecosystem. Returns recommendations favoring simpler, more straightforward static site generators. ```bash documcp recommend-ssg --analysis-id $ANALYSIS_ID --priority simplicity --ecosystem any ``` -------------------------------- ### Install and Run DocuMCP using Docker Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Provides instructions for pulling the official DocuMCP Docker image and running it in a container. This method isolates DocuMCP and its dependencies, ensuring consistency across different environments. ```bash # Pull the official DocuMCP Docker image docker pull documcp/documcp:latest # Run DocuMCP in a container docker run -it --rm -v $(pwd):/workspace documcp/documcp:latest ``` -------------------------------- ### Setup and Installation Commands (Bash) Source: https://github.com/tosin2013/documcp/blob/main/CONTRIBUTING.md Commands to set up the DocuMCP project locally. This includes cloning the repository, installing dependencies, and setting up git hooks. Ensure Node.js 20.x or higher is installed beforehand. ```bash git clone https://github.com/YOUR_USERNAME/documcp.git cd documcp npm install npm run prepare ``` -------------------------------- ### Workflow: Complete Documentation Setup Source: https://github.com/tosin2013/documcp/blob/main/docs/how-to/repository-analysis.md Outlines a four-step workflow for establishing complete project documentation, starting with analysis, planning based on results, recommending tools, and finally implementing the setup. ```text 1. Analyze: analyze my repository for documentation needs 2. Plan: Use analysis results to understand project characteristics 3. Recommend: recommend documentation tools based on the analysis 4. Implement: set up documentation based on the recommendations ``` -------------------------------- ### Tool Usage Examples (TypeScript) Source: https://github.com/tosin2013/documcp/blob/main/docs/adrs/006-mcp-tools-api-design.md Illustrates how to use MCP tools through code examples, defining a basic and an advanced setup workflow. Each step specifies the tool, its parameters, and the expected outcome. ```typescript // Example: Complete documentation setup workflow const examples = { basicSetup: { description: "Basic documentation setup for a JavaScript project", steps: [ { tool: "analyzeRepository", parameters: { repositoryPath: "./my-project" }, expectedResult: "Project analysis with language ecosystem detection", }, { tool: "recommendSSG", parameters: { projectAnalysis: "${analysis_result}" }, expectedResult: "SSG recommendation with justification", }, ], }, advancedSetup: { description: "Advanced setup with custom requirements", steps: [ // ... detailed workflow steps ], }, }; ``` -------------------------------- ### Populate Documentation Content Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Populates documentation content based on a repository analysis ID and a specified documentation path. Can also focus on specific areas like 'api' or 'examples'. ```bash # Populate documentation content documcp populate-content --analysis-id analysis_abc123_def456 --docs-path ./docs # With specific focus areas documcp populate-content --analysis-id analysis_abc123_def456 --docs-path ./docs --focus-areas api,examples ``` -------------------------------- ### Populate API Documentation Content Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Fills API documentation structure with content focused on API endpoints, examples, and integration guides. Uses analysis results to generate API-specific documentation with prioritized focus areas. ```bash documcp populate-content --analysis-id $ANALYSIS_ID --docs-path ./api-docs --focus-areas api,examples,integration ``` -------------------------------- ### Configure GitHub Pages Deployment with DocuMCP Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Command to configure GitHub Pages deployment using DocuMCP. This utility helps automate the setup process for hosting your generated documentation directly from your repository. ```bash # Configure GitHub Pages deployment documcp github configure-pages --repository "username/repository" ``` -------------------------------- ### Get API-Focused SSG Recommendation Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Retrieves static site generator recommendations prioritized for API documentation features. Analyzes project characteristics and returns SSG recommendations optimized for API documentation use cases. ```bash documcp recommend-ssg --analysis-id $ANALYSIS_ID --priority features ``` -------------------------------- ### Get Personalized SSG Recommendations Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Retrieves static site generator recommendations based on stored user preferences and project analysis. Returns customized recommendations matching user's priority and ecosystem preferences. ```bash documcp recommend-ssg --analysis-id $ANALYSIS_ID --user-id "developer123" ``` -------------------------------- ### Enterprise Documentation Analysis Workflow Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Initiates the DocuMCP process for enterprise documentation, starting with a deep analysis of the repository to capture comprehensive details relevant to larger projects. ```bash # 1. Analyze with enterprise focus ANALYSIS_ID=$(documcp analyze-repository --path . --depth deep | jq -r '.data.id') ``` -------------------------------- ### Memory System Exploration Commands Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/getting-started.md Demonstrates commands to interact with DocuMCP's memory system, including fetching learning statistics and recalling similar projects based on a query. ```javascript // Get learning statistics { "includeDetails": true } // Recall similar projects { "query": "typescript documentation", "type": "recommendation", "limit": 5 } ``` -------------------------------- ### GitHub Pages Deployment Configuration Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/getting-started.md Configures automated deployment to GitHub Pages for a specified repository and SSG, setting the deployment branch and enabling secure OIDC authentication. ```javascript // Deploy to GitHub Pages { "repository": "/path/to/your/repository", "ssg": "docusaurus", "branch": "gh-pages" } ``` -------------------------------- ### Initial Repository Analysis Request Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/getting-started.md Sends a request to analyze a project repository, specifying the path and analysis depth. It returns project structure, dependencies, documentation status, and smart recommendations. ```json { "path": "/path/to/your/project", "depth": "standard" } ``` -------------------------------- ### JavaScript Templates: Getting Started Source: https://github.com/tosin2013/documcp/blob/main/docs/adrs/008-intelligent-content-population-engine.md Defines templates for the JavaScript ecosystem, including prerequisites, installation, and verification steps for getting started with a project. Requires Node.js 18+, npm/yarn, and Git. ```typescript const JAVASCRIPT_TEMPLATES = { gettingStarted: { prerequisites: ["Node.js 18+", "npm or yarn", "Git"], installationSteps: [ "Clone the repository", "Install dependencies with npm install", "Copy environment variables", "Run development server", ], verificationSteps: [ "Check server starts successfully", "Access application in browser", "Run test suite to verify setup", ], }, expressAPI: { sections: [ "Project Structure Overview", "Creating Your First Route", "Middleware Configuration", "Database Integration", "Error Handling", "Testing Your API", ], codeExamples: generateExpressCodeExamples, }, testingGuides: { jest: generateJestHowToGuides, cypress: generateCypressHowToGuides, playwright: generatePlaywrightHowToGuides, }, }; ``` -------------------------------- ### Full Workflow for New Open Source Project Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Orchestrates the complete DocuMCP workflow for a new open-source project, from repository analysis and SSG recommendation to structure setup, configuration, content population, and GitHub Pages deployment. Assumes the project is in the current directory. ```bash # 1. Analyze your repository ANALYSIS_ID=$(documcp analyze-repository --path . --depth standard | jq -r '.data.id') # 2. Get SSG recommendation documcp recommend-ssg --analysis-id $ANALYSIS_ID --priority community_focused # 3. Set up documentation structure documcp setup-structure --path ./docs --ssg docusaurus --include-examples # 4. Generate configuration documcp generate-config --ssg docusaurus --project-name "My Open Source Project" --output-path ./docs # 5. Populate content documcp populate-content --analysis-id $ANALYSIS_ID --docs-path ./docs # 6. Deploy to GitHub Pages documcp deploy-pages --repository "$(git remote get-url origin | sed 's/.*github.com[:/]\([^.]*\).*/\1/ Perkenalkan) --ssg docusaurus ``` -------------------------------- ### Install DocuMCP Globally via npm Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Installs the DocuMCP package globally on your system using npm. This makes the `documcp` command available in your terminal from any directory. It also includes verification of the installation. ```bash # Install DocuMCP globally npm install -g documcp # Verify installation documcp --version # Should output: DocuMCP v0.3.4 ``` -------------------------------- ### Start Local Development Server for Documentation Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/development-setup.md Starts a local development server with live reload capabilities for previewing documentation changes. This command is typically used to test local deployments before pushing to version control. ```bash # Test local deployment before pushing to GitHub "test my documentation build locally with live reload" ``` -------------------------------- ### Markdown Tutorial Template Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/development-setup.md Standardized template for tutorial documentation with sections for learning objectives, prerequisites, step-by-step instructions, verification, and next steps. Ensures consistent structure and beginner-friendly content across all tutorials. ```markdown # [Action] Tutorial ## What You'll Learn - Objective 1 - Objective 2 ## Prerequisites - Requirement 1 - Requirement 2 ## Step-by-Step Instructions ### Step 1: [Action] Instructions... ### Step 2: [Action] Instructions... ## Verification How to confirm success... ## Next Steps Where to go next... ``` -------------------------------- ### Start Hugo Local Development Server Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/development-setup.md Starts the Hugo development server with live reload enabled, allowing for immediate preview of documentation updates. The server typically runs on http://localhost:1313. ```bash hugo server -D # Opens http://localhost:1313 with live reload ``` -------------------------------- ### Install DocuMCP Locally as a Dev Dependency Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Installs DocuMCP as a development dependency within a specific project using npm. This is useful for project-specific documentation tasks. It also demonstrates how to add scripts to `package.json` for easy execution. ```bash # Navigate to your project directory cd /path/to/your/project # Install DocuMCP as a dev dependency npm install documcp --save-dev # Add to package.json scripts npm pkg set scripts.docs="documcp" npm pkg set scripts.docs:analyze="documcp analyze-repository --path ." npm pkg set scripts.docs:deploy="documcp deploy-pages --repository $(git remote get-url origin | sed 's/.*github.com[:/]\([^.]*\).*/\1/') ``` -------------------------------- ### Deploy Documentation to GitHub Pages Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Deploys generated documentation to GitHub Pages. Requires the repository in 'user/repo' format and the SSG used. Supports custom domain configuration. ```bash # Deploy to GitHub Pages documcp deploy-pages --repository "user/repo" --ssg docusaurus # With custom domain documcp deploy-pages --repository "user/repo" --ssg docusaurus --custom-domain "docs.example.com" ``` -------------------------------- ### Setup Diataxis Documentation Structure Source: https://github.com/tosin2013/documcp/blob/main/docs/reference/mcp-tools.md Creates a Diataxis-compliant documentation structure at a specified path for a given SSG. Optionally includes example content. The structure includes directories for tutorials, how-to guides, reference, and explanations. ```json { "path": "./docs", "ssg": "mkdocs", "includeExamples": true } ``` -------------------------------- ### Docker Usage for DocuMCP Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Illustrates basic Docker commands for managing the DocuMCP service via Docker Compose. This includes starting the service in detached mode, executing commands within the container, and stopping all related services. ```bash # Start DocuMCP with Docker Compose docker-compose up -d # Run specific commands docker-compose exec documcp documcp analyze-repository --path . # Stop services docker-compose down ``` -------------------------------- ### GitLab CI for DocuMCP Integration Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md A GitLab CI/CD configuration file (`.gitlab-ci.yml`) for setting up automated analysis and deployment pipelines. It defines stages for analysis and deployment, specifying Node.js version, installation of DocuMCP, and deployment to GitLab Pages. ```yaml stages: - analyze - deploy variables: NODE_VERSION: "20" analyze: stage: analyze image: node:${NODE_VERSION}-alpine before_script: - npm install -g documcp script: - documcp analyze-repository --path . --depth standard - documcp validate-content --docs-path ./docs artifacts: reports: junit: documcp-results.xml paths: - .documcp/ expire_in: 1 hour deploy: stage: deploy image: node:${NODE_VERSION}-alpine before_script: - npm install -g documcp script: - documcp deploy-pages --repository $CI_PROJECT_PATH --ssg docusaurus only: - main environment: name: production url: https://$CI_PROJECT_NAMESPACE.gitlab.io/$CI_PROJECT_NAME ``` -------------------------------- ### Markdown How-to Guide Template Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/development-setup.md Template for problem-solving documentation with problem statement, solution steps, alternative approaches, and troubleshooting section. Provides practical guidance for users facing specific challenges. ```markdown # How to [Solve Problem] ## Problem Clear problem statement... ## Solution Step-by-step solution... ## Alternative Approaches Other ways to solve this... ## Troubleshooting Common issues and fixes... ``` -------------------------------- ### Verify DocuMCP Installation Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Checks if DocuMCP has been installed correctly by running the version command. This command should output the currently installed version of DocuMCP. ```bash # Check if DocuMCP is installed correctly documcp --version # Should output: DocuMCP v0.3.4 ``` -------------------------------- ### Start Jekyll Local Development Server with Live Reload Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/development-setup.md Serves Jekyll documentation locally with live reload functionality. This enables instant updates in the browser, usually accessible at http://localhost:4000. ```bash bundle exec jekyll serve --livereload # Opens http://localhost:4000 with live reload ``` -------------------------------- ### Setup Diataxis Documentation Structure Source: https://context7.com/tosin2013/documcp/llms.txt Creates a Diataxis-compliant documentation directory structure including folders for tutorials, how-to guides, reference materials, and explanations. It supports different Static Site Generators (SSGs) like MkDocs, Hugo, and Docusaurus, and can optionally include example content templates. ```typescript // Setup structure with examples for MkDocs { "tool": "setup_structure", "arguments": { "path": "./docs", "ssg": "mkdocs", "includeExamples": true } } // Response with created structure for MkDocs { "success": true, "data": { "created": [ "docs/tutorials/", "docs/how-to/", "docs/reference/", "docs/explanation/", "docs/tutorials/example-getting-started.md", "docs/how-to/example-guide.md", "docs/reference/example-api.md", "docs/explanation/example-concept.md", "docs/index.md" ], "ssgConfig": "mkdocs.yml", "structure": { "tutorials": "Learning-oriented guides for newcomers", "how-to": "Task-oriented recipes for specific goals", "reference": "Information-oriented technical descriptions", "explanation": "Understanding-oriented conceptual discussions" } } } // Setup for Hugo without examples { "tool": "setup_structure", "arguments": { "path": "./content/docs", "ssg": "hugo", "includeExamples": false } } // Setup for Docusaurus with examples { "tool": "setup_structure", "arguments": { "path": "./docs", "ssg": "docusaurus", "includeExamples": true } } ``` -------------------------------- ### Start Docusaurus Local Development Server Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/development-setup.md Starts the Docusaurus development server, providing live reload for instant preview of documentation changes. The server typically runs on http://localhost:3000. ```bash npm run start # Opens http://localhost:3000 with live reload ``` -------------------------------- ### Deploy Documentation to GitHub Pages Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Deploys generated documentation to GitHub Pages using specified SSG. Pushes documentation to repository's GitHub Pages branch with proper configuration. ```bash documcp deploy-pages --repository "user/repo" --ssg docusaurus ``` -------------------------------- ### Start MkDocs Local Development Server Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/development-setup.md Serves the MkDocs documentation locally with auto-reload enabled. Changes to documentation files will trigger a rebuild and refresh the browser, usually at http://127.0.0.1:8000. ```bash mkdocs serve # Opens http://127.0.0.1:8000 with auto-reload ``` -------------------------------- ### Initialize Memory System Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Sets up the memory system storage for learning and pattern recognition in documcp. Initializes storage directory for caching analysis results and learned patterns. ```bash documcp memory initialize --storage-dir ./.documcp ``` -------------------------------- ### Troubleshooting: Build Failures Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Offers solutions for 'Documentation build failed' errors. Includes commands to validate content syntax, test a local build with a specified Static Site Generator (SSG), and view the SSG configuration file. ```bash # Check for syntax errors documcp validate-content --docs-path ./docs # Test local build documcp test-local --docs-path ./docs --ssg docusaurus # Check SSG configuration cat ./docs/docusaurus.config.js ``` -------------------------------- ### Deploy Documentation with GitHub Actions Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md GitHub Actions workflow that automatically triggers on push events to main branch, analyzes the repository using DocuMCP, and deploys documentation to GitHub Pages. The workflow uses Node.js 20, installs DocuMCP globally, and captures the analysis ID for subsequent deployment steps. ```yaml name: Deploy Documentation on: push: branches: [main] paths: ["docs/**", "src/**"] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" - name: Install DocuMCP run: npm install -g documcp - name: Analyze Repository id: analyze run: | ANALYSIS_ID=$(documcp analyze-repository --path . --depth standard | jq -r '.data.id') echo "analysis_id=$ANALYSIS_ID" >> $GITHUB_OUTPUT - name: Deploy Documentation run: | documcp deploy-pages --repository ${{ github.repository }} --ssg docusaurus env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` -------------------------------- ### Troubleshooting DocuMCP Global Installation Path Source: https://github.com/tosin2013/documcp/blob/main/README.md This example shows how to configure DocuMCP as an MCP server when it's installed globally. It uses 'node' as the command and provides the full path to the installed executable. Use 'npm list -g documcp' to find the correct path. ```json { "command": "node", "args": ["/usr/local/lib/node_modules/documcp/dist/index.js"] } ``` -------------------------------- ### Find Similar Projects in Memory Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/user-onboarding.md Searches memory system for projects similar to the analyzed project. Returns list of comparable projects from learned patterns to inform recommendations. ```bash documcp memory similar --analysis-id $ANALYSIS_ID ``` -------------------------------- ### Docker Compose Configuration for DocuMCP Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/environment-setup.md Defines a Docker Compose setup for running the DocuMCP service. This configuration includes the service image, container name, volume mappings for persistence, environment variables, and network port exposure. ```yaml version: "3.8" services: documcp: image: documcp/documcp:latest container_name: documcp volumes: - ./:/workspace - ./documcp-data:/app/.documcp environment: - GITHUB_TOKEN=${GITHUB_TOKEN} - DOCUMCP_STORAGE_DIR=/app/.documcp working_dir: /workspace command: ["documcp", "serve", "--port", "3000", "--host", "0.0.0.0"] ports: - "3000:3000" ``` -------------------------------- ### Setup Diataxis Documentation Structure Source: https://github.com/tosin2013/documcp/blob/main/docs/reference/mcp-tools.md Creates a Diataxis-compliant documentation structure in the specified path, optionally including example content. ```APIDOC ## POST /setup_structure ### Description Create Diataxis-compliant documentation structure. ### Method POST ### Endpoint /setup_structure ### Parameters #### Request Body - **path** (string) - Required - Root path for documentation - **ssg** (enum) - Required - Static site generator type - **includeExamples** (boolean, optional, default: true) - Include example content ### Request Example ```json { "path": "./docs", "ssg": "mkdocs", "includeExamples": true } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation of structure creation - **directories** (object) - Details of created directories (`tutorials`, `how-to`, `reference`, `explanation`) #### Response Example ```json { "message": "Diataxis documentation structure created successfully in ./docs.", "directories": { "tutorials": "./docs/tutorials", "how-to": "./docs/how-to", "reference": "./docs/reference", "explanation": "./docs/explanation" } } ``` ``` -------------------------------- ### Install and Set Up Husky for Pre-commit Hooks Source: https://github.com/tosin2013/documcp/blob/main/docs/tutorials/development-setup.md Installs the Husky package to manage Git hooks and sets up a pre-commit hook to automatically validate documentation before allowing a commit. This ensures code quality and consistency. ```bash # Install husky for git hooks npm install --save-dev husky # Set up pre-commit hook npx husky add .husky/pre-commit "npm run docs:validate" ``` -------------------------------- ### Setup Documentation Structure with DocuMCP (TypeScript) Source: https://github.com/tosin2013/documcp/blob/main/docs/how-to/usage-examples.md Sets up a documentation structure for various SSGs like Docusaurus, Hugo, and MkDocs. It requires the output path, the target SSG, and an option to include examples. Outputs list created directories and files. Supports custom structures including Diataxis categories. ```typescript import { setupStructure } from "documcp"; // Set up Docusaurus structure const structure = await setupStructure({ path: "./docs", ssg: "docusaurus", includeExamples: true, }); console.log(`Created ${structure.data.directoriesCreated.length} directories`); console.log(`Created ${structure.data.filesCreated.length} files`); // Minimal structure for existing projects const minimal = await setupStructure({ path: "./site", ssg: "hugo", includeExamples: false, }); // Check what was created minimal.data.directoriesCreated.forEach((dir) => { console.log(`Created directory: ${dir}`); }); // Custom structure with specific categories const custom = await setupStructure({ path: "./custom-docs", ssg: "mkdocs", includeExamples: true, }); // Access structure details const { diataxisStructure, ssgSpecificFiles } = custom.data; console.log( `Diataxis categories: ${Object.keys(diataxisStructure).join(", ")}`, ); ```