|
| 1 | +# Contributing to mcp-server-rabbitmq |
| 2 | + |
| 3 | +Thank you for your interest in contributing to mcp-server-rabbitmq! This document provides guidelines and instructions for contributing to this project. |
| 4 | + |
| 5 | +## Development Environment Setup |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +- Python 3.10 or higher |
| 10 | +- [uv](https://github.com/astral-sh/uv) for dependency management |
| 11 | + |
| 12 | +### Setting Up Your Development Environment |
| 13 | + |
| 14 | +1. Clone the repository: |
| 15 | + ```bash |
| 16 | + git clone https://github.com/kenliao94/mcp-server-rabbitmq.git |
| 17 | + cd mcp-server-rabbitmq |
| 18 | + ``` |
| 19 | + |
| 20 | +2. Create and activate a virtual environment using `uv`: |
| 21 | + ```bash |
| 22 | + uv venv |
| 23 | + source .venv/bin/activate # On Windows: .venv\Scripts\activate |
| 24 | + ``` |
| 25 | + |
| 26 | +3. Install dependencies: |
| 27 | + ```bash |
| 28 | + uv pip install -e . |
| 29 | + uv pip install -r requirements-dev.txt # If available, otherwise use dev dependencies from pyproject.toml |
| 30 | + ``` |
| 31 | + |
| 32 | +4. Install pre-commit hooks: |
| 33 | + ```bash |
| 34 | + pip install pre-commit |
| 35 | + pre-commit install |
| 36 | + ``` |
| 37 | + |
| 38 | +## Development Workflow |
| 39 | + |
| 40 | +### Code Style |
| 41 | + |
| 42 | +This project follows a specific code style enforced by Ruff. Key style guidelines include: |
| 43 | + |
| 44 | +- Line length: 99 characters |
| 45 | +- Quote style: Double quotes |
| 46 | +- Indentation: 4 spaces |
| 47 | +- Import sorting: Using isort configuration via Ruff |
| 48 | + |
| 49 | +The pre-commit hooks will automatically check and fix many style issues when you commit. |
| 50 | + |
| 51 | +### Running Tests |
| 52 | + |
| 53 | +Tests are written using pytest. To run the tests: |
| 54 | + |
| 55 | +```bash |
| 56 | +pytest |
| 57 | +``` |
| 58 | + |
| 59 | +For more verbose output: |
| 60 | + |
| 61 | +```bash |
| 62 | +pytest -v |
| 63 | +``` |
| 64 | + |
| 65 | +### Pre-commit Hooks |
| 66 | + |
| 67 | +This project uses pre-commit hooks to ensure code quality. The hooks include: |
| 68 | + |
| 69 | +- Ruff for linting and formatting |
| 70 | +- Trailing whitespace removal |
| 71 | +- End-of-file fixing |
| 72 | +- YAML and TOML checking |
| 73 | +- Large file checking |
| 74 | + |
| 75 | +## Pull Request Process |
| 76 | + |
| 77 | +1. Fork the repository and create a new branch from `main`. |
| 78 | +2. Make your changes, following the code style guidelines. |
| 79 | +3. Add tests for any new functionality. |
| 80 | +4. Ensure all tests pass. |
| 81 | +5. Update documentation as needed. |
| 82 | +6. Submit a pull request with a clear description of the changes. |
| 83 | + |
| 84 | +### Commit Messages |
| 85 | + |
| 86 | +This project uses [Conventional Commits](https://www.conventionalcommits.org/) for commit messages, managed by Commitizen. Your commit messages should follow this format: |
| 87 | + |
| 88 | +``` |
| 89 | +<type>(<scope>): <description> |
| 90 | +
|
| 91 | +[optional body] |
| 92 | +
|
| 93 | +[optional footer(s)] |
| 94 | +``` |
| 95 | + |
| 96 | +Common types include: |
| 97 | +- `feat`: A new feature |
| 98 | +- `fix`: A bug fix |
| 99 | +- `docs`: Documentation changes |
| 100 | +- `style`: Code style changes (formatting, etc.) |
| 101 | +- `refactor`: Code refactoring |
| 102 | +- `test`: Adding or modifying tests |
| 103 | +- `chore`: Routine tasks, maintenance, etc. |
| 104 | + |
| 105 | +## Versioning |
| 106 | + |
| 107 | +This project uses semantic versioning. Version bumps are handled by Commitizen based on commit messages. |
| 108 | + |
| 109 | +## Project Structure |
| 110 | + |
| 111 | +- `mcp_server_rabbitmq/`: Main package directory |
| 112 | + - `server.py`: Main server implementation |
| 113 | + - `connection.py`: RabbitMQ connection handling |
| 114 | + - `admin.py`: RabbitMQ administration |
| 115 | + - `handlers.py`: Request handlers |
| 116 | + - `constant.py`: Constants and configuration |
| 117 | +- `tests/`: Test directory |
| 118 | + |
| 119 | +## License |
| 120 | + |
| 121 | +By contributing to this project, you agree that your contributions will be licensed under the project's [Apache 2.0 License](LICENSE). |
| 122 | + |
| 123 | +## Questions or Need Help? |
| 124 | + |
| 125 | +If you have questions or need help with the contribution process, please open an issue in the repository. |
0 commit comments