Contributing to Binance MCP Server¶
Thank you for your interest in contributing to the Binance MCP Server! This document provides guidelines and information for contributors.
๐ค How to Contribute¶
When contributing to this repository, please first discuss the changes you wish to make via issue, email, or any other method with the project maintainers before making significant changes.
Quick Start for Contributors¶
- Fork the repository on GitHub
- Clone your fork locally
- Set up development environment (see Development Guide)
- Create a feature branch from
main
- Make your changes following our coding standards
- Test thoroughly on testnet
- Submit a pull request with clear description
๐ ๏ธ Development Setup¶
See our comprehensive Development Guide for detailed setup instructions, including:
- Prerequisites and installation
- Local development environment setup
- Code formatting and linting
- Testing guidelines
- Adding new tools
๐ Pull Request Process¶
Before Submitting¶
- Test your changes thoroughly on Binance testnet
- Run the full test suite and ensure all tests pass
- Update documentation if you've changed APIs or added features
- Follow code style guidelines (Black formatting, type hints)
- Add tests for new functionality
- Check that build succeeds with your changes
Pull Request Requirements¶
- Clear description of what the PR does and why
- Link to related issues if applicable
- Screenshots for UI changes (if any)
- Testing evidence that changes work on testnet
- Documentation updates for new features or API changes
- Version update if this is a breaking change
Review Process¶
- Automated checks must pass (CI/CD, tests, linting)
- Code review by project maintainers
- Security review for changes affecting API interactions
- Documentation review for completeness
- Final approval and merge
๐งช Testing Guidelines¶
Testing Requirements¶
- Unit tests for all new functions and methods
- Integration tests for tool interactions with Binance API
- Error handling tests for various failure scenarios
- Mock tests to avoid real API calls during development
Testing on Testnet¶
Always test new features on Binance testnet:
export BINANCE_TESTNET="true"
export BINANCE_API_KEY="your_testnet_key"
export BINANCE_API_SECRET="your_testnet_secret"
Test Commands¶
# Run all tests
pytest
# Run with coverage
pytest --cov=binance_mcp_server
# Run specific tests
pytest tests/test_tools/test_new_feature.py
๐ Documentation Guidelines¶
Documentation Requirements¶
- API documentation for any new tools
- Code comments for complex logic
- Type hints for all function parameters and returns
- Docstrings following Google style
- Usage examples for new features
Documentation Style¶
Follow our established patterns:
- Use clear, concise language
- Include practical examples
- Provide error handling guidance
- Add security considerations where relevant
๐ฏ Types of Contributions¶
๐ Bug Reports¶
When reporting bugs, please include:
- Environment details (Python version, OS, package version)
- Steps to reproduce the issue
- Expected vs actual behavior
- Error messages and stack traces
- Minimal code example if possible
โจ Feature Requests¶
For new features:
- Describe the use case and business value
- Provide examples of how it would be used
- Consider backward compatibility
- Check existing issues to avoid duplicates
๐ Documentation Improvements¶
Documentation contributions are always welcome:
- Fix typos and grammatical errors
- Improve clarity of existing content
- Add missing examples
- Update outdated information
๐ง Code Contributions¶
New Tools¶
When adding new Binance API tools:
- Create tool module in
binance_mcp_server/tools/
- Follow existing patterns for error handling and response format
- Add comprehensive tests
- Document the tool in API reference
- Register tool in main server
Bug Fixes¶
- Include tests that reproduce the bug
- Fix only the specific issue
- Maintain backward compatibility
- Update documentation if behavior changes
๐ Code Standards¶
Python Code Style¶
- Black for code formatting
- isort for import sorting
- mypy for type checking
- pytest for testing
- Google-style docstrings
Code Quality¶
- Type hints for all function signatures
- Error handling for all external API calls
- Rate limiting consideration for new API endpoints
- Logging for debugging and monitoring
- Security best practices for credential handling
Commit Messages¶
Use conventional commit format:
feat(tools): add get_margin_info tool
fix(config): handle missing environment variables
docs(api): update examples for get_balance
test(orders): add integration tests for create_order
๐ Release Process¶
Version Management¶
We follow Semantic Versioning (SemVer):
- MAJOR: Breaking changes
- MINOR: New features, backward compatible
- PATCH: Bug fixes, backward compatible
Release Checklist¶
- All tests pass on multiple Python versions
- Documentation is up to date
- Version number updated in
pyproject.toml
- Changelog updated with release notes
- Security review completed
- Performance testing on testnet
๐ Security Guidelines¶
API Key Security¶
- Never commit API keys or secrets
- Use environment variables for all credentials
- Test with testnet credentials only
- Document security requirements for new features
Code Security¶
- Validate all inputs from external sources
- Sanitize user data before API calls
- Handle rate limiting properly
- Implement proper error handling without exposing sensitive information
๐ Getting Help¶
Community Support¶
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and community support
- Documentation: Comprehensive guides and API reference
Maintainer Contact¶
For security issues or private discussions: - Email: dossehdosseh14@gmail.com
๐ Code of Conduct¶
Our Pledge¶
We pledge to make participation in this project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
Our Standards¶
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Enforcement¶
Instances of unacceptable behavior may be reported by contacting the project team at dossehdosseh14@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
Thank you for contributing to the Binance MCP Server! Your efforts help make cryptocurrency trading more accessible through AI agents and the Model Context Protocol.