UNPKG

leadmagic-mcp-server

Version:

Model Context Protocol server for LeadMagic API - Complete B2B data enrichment with 19 tools for email finding, profile enrichment, company intelligence, job data, and advertisement tracking

372 lines (271 loc) โ€ข 8.9 kB
# ๐Ÿค Contributing to LeadMagic MCP Server Thank you for your interest in contributing to LeadMagic MCP Server! This guide will help you get started with contributing to our project. ## ๐Ÿ“‹ Table of Contents - [Getting Started](#-getting-started) - [Development Setup](#-development-setup) - [Contributing Process](#-contributing-process) - [Code Standards](#-code-standards) - [Testing Guidelines](#-testing-guidelines) - [Documentation](#-documentation) - [Issue Guidelines](#-issue-guidelines) - [Pull Request Process](#-pull-request-process) - [Release Process](#-release-process) - [Community](#-community) ## ๐Ÿš€ Getting Started ### ๐Ÿ” Ways to Contribute - ๐Ÿ› **Bug Reports**: Help us identify and fix issues - ๐Ÿ’ก **Feature Requests**: Suggest new features and improvements - ๐Ÿ“ **Documentation**: Improve our docs, examples, and guides - ๐Ÿงช **Testing**: Help test new features and bug fixes - ๐Ÿ’ป **Code**: Implement new features or fix bugs - ๐ŸŽจ **Design**: Improve UX/UI of our tools and documentation - ๐ŸŒ **Translation**: Help translate documentation - ๐Ÿ’ฌ **Community**: Help others in discussions and issues ### ๐ŸŽฏ Good First Issues Look for issues labeled: - `good first issue` - Perfect for newcomers - `help wanted` - We need community help - `documentation` - Documentation improvements - `bug` - Bug fixes ## ๐Ÿ’ป Development Setup ### ๐Ÿ“‹ Prerequisites - ๐Ÿ“ฆ **Node.js**: 18.0.0 or higher - ๐Ÿ”‘ **LeadMagic API Key**: Get one from [leadmagic.io](https://app.leadmagic.io) - ๐Ÿ™ **Git**: For version control - ๐Ÿ“ **Code Editor**: VS Code, Cursor, or your preferred editor ### ๐Ÿ› ๏ธ Local Setup ```bash # 1. Fork and clone the repository git clone https://github.com/YOUR-USERNAME/leadmagic-mcp.git cd leadmagic-mcp # 2. Install dependencies npm install # 3. Create environment file cp .env.example .env # Edit .env and add your LEADMAGIC_API_KEY # 4. Build the project npm run build # 5. Run validation npm run validate # 6. Test the server npm run dev ``` ### ๐Ÿ”ง Development Commands ```bash # ๐Ÿ—๏ธ Build project npm run build # ๐Ÿ” Type checking npm run type-check # ๐ŸŽจ Linting npm run lint npm run lint:fix # ๐ŸŽจ Code formatting npm run format npm run format:check # ๐Ÿงช Testing npm test npm run test:watch npm run test:coverage # โœ… Full validation npm run validate # ๐Ÿ” MCP Inspector (for testing) npm run inspector ``` ## ๐Ÿ”„ Contributing Process ### 1. ๐Ÿด Fork the Repository Click the "Fork" button on GitHub and clone your fork: ```bash git clone https://github.com/YOUR-USERNAME/leadmagic-mcp.git cd leadmagic-mcp git remote add upstream https://github.com/LeadMagic/leadmagic-mcp.git ``` ### 2. ๐ŸŒฟ Create a Branch ```bash # Create and switch to a new branch git checkout -b feature/your-feature-name # Or for bug fixes git checkout -b fix/issue-description ``` ### 3. ๐Ÿ’ป Make Changes - Write clear, focused commits - Follow our code standards - Add/update tests as needed - Update documentation ### 4. โœ… Test Your Changes ```bash # Run full validation npm run validate # Test manually with MCP inspector npm run inspector # Test with real MCP clients (Claude, Cursor, etc.) ``` ### 5. ๐Ÿ“ค Submit Pull Request ```bash # Push your branch git push origin feature/your-feature-name # Create PR on GitHub ``` ## ๐Ÿ“ Code Standards ### ๐ŸŽจ TypeScript Style ```typescript // โœ… Good interface EmailRequest { email: string; validate_syntax?: boolean; } // โŒ Avoid interface emailrequest { email: any; validateSyntax: boolean; } ``` ### ๐Ÿ“ File Organization ``` src/ โ”œโ”€โ”€ types.ts # Type definitions and Zod schemas โ”œโ”€โ”€ client.ts # API client implementation โ”œโ”€โ”€ server.ts # MCP server with tools โ””โ”€โ”€ index.ts # Entry point ``` ### ๐Ÿ”ง Code Guidelines - **๐Ÿ“ Use TypeScript**: All code must be typed - **โœ… Validate inputs**: Use Zod schemas for validation - **๐Ÿ›ก๏ธ Handle errors**: Comprehensive error handling - **๐Ÿ“– Document code**: Clear comments for complex logic - **๐Ÿงช Write tests**: Cover new functionality - **๐ŸŽจ Follow conventions**: Use existing patterns ### ๐Ÿšซ Code Style Rules - โœ… Use `snake_case` for API field names (LeadMagic convention) - โœ… Use `camelCase` for TypeScript variables/functions - โœ… Use `const` over `let` where possible - โœ… Prefer explicit types over `any` - โœ… Use meaningful variable names - โŒ No console.log in production code - โŒ No unused variables or imports ## ๐Ÿงช Testing Guidelines ### ๐ŸŽฏ Test Coverage - **Unit Tests**: Test individual functions and methods - **Integration Tests**: Test API client with LeadMagic - **MCP Tests**: Test MCP server functionality - **Manual Tests**: Test with real MCP clients ### ๐Ÿ“ Writing Tests ```typescript // Example test structure describe('EmailValidator', () => { it('should validate correct email format', async () => { const result = await client.validateEmail({ email: 'test@example.com' }); expect(result.email_status).toBe('valid'); }); }); ``` ### ๐Ÿ”ง Test Commands ```bash # Run tests npm test # Watch mode for development npm run test:watch # Coverage report npm run test:coverage # Test specific file npm test -- email.test.ts ``` ## ๐Ÿ“š Documentation ### ๐Ÿ“ Documentation Standards - **Clear and concise**: Easy to understand - **Examples included**: Show real usage - **Up to date**: Keep in sync with code changes - **Comprehensive**: Cover all features ### ๐Ÿ“– Documentation Types - **README.md**: Main documentation - **CHANGELOG.md**: Version history - **Code comments**: Inline documentation - **Issue templates**: Contribution guides - **Examples**: Usage demonstrations ### โœ… Documentation Checklist - [ ] Updated README for new features - [ ] Added code comments for complex logic - [ ] Updated CHANGELOG for significant changes - [ ] Included usage examples - [ ] Checked for typos and grammar ## ๐Ÿ› Issue Guidelines ### ๐Ÿ“ Creating Issues Before creating an issue: 1. ๐Ÿ” Search existing issues 2. ๐Ÿ“š Check documentation 3. ๐Ÿงช Test with latest version ### ๐Ÿ› Bug Reports Include: - **๐Ÿ“‹ Environment details** (OS, Node.js, MCP client) - **๐Ÿ”„ Steps to reproduce** - **๐Ÿ“ฑ Expected vs actual behavior** - **๐Ÿ“‹ Error messages/logs** - **๐Ÿ”ง Configuration details** (remove API keys!) ### ๐Ÿ’ก Feature Requests Include: - **๐ŸŽฏ Use case and benefits** - **๐Ÿ“ Detailed description** - **๐Ÿ”ง Implementation ideas** (optional) - **๐Ÿ“Š Priority and timeline** ## ๐Ÿ”„ Pull Request Process ### โœ… PR Checklist Before submitting: - [ ] ๐Ÿงช All tests pass - [ ] ๐Ÿ“š Documentation updated - [ ] ๐ŸŽจ Code follows style guidelines - [ ] โœ… No linting errors - [ ] ๐Ÿ”ง Builds successfully - [ ] ๐Ÿงน No debugging code left ### ๐Ÿ“ PR Description Include: - **๐Ÿ“‹ Clear description** of changes - **๐Ÿ”— Related issue numbers** - **๐Ÿงช Testing details** - **๐Ÿ’ฅ Breaking changes** (if any) - **๐Ÿ“ธ Screenshots** (if applicable) ### ๐Ÿ” Review Process 1. **๐Ÿค– Automated checks** must pass 2. **๐Ÿ‘ฅ Code review** by maintainers 3. **โœ… Approval** required before merge 4. **๐Ÿ”„ Squash and merge** preferred ## ๐Ÿš€ Release Process ### ๐Ÿ“Š Version Numbers We follow [Semantic Versioning](https://semver.org/): - **Major** (1.0.0): Breaking changes - **Minor** (1.1.0): New features (backward compatible) - **Patch** (1.0.1): Bug fixes ### ๐Ÿท๏ธ Creating Releases 1. Update version in `package.json` 2. Update `CHANGELOG.md` 3. Create git tag: `git tag v1.0.0` 4. Push tag: `git push origin v1.0.0` 5. GitHub Actions will handle the rest ## ๐Ÿ‘ฅ Community ### ๐Ÿ’ฌ Communication Channels - **๐Ÿ™ GitHub Issues**: Bug reports, feature requests - **๐Ÿ’ฌ Discord**: Community chat and support - **๐Ÿ“ง Email**: support@leadmagic.io - **๐Ÿฆ Twitter**: @LeadMagic (updates and announcements) ### ๐Ÿค Code of Conduct We follow a **positive and inclusive** approach: - โœ… Be respectful and constructive - โœ… Welcome newcomers and questions - โœ… Focus on technical merit - โŒ No harassment or discrimination - โŒ No spam or off-topic content ### ๐ŸŽ‰ Recognition Contributors are recognized through: - **๐Ÿ“ CHANGELOG mentions** - **๐Ÿ† GitHub contributors list** - **๐Ÿ’ฌ Community shoutouts** - **๐ŸŽ LeadMagic swag** (for significant contributions) ## โ“ Questions? **Need help getting started?** - ๐Ÿ“š Read our [documentation](https://github.com/LeadMagic/leadmagic-mcp/blob/main/README.md) - ๐Ÿ’ฌ Join our [Discord community](https://discord.gg/leadmagic) - ๐Ÿ“ง Email us: support@leadmagic.io - ๐Ÿ™ Open a [GitHub discussion](https://github.com/LeadMagic/leadmagic-mcp/discussions) --- **๐ŸŽ‰ Thank you for contributing to LeadMagic MCP Server!** Your contributions help make B2B data enrichment more accessible to developers and AI tools worldwide. ๐Ÿš€