Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
- Check if the bug has already been reported in Issues
- If not, create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Your environment (OS, Python version, SourceGraph version)
- Relevant logs or error messages
- Check Discussions first
- Create a new discussion or issue describing:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered
- How it benefits other users
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Test thoroughly
- Commit with clear messages:
git commit -m "Add feature: description" - Push to your fork:
git push origin feature/my-feature - Open a Pull Request
# Clone your fork
git clone https://github.com/dalebrubaker/sourcegraph-mcp.git
cd sourcegraph-mcp
# Install dependencies
pip install -r requirements.txt
# Set up pre-commit hooks (optional but recommended)
pip install pre-commit
pre-commit install- Follow PEP 8 Python style guide
- Use type hints where applicable
- Add docstrings for functions and classes
- Keep functions focused and under 50 lines when possible
- Use meaningful variable names
Before submitting a PR:
- Test with your local SourceGraph instance
- Test with different query types
- Verify error handling
- Check that
test_connection.pypasses
python test_connection.py- Update README.md if you add features
- Add examples for new query types
- Update SETUP.md if installation changes
- Comment complex code sections
Use clear, descriptive commit messages:
Add support for repository filters
- Implement repo: prefix in queries
- Add tests for repository filtering
- Update documentation with examples
Particularly welcome contributions:
- Bug fixes - Always appreciated!
- Documentation improvements - Help others understand the project
- New features - Search filters, output formats, etc.
- Examples - Real-world usage examples
- Performance improvements - Make queries faster
- Error handling - Better error messages and recovery
- Testing - Automated tests would be great
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Assume good intentions
- Open a Discussion
- Reach out in your Pull Request
- Check existing issues and PRs
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for helping make SourceGraph MCP better! 🎉