Contributing to hgnc.mcp
Source:CONTRIBUTING.md
We welcome contributions to hgnc.mcp! This document provides guidelines for contributing to the project.
Code of Conduct
Please be respectful and considerate in all interactions. We aim to foster an inclusive and welcoming environment for all contributors.
How to Contribute
Reporting Bugs
If you find a bug, please open an issue on GitHub with:
- A clear, descriptive title
- A minimal reproducible example (reprex)
- Your session info (
sessionInfo()) - Expected vs. actual behavior
Suggesting Enhancements
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
- Use a clear, descriptive title
- Provide a detailed description of the proposed functionality
- Explain why this enhancement would be useful
- If possible, provide examples of how it would work
Pull Requests
We actively welcome pull requests! Here’s the process:
-
Fork the repository and create your branch from
main -
Make your changes:
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
- Ensure all tests pass
-
Commit your changes:
- Use clear, descriptive commit messages
- Reference relevant issues (e.g., “Fixes #123”)
- Push to your fork and submit a pull request
Pull Request Guidelines
- One feature per PR: Keep pull requests focused on a single feature or bug fix
- Update documentation: Include roxygen2 documentation for new functions
- Add tests: All new code should have corresponding tests
- Check CI: Ensure all GitHub Actions checks pass
- Update NEWS.md: Add a bullet point describing your changes
Development Setup
-
Clone the repository:
-
Install dependencies:
install.packages("remotes") remotes::install_deps(dependencies = TRUE) -
Install the package locally:
devtools::load_all() # For interactive development # or devtools::install() # To install the package -
Run tests:
devtools::test() -
Check the package:
devtools::check()
Code Style
- Follow the tidyverse style guide
- Use
styler::style_pkg()to automatically format code - Use
lintr::lint_package()to check for style issues - Keep functions focused and well-documented
- Use meaningful variable and function names
Documentation
- All exported functions must have complete roxygen2 documentation
- Include
@examplesthat demonstrate usage - Update vignettes if adding major new functionality
- Keep README.md up to date
Testing
- Write tests for all new functionality using testthat
- Aim for high test coverage (>80%)
- Include both unit tests and integration tests where appropriate
- Tests should be self-contained and reproducible
- Use
skip_on_cran()for tests that require internet access
Development Workflow
Adding a New Function
- Write the function in the appropriate
R/*.Rfile - Add roxygen2 documentation with:
-
@titleand@description -
@paramfor each parameter -
@returndescribing the return value -
@exportif the function should be user-facing -
@exampleswith runnable examples
-
- Update
NAMESPACEwithdevtools::document() - Add tests in
tests/testthat/test-*.R - Update relevant vignettes if needed
- Run
devtools::check()to ensure everything works
Working with the MCP Server
The MCP server is built using plumber and plumber2mcp:
- Server code:
R/mcp_server.R - API endpoints:
inst/plumber/hgnc_api.R(if it exists) - Resources:
R/hgnc_resources.R - Prompts:
R/hgnc_prompts.R
When modifying the server:
- Test locally with
start_hgnc_mcp_server() - Check the Swagger UI at
http://localhost:8080/__docs__/ - Test MCP integration with a client if possible
- Update server documentation
Release Process
(For maintainers)
- Update version in
DESCRIPTION(follow semantic versioning) - Update
NEWS.mdwith changes since last release - Run
devtools::check()and ensure no errors/warnings - Update
cran-comments.mdwith submission notes - Build and test tarball:
devtools::build()andR CMD check --as-cran - Submit to CRAN if ready
- Tag release on GitHub
- Build and push Docker image with version tag