|
| 1 | +# Contributing to grep-mcp |
| 2 | + |
| 3 | +Thank you for your interest in contributing to grep-mcp! This document provides guidelines for contributing to the project. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. **Fork the repository** on GitHub |
| 8 | +2. **Clone your fork** locally: |
| 9 | + ```bash |
| 10 | + git clone https://github.com/your-username/mcp-grep.git |
| 11 | + cd mcp-grep |
| 12 | + ``` |
| 13 | +3. **Install dependencies**: |
| 14 | + ```bash |
| 15 | + npm install |
| 16 | + ``` |
| 17 | +4. **Build the project**: |
| 18 | + ```bash |
| 19 | + npm run build |
| 20 | + ``` |
| 21 | + |
| 22 | +## Development Workflow |
| 23 | + |
| 24 | +1. **Create a feature branch**: |
| 25 | + ```bash |
| 26 | + git checkout -b feature/your-feature-name |
| 27 | + ``` |
| 28 | + |
| 29 | +2. **Make your changes** following our coding standards |
| 30 | + |
| 31 | +3. **Build and test**: |
| 32 | + ```bash |
| 33 | + npm run build |
| 34 | + npm test |
| 35 | + ``` |
| 36 | + |
| 37 | +4. **Commit your changes**: |
| 38 | + ```bash |
| 39 | + git commit -m "feat: add your feature description" |
| 40 | + ``` |
| 41 | + |
| 42 | +5. **Push to your fork**: |
| 43 | + ```bash |
| 44 | + git push origin feature/your-feature-name |
| 45 | + ``` |
| 46 | + |
| 47 | +6. **Create a Pull Request** on GitHub |
| 48 | + |
| 49 | +## Coding Standards |
| 50 | + |
| 51 | +- **TypeScript**: Use TypeScript for all source code |
| 52 | +- **Code Style**: Follow the existing code style and formatting |
| 53 | +- **Error Handling**: Always handle errors appropriately |
| 54 | +- **Security**: Never introduce shell injection vulnerabilities |
| 55 | +- **Documentation**: Update README.md for new features |
| 56 | +- **Validation**: Use Zod schemas for input validation |
| 57 | + |
| 58 | +## Commit Message Convention |
| 59 | + |
| 60 | +We follow conventional commits: |
| 61 | + |
| 62 | +- `feat:` - New features |
| 63 | +- `fix:` - Bug fixes |
| 64 | +- `docs:` - Documentation changes |
| 65 | +- `style:` - Code style changes (formatting, etc.) |
| 66 | +- `refactor:` - Code refactoring |
| 67 | +- `test:` - Adding or updating tests |
| 68 | +- `chore:` - Maintenance tasks |
| 69 | + |
| 70 | +## Testing |
| 71 | + |
| 72 | +- Write tests for new features |
| 73 | +- Ensure all existing tests pass |
| 74 | +- Test with actual MCP clients when possible |
| 75 | +- Include edge cases and error scenarios |
| 76 | + |
| 77 | +## Security Considerations |
| 78 | + |
| 79 | +When contributing: |
| 80 | + |
| 81 | +- Never use `shell: true` in child_process.spawn |
| 82 | +- Always validate user input with Zod schemas |
| 83 | +- Sanitize file paths properly |
| 84 | +- Be cautious with regex patterns that could cause ReDoS |
| 85 | + |
| 86 | +## Pull Request Guidelines |
| 87 | + |
| 88 | +Before submitting a PR: |
| 89 | + |
| 90 | +- ✅ Code builds without errors |
| 91 | +- ✅ All tests pass |
| 92 | +- ✅ Documentation is updated |
| 93 | +- ✅ Commit messages follow convention |
| 94 | +- ✅ No security vulnerabilities introduced |
| 95 | +- ✅ Code follows existing style |
| 96 | + |
| 97 | +## Questions? |
| 98 | + |
| 99 | +Feel free to open an issue for: |
| 100 | +- Bug reports |
| 101 | +- Feature requests |
| 102 | +- Questions about the codebase |
| 103 | +- Clarification on contributing guidelines |
| 104 | + |
| 105 | +## License |
| 106 | + |
| 107 | +By contributing to grep-mcp, you agree that your contributions will be licensed under the MIT License. |
0 commit comments