🚧 Documentation In Progress
This documentation is being actively developed. More details will be added soon.
This guide covers development setup, contribution guidelines, and best practices for the MCP Codebase Insight project.
-
Clone Repository
git clone https://github.com/modelcontextprotocol/mcp-codebase-insight cd mcp-codebase-insight
-
Create Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Development Dependencies
pip install -e ".[dev]"
-
Setup Pre-commit Hooks
pre-commit install
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
# Run unit tests
pytest tests/unit
# Run integration tests
pytest tests/integration
# Run with coverage
pytest --cov=src tests/
- Follow PEP 8
- Use type hints
- Document functions and classes
- Keep functions focused and small
- Write tests for new features
- Create feature branch
- Make changes
- Run tests
- Submit pull request
- Update docs for new features
- Include docstrings
- Add examples when relevant
import debugpy
debugpy.listen(("0.0.0.0", 5678))
debugpy.wait_for_client()
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost"
}
]
}
python -m cProfile -o profile.stats your_script.py
python -m snakeviz profile.stats