# π€ 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. π