Contributing
How to contribute to OParl MCP Server
Contributing
We welcome contributions to OParl MCP Server! This guide will help you get started.
Getting Started
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/yourusername/oparl-mcp-server.git cd oparl-mcp-server
- Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -e . pip install -r requirements-dev.txt
Development Setup
Pre-commit Hooks
Install pre-commit hooks to ensure code quality:
pip install pre-commit
pre-commit install
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=src/oparl_mcp
# Run specific test file
pytest tests/test_server.py
Code Quality
The project uses several tools for code quality:
- Black: Code formatting
- isort: Import sorting
- flake8: Linting
- mypy: Type checking
- bandit: Security scanning
- detect-secrets: Secret detection
Run all quality checks:
pre-commit run --all-files
Making Changes
- Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the coding standards
-
Write tests for new functionality
-
Update documentation if needed
- Run tests and quality checks:
pytest pre-commit run --all-files
- Commit your changes:
git add . git commit -m "Add your feature description"
- Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request on GitHub
Coding Standards
Python Code
- Follow PEP 8 style guidelines
- Use type hints for function parameters and return values
- Write docstrings for all public functions and classes
- Use meaningful variable and function names
Documentation
- Update relevant documentation files
- Use clear, concise language
- Include code examples where helpful
- Follow the existing documentation structure
Testing
- Write unit tests for new functionality
- Aim for high test coverage
- Use descriptive test names
- Test both success and error cases
Pull Request Process
- Ensure all checks pass (tests, linting, etc.)
- Write a clear description of your changes
- Reference any related issues
- Request review from maintainers
- Address feedback promptly
Issue Reporting
When reporting issues:
- Check existing issues first
- Use the issue template provided
- Include reproduction steps
- Provide system information (OS, Python version, etc.)
- Include error messages and logs
Development Guidelines
Adding New Features
- Discuss major features in issues first
- Keep features focused and atomic
- Consider backward compatibility
- Update tests and documentation
Bug Fixes
- Include a test that reproduces the bug
- Fix the root cause, not just symptoms
- Update documentation if behavior changes
Documentation
- Keep documentation up to date
- Use clear, simple language
- Include practical examples
- Test all code examples
Release Process
Releases are handled by maintainers:
- Version bump in
pyproject.toml
- Update changelog
- Create release tag
- Build and publish to PyPI
- Update documentation
Questions?
- GitHub Discussions: For general questions and discussions
- Issues: For bug reports and feature requests
- Pull Requests: For code contributions
Thank you for contributing to OParl MCP Server! 🎉