Skip to content

Latest commit

 

History

History

development

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Development Guide

🚧 Documentation In Progress

This documentation is being actively developed. More details will be added soon.

Overview

This guide covers development setup, contribution guidelines, and best practices for the MCP Codebase Insight project.

Development Setup

  1. Clone Repository

    git clone https://github.com/modelcontextprotocol/mcp-codebase-insight
    cd mcp-codebase-insight
  2. Create Virtual Environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install Development Dependencies

    pip install -e ".[dev]"
  4. Setup Pre-commit Hooks

    pre-commit install

Project Structure

mcp-codebase-insight/
├── src/
│   └── mcp_codebase_insight/
│       ├── analysis/       # Code analysis modules
│       ├── documentation/  # Documentation management
│       ├── kb/            # Knowledge base operations
│       └── server/        # FastAPI server
├── tests/
│   ├── integration/       # Integration tests
│   └── unit/             # Unit tests
├── docs/                 # Documentation
└── examples/            # Example usage

Testing

# Run unit tests
pytest tests/unit

# Run integration tests
pytest tests/integration

# Run with coverage
pytest --cov=src tests/

Code Style

  • Follow PEP 8
  • Use type hints
  • Document functions and classes
  • Keep functions focused and small
  • Write tests for new features

Git Workflow

  1. Create feature branch
  2. Make changes
  3. Run tests
  4. Submit pull request

Documentation

  • Update docs for new features
  • Include docstrings
  • Add examples when relevant

Debugging

Server Debugging

import debugpy

debugpy.listen(("0.0.0.0", 5678))
debugpy.wait_for_client()

VSCode Launch Configuration

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Remote Attach",
      "type": "python",
      "request": "attach",
      "port": 5678,
      "host": "localhost"
    }
  ]
}

Performance Profiling

python -m cProfile -o profile.stats your_script.py
python -m snakeviz profile.stats

Next Steps