# ๐ค 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/LeadMagic/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/LeadMagic/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. ๐