Thank you for your interest in contributing to MCP DevBench! This guide will help you get started.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing Guidelines
- Submitting Changes
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful and professional in all interactions.
- Python 3.11+
- Docker Engine
- uv package manager
- Git
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/mcp-devbench cd mcp-devbench -
Install dependencies:
pip install uv uv sync --extra dev
-
Set up pre-commit hooks:
uv run pre-commit install
-
Verify setup:
uv run pytest uv run ruff check .
Important: We use a main/next branching model. Please read BRANCHING_STRATEGY.md for full details.
Quick Summary:
main- Production-ready code (only accepts PRs fromnext)next- Integration branch for upcoming releasesfeature/*- New features (submit PRs tonext)fix/*- Bug fixes (submit PRs tonext)docs/*- Documentation updates (submit PRs tonext)refactor/*- Code refactoring (submit PRs tonext)
Always branch from next:
git checkout next
git pull origin next
git checkout -b feature/amazing-feature- Make your changes
- Write tests for new functionality
- Update documentation as needed
- Run tests:
uv run pytest - Check code quality:
uv run ruff check . - Format code:
uv run ruff format . - Type check:
uv run pyright src/
We follow strict coding standards to maintain code quality. Please refer to our Project Style Guide for detailed conventions.
- Use uv for package management - Not pip
- Follow PEP 8 with 100 character line limit
- Type hints required for all functions
- Async/await for all I/O operations
- Structured logging over print statements
- Specific exceptions instead of generic Exception
- Repository Pattern: All database access through repositories
- Manager Pattern: Business logic in manager classes
- Dependency Injection: Use factory functions (e.g.,
get_*_manager()) - Async/Await: All I/O operations must be async
- Unit Tests:
tests/unit/ - Integration Tests:
tests/integration/ - E2E Tests:
tests/e2e/(if applicable)
All new features must include tests:
import pytest
from mcp_devbench.managers.container_manager import ContainerManager
@pytest.mark.asyncio
async def test_create_container():
"""Test container creation."""
manager = ContainerManager()
container = await manager.create_container(
image="alpine:latest",
alias="test-container"
)
assert container.image == "alpine:latest"
assert container.alias == "test-container"- Aim for >85% code coverage
- All public APIs must have tests
- Critical paths must have integration tests
# Run all tests
uv run pytest
# Run specific test file
uv run pytest tests/unit/test_container_manager.py
# Run with coverage
uv run pytest --cov=mcp_devbench --cov-report=html
# Run with verbose output
uv run pytest -vWe use Conventional Commits:
feat: add container snapshots
fix: resolve race condition in exec manager
docs: update API documentation
refactor: simplify filesystem manager
test: add E2E tests for spawn workflow
chore: update dependencies
Types:
feat: New featurefix: Bug fixdocs: Documentationrefactor: Code refactoringtest: Testschore: Maintenanceperf: Performance improvementci: CI/CD changes
-
Create PR:
- Write clear title using conventional commit format
- Fill out PR template completely
- Link related issues
-
PR Checklist:
- Tests pass locally
- Code follows style guide
- Documentation updated
- Type checking passes
- No merge conflicts
-
Review Process:
- CI must pass
- At least one approval required
- All comments addressed
-
Merge:
- Squash and merge preferred
- Delete branch after merge
Pre-commit hooks run automatically before each commit:
# Install hooks
uv run pre-commit install
# Run manually
uv run pre-commit run --all-files
# Skip hooks (not recommended)
git commit --no-verify# Run the MCP server
uv run python -m mcp_devbench.server
# With custom config
export MCP_DOCKER_HOST=unix:///var/run/docker.sock
uv run python -m mcp_devbench.server# Run with verbose output
uv run pytest -v -s
# Run specific test with debugging
uv run pytest tests/unit/test_container_manager.py::test_create_container -v -s
# Stop on first failure
uv run pytest -x- General questions: GitHub Discussions
- Bug reports: GitHub Issues
- Security issues: Please report privately (see SECURITY.md)
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT License).
Thank you for contributing! 🎉