|
| 1 | +# Contributing to Nasdaq Data Link MCP |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Nasdaq Data Link MCP Server! This document provides guidelines for contributing to the project. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +- Python 3.13+ |
| 10 | +- uv package manager |
| 11 | +- Git |
| 12 | + |
| 13 | +### Development Setup |
| 14 | + |
| 15 | +1. **Clone the repository** |
| 16 | + ```bash |
| 17 | + git clone https://github.com/stefanoamorelli/nasdaq-data-link-mcp.git |
| 18 | + cd nasdaq-data-link-mcp |
| 19 | + ``` |
| 20 | + |
| 21 | +2. **Set up development environment** |
| 22 | + ```bash |
| 23 | + uv init mcp |
| 24 | + uv add "mcp[cli]" |
| 25 | + uv add --group test "pytest>=7.0" "pytest-mock" "pytest-cov" |
| 26 | + ``` |
| 27 | + |
| 28 | +3. **Configure environment variables** |
| 29 | + ```bash |
| 30 | + cp .env.example .env |
| 31 | + # Add your Nasdaq Data Link API key to .env |
| 32 | + ``` |
| 33 | + |
| 34 | +4. **Install the server in development mode** |
| 35 | + ```bash |
| 36 | + uv run mcp install nasdaq_data_link_mcp_os/server.py --env-file .env --name "Nasdaq Data Link MCP Server" --with nasdaq-data-link --with pycountry |
| 37 | + ``` |
| 38 | + |
| 39 | +## Development Workflow |
| 40 | + |
| 41 | +### Code Style |
| 42 | + |
| 43 | +- Follow PEP 8 guidelines |
| 44 | +- Use meaningful variable names and clear function signatures |
| 45 | +- Add docstrings to all public functions and classes |
| 46 | +- Keep functions focused and single-purpose |
| 47 | + |
| 48 | +### Testing |
| 49 | + |
| 50 | +- Write tests for all new functionality |
| 51 | +- Run tests before submitting changes: |
| 52 | + ```bash |
| 53 | + uv run pytest tests/ |
| 54 | + ``` |
| 55 | +- Aim for good test coverage of critical functionality |
| 56 | +- Use mocking for external API calls in tests |
| 57 | +- All tests must pass in CI before merge |
| 58 | + |
| 59 | +### Code Quality |
| 60 | + |
| 61 | +- Run linting and formatting: |
| 62 | + ```bash |
| 63 | + uv run ruff check nasdaq_data_link_mcp_os/ tests/ |
| 64 | + uv run ruff format nasdaq_data_link_mcp_os/ tests/ |
| 65 | + ``` |
| 66 | +- Run type checking: |
| 67 | + ```bash |
| 68 | + uv run mypy nasdaq_data_link_mcp_os/ |
| 69 | + ``` |
| 70 | + |
| 71 | +### Documentation |
| 72 | + |
| 73 | +- Update README.md if adding new features |
| 74 | +- Update relevant documentation in `docs/` directory |
| 75 | +- Include usage examples for new tools |
| 76 | +- Update the paper.md if changes affect the research description |
| 77 | + |
| 78 | +## Types of Contributions |
| 79 | + |
| 80 | +### Bug Reports |
| 81 | + |
| 82 | +When filing a bug report, please include: |
| 83 | + |
| 84 | +- Clear description of the issue |
| 85 | +- Steps to reproduce the problem |
| 86 | +- Expected vs actual behavior |
| 87 | +- Python version and environment details |
| 88 | +- Relevant error messages or logs |
| 89 | + |
| 90 | +### Feature Requests |
| 91 | + |
| 92 | +For new features, please: |
| 93 | + |
| 94 | +- Describe the use case and motivation |
| 95 | +- Explain how it fits with existing functionality |
| 96 | +- Consider backward compatibility |
| 97 | +- Provide examples of the desired behavior |
| 98 | + |
| 99 | +### Code Contributions |
| 100 | + |
| 101 | +#### Adding New Tools |
| 102 | + |
| 103 | +1. **Create the tool module** in the appropriate resource directory: |
| 104 | + ``` |
| 105 | + nasdaq_data_link_mcp_os/resources/[category]/[tool_name].py |
| 106 | + ``` |
| 107 | + |
| 108 | +2. **Follow the existing pattern**: |
| 109 | + - Import required dependencies |
| 110 | + - Define tool function with proper type hints |
| 111 | + - Add comprehensive error handling |
| 112 | + - Include docstring with usage examples |
| 113 | + |
| 114 | +3. **Register the tool** in `server.py`: |
| 115 | + ```python |
| 116 | + @server.list_tools() |
| 117 | + async def list_tools() -> list[Tool]: |
| 118 | + return [ |
| 119 | + # ... existing tools |
| 120 | + Tool( |
| 121 | + name="your_new_tool", |
| 122 | + description="Clear description of what the tool does", |
| 123 | + inputSchema={ |
| 124 | + "type": "object", |
| 125 | + "properties": { |
| 126 | + # Define parameters |
| 127 | + } |
| 128 | + } |
| 129 | + ) |
| 130 | + ] |
| 131 | + ``` |
| 132 | + |
| 133 | +4. **Add tests** in `tests/test_tools.py` or create new test file |
| 134 | + |
| 135 | +#### Improving Existing Tools |
| 136 | + |
| 137 | +- Maintain backward compatibility |
| 138 | +- Update documentation and examples |
| 139 | +- Add tests for new functionality |
| 140 | +- Consider edge cases and error handling |
| 141 | + |
| 142 | +## Pull Request Process |
| 143 | + |
| 144 | +1. **Fork the repository** and create a feature branch: |
| 145 | + ```bash |
| 146 | + git checkout -b feature/your-feature-name |
| 147 | + ``` |
| 148 | + |
| 149 | +2. **Make your changes** following the guidelines above |
| 150 | + |
| 151 | +3. **Test thoroughly**: |
| 152 | + ```bash |
| 153 | + uv run pytest tests/ |
| 154 | + ``` |
| 155 | + |
| 156 | +4. **Update documentation** as needed |
| 157 | + |
| 158 | +5. **Commit with clear messages**: |
| 159 | + ```bash |
| 160 | + git commit -m "Add feature: description of what was added" |
| 161 | + ``` |
| 162 | + |
| 163 | +6. **Push to your fork** and create a pull request: |
| 164 | + ```bash |
| 165 | + git push origin feature/your-feature-name |
| 166 | + ``` |
| 167 | + |
| 168 | +7. **Describe your changes** in the pull request: |
| 169 | + - What was changed and why |
| 170 | + - How to test the changes |
| 171 | + - Any breaking changes or special considerations |
| 172 | + |
| 173 | +## Code Review |
| 174 | + |
| 175 | +All contributions will be reviewed for: |
| 176 | + |
| 177 | +- Code quality and adherence to project standards |
| 178 | +- Test coverage and functionality |
| 179 | +- Documentation completeness |
| 180 | +- Backward compatibility |
| 181 | +- Security considerations |
| 182 | + |
| 183 | +## Community Guidelines |
| 184 | + |
| 185 | +- Be respectful and constructive in discussions |
| 186 | +- Help others learn and grow |
| 187 | +- Focus on the technical merits of contributions |
| 188 | +- Acknowledge the work of others |
| 189 | + |
| 190 | +## Getting Help |
| 191 | + |
| 192 | +- Check existing issues for similar problems |
| 193 | +- Ask questions in GitHub Discussions |
| 194 | +- Reach out to maintainers if needed |
| 195 | + |
| 196 | +## License |
| 197 | + |
| 198 | +By contributing to this project, you agree that your contributions will be licensed under the same MIT License that covers the project. |
| 199 | + |
| 200 | +## Recognition |
| 201 | + |
| 202 | +Contributors will be acknowledged in: |
| 203 | +- GitHub contributor list |
| 204 | +- Release notes for significant contributions |
| 205 | +- README.md for major features |
| 206 | + |
| 207 | +Thank you for helping make financial data more accessible through conversational AI! |
0 commit comments