Thank you for your interest in contributing! This guide will help you get started.
- Fork the repository
- Clone your fork:
git clone https://github.com/<your-username>/email-mcp.git cd email-mcp
- Install dependencies:
pnpm install
- Create a feature branch:
git checkout -b feat/your-feature
- Node.js >= 22.0.0
- pnpm (package manager)
| Command | Description |
|---|---|
pnpm dev |
Start in watch mode (auto-reload) |
pnpm build |
Build for production |
pnpm typecheck |
Type-check without emitting |
pnpm lint |
Run ESLint |
pnpm lint:fix |
Run ESLint with auto-fix |
pnpm format |
Format code with Biome |
pnpm format:check |
Check formatting |
pnpm check |
Run both Biome and ESLint |
- Formatter: Biome — handles formatting and import organization
- Linter: ESLint with Airbnb Extended + TypeScript strict rules
- Run
pnpm checkbefore committing to catch issues
We follow Conventional Commits:
feat: add calendar event parsing
fix: handle null subject in email headers
docs: update configuration guide
refactor: extract connection retry logic
test: add rate limiter unit tests
src/
├── main.ts # CLI entry point
├── server.ts # MCP server factory
├── logging.ts # Protocol logging bridge
├── cli/ # CLI commands (setup, test, config)
├── config/ # Config loading + validation
├── connections/ # IMAP/SMTP connection management
├── services/ # Business logic (IMAP, SMTP, calendar, etc.)
├── tools/ # MCP tool definitions
├── resources/ # MCP resource definitions
├── prompts/ # MCP prompt definitions
├── safety/ # Rate limiter + audit logging
└── types/ # TypeScript type definitions
- Create a new file in
src/tools/(e.g.,my-feature.tool.ts) - Export a default function that takes the MCP server + services
- Use
server.tool()with Zod schemas for input validation - Add tool annotations (
readOnlyHint,destructiveHint, etc.) - Register it in
src/tools/register.ts - Add to the tools reference table in
README.md
- Ensure
pnpm checkandpnpm typecheckpass - Update documentation if your change affects user-facing behavior
- Write a clear PR description explaining what and why
- Link any related issues
- Use GitHub Issues for bugs and feature requests
- Use GitHub Discussions for questions and ideas
By contributing, you agree that your contributions will be licensed under the LGPL-3.0-or-later License.