Thank you for considering contributing to pyghidra-lite! This document provides guidelines for contributing to the project.
Found a bug? Please open an issue at: https://github.com/johnzfitch/pyghidra-lite/issues
Include:
- Python version
- Ghidra version
- Steps to reproduce
- Expected vs actual behavior
- Error messages/logs
Feature requests are welcome! Please:
- Check existing issues first
- Describe the use case
- Explain why existing tools don't solve it
- Consider token efficiency implications
-
Fork the repository
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow existing code style (ruff enforced)
- Add tests for new features
- Update documentation
-
Run quality checks
ruff check src/ ruff format src/ pytest tests/
-
Commit with clear messages
git commit -m "Add feature: brief description Detailed explanation of what changed and why. Addresses #123"
-
Push and create PR
git push origin feature/your-feature-name
# Clone repository
git clone https://github.com/johnzfitch/pyghidra-lite
cd pyghidra-lite
# Create virtual environment
uv venv
source .venv/bin/activate # or .venv/Scripts/activate on Windows
# Install in development mode
uv sync --extra dev
# Install Ghidra (required)
# Set GHIDRA_INSTALL_DIR environment variable- Python 3.11+ minimum
- Type hints encouraged
- Ruff for linting and formatting
- Line length: 100 characters
- Docstrings: Google style
# Run all tests
uv run pytest tests/
# Run specific test
uv run pytest tests/test_server.py
# With coverage
uv run pytest --cov=pyghidra_lite tests/When adding MCP tools:
-
Token efficiency first
- Default to compact output
- Make verbose output opt-in
- Truncate large strings
- Use
include_metadata=Falseby default
-
Follow naming conventions
- Keep the public MCP surface consolidated:
load,delete,binaries,info,functions,code,xrefs,search - Prefer adding capability-specific behavior behind constrained parameters instead of creating new public tool names
- Keep the public MCP surface consolidated:
-
Document parameters
- Clear descriptions
- Mention defaults
- Explain token implications
- Publish enum/range constraints in the MCP input schema using type annotations so
tools/listis precise
-
Add capability detection
- Update
detect_capabilities()if needed - Prefer exposing new behavior through existing
type,detail,what,direction, ormodeselectors when possible
- Update
-
Follow MCP error conventions
- Let malformed request/schema failures be handled by MCP/FastMCP validation
- Return semantic input validation and business-rule failures as tool execution errors (
isError: true), not JSON-RPCINVALID_PARAMS
- Update README.md for new features
- Add examples to MCP_RELEASE.md
- Update CHANGELOG.md
- Consider adding to docstrings
Maintainers only:
- Update version in
pyproject.tomlandaur/PKGBUILD - Update
CHANGELOG.md - Commit and push to master
- Create GitHub release:
gh release create v0.x.0 - PyPI publish happens automatically via GitHub Actions
- Update AUR:
cd aur && makepkg --printsrcinfo > .SRCINFO && git push aur master
- Be respectful and constructive
- Focus on the technical merits
- Welcome newcomers
- Help others learn
Open an issue or discussion at: https://github.com/johnzfitch/pyghidra-lite/issues
By contributing, you agree that your contributions will be licensed under the MIT License.