# Contributing
Contributions are welcome, and they are greatly appreciated. Every
little bit helps, and credit will always be given.
You can contribute in many ways:
## Types of Contributions
### Report Bugs
Report bugs at <https://github.com/dollarhyde/gr-mcp/issues>.
If you are reporting a bug, please include:
- Your operating system name and version.
- The Python and GNU Radio versions you are using.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
### Fix Bugs
Look through the GitHub issues for bugs. Anything tagged with `bug`
is open to whoever wants to implement it.
### Implement Features
Look through the GitHub issues for features. Anything tagged with
`enhancement` is open to whoever wants to implement it.
### Write Documentation
GR-MCP could always use more documentation,
whether as part of the README, in docstrings, or even
on the web in blog posts, articles, and such.
### Submit Feedback
The best way to send feedback is to file an issue at
<https://github.com/dollarhyde/gr-mcp/issues>.
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
## Get Started
Ready to contribute? Here's how to set up GR-MCP for local development.
1. Fork the gr-mcp repo on GitHub.
2. Clone your fork locally:
```shell
git clone https://github.com/your-username/gr-mcp.git
```
3. Install the dependencies:
```shell
cd gr-mcp
pip install -r requirements.txt
```
4. Create a branch for local development:
```shell
git checkout -b name-of-your-bugfix-or-feature
```
Now you can make your changes locally.
5. When you're done making changes, check that your changes pass the tests and linter:
```shell
pytest
ruff check src/
ruff format --check src/
```
6. Commit your changes and push your branch to GitHub:
```shell
git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature
```
7. Submit a pull request through the GitHub website.
## Adding New Tools
1. Add the tool function in `src/bridge_mcp_gnuradio.py`:
```python
@mcp.tool()
def my_new_tool(
param1: str,
param2: int = 10
) -> MyResultModel:
"""Tool description.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
"""
manager = get_manager()
# Implementation
return MyResultModel(...)
```
2. Add the return model in `src/models.py`:
```python
class MyResultModel(BaseModel):
"""Result of my_new_tool."""
field1: str = Field(description="Description")
field2: int = Field(description="Description")
```
## Adding Templates
Create a YAML file in `templates/`:
```yaml
id: my_template
name: My Template
description: Template description
category: category_name
default_params:
param1: "default_value"
blocks:
- type: block_type_id
name: instance_name
params:
param_id: "${param1}"
connections:
- src_block: source_name
src_port: "0"
sink_block: sink_name
sink_port: "0"
```