besir-mailer
v1.0.9
Published
BeSir Browser와 통합되는 이메일 관리 MCP(Model Context Protocol) 서버
Maintainers
Readme
BeSir Mailer MCP Server
AI 어시스턴트와 통합되는 이메일 관리 MCP(Model Context Protocol) 서버입니다.
🚀 빠른 시작
설치
# npx로 즉시 실행 (권장)
npx besir-mailer
# 또는 전역 설치
npm install -g besir-mailer
besir-mailer환경 설정
실행하기 전에 현재 디렉토리에 .env 파일을 생성하세요:
Gmail 사용 예시:
# SMTP 설정 (Gmail)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_SECURE=false
[email protected]
SMTP_PASS=your-app-password
# IMAP 설정 (Gmail)
EMAIL_PROTOCOL=imap
EMAIL_HOST=imap.gmail.com
EMAIL_PORT=993
EMAIL_SECURE=true
[email protected]
EMAIL_PASS=your-app-password
# 웹훅 설정 (선택사항)
WEBHOOK_URL=https://your-webhook-endpoint.com/email
POLLING_INTERVAL=60000Naver Works 사용 예시:
# SMTP 설정 (Naver Works)
SMTP_HOST=smtp.worksmobile.com
SMTP_PORT=465
SMTP_SECURE=true
[email protected]
SMTP_PASS=your-external-app-password
# IMAP/POP3 설정 (Naver Works)
EMAIL_PROTOCOL=imap
EMAIL_HOST=imap.worksmobile.com
EMAIL_PORT=993
EMAIL_SECURE=true
[email protected]
EMAIL_PASS=your-external-app-password
# 웹훅 설정 (선택사항)
WEBHOOK_URL=https://your-webhook-endpoint.com/email실행
# MCP 서버로 실행 (표준 사용법)
npx besir-mailer
# 개발 모드 (소스에서)
git clone https://github.com/besir-team/besir-mailer.git
cd besir-mailer
npm install
npm run dev🛠️ MCP 도구
send_email
이메일을 전송합니다.
{
"tool": "send_email",
"arguments": {
"to": "[email protected]",
"subject": "제목",
"body": "<h1>HTML 본문</h1>",
"cc": "[email protected]",
"attachments": [
{
"filename": "document.pdf",
"content": "base64-encoded-content",
"encoding": "base64"
}
]
}
}check_email
새로운 이메일을 확인합니다.
{
"tool": "check_email",
"arguments": {
"limit": 10,
"unreadOnly": true
}
}list_emails
이메일 목록을 조회합니다.
{
"tool": "list_emails",
"arguments": {
"folder": "INBOX",
"limit": 20,
"offset": 0,
"search": "중요한"
}
}🔔 자동 이메일 모니터링
새 이메일이 도착하면 백그라운드에서 자동으로 감지하여 외부 웹훅 URL로 알림을 전송합니다.
웹훅 페이로드
{
"event": "email_received",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"from": "[email protected]",
"to": "[email protected]",
"subject": "메일 제목",
"body": "메일 본문",
"messageId": "unique-message-id",
"attachments": []
}
}📋 AI 어시스턴트 통합
Cursor IDE
Cursor의 MCP 설정에 추가:
{
"mcpServers": {
"besir-mailer": {
"command": "npx",
"args": ["besir-mailer"],
"env": {
"SMTP_HOST": "smtp.worksmobile.com",
"SMTP_PORT": "465",
"SMTP_SECURE": "true",
"SMTP_USER": "[email protected]",
"SMTP_PASS": "your-external-app-password",
"EMAIL_PROTOCOL": "imap",
"EMAIL_HOST": "imap.worksmobile.com",
"EMAIL_PORT": "993",
"EMAIL_SECURE": "true",
"EMAIL_USER": "[email protected]",
"EMAIL_PASS": "your-external-app-password"
}
}
}
}BeSir Browser
{
"mcpServers": {
"besir-mailer": {
"command": "npx",
"args": ["besir-mailer"],
"env": {
"SMTP_HOST": "smtp.gmail.com",
"SMTP_USER": "[email protected]",
"SMTP_PASS": "your-app-password"
}
}
}
}🏗️ 개발
요구사항
- Node.js 18+
- TypeScript 5.x
스크립트
# 설치
npm install
# 개발 서버
npm run dev
# 빌드
npm run build
# 테스트
npm test
# 린트
npm run lint프로젝트 구조
src/
├── index.ts # 진입점
├── tools/ # MCP 도구 구현
│ ├── send-email.ts
│ ├── check-email.ts
│ └── list-emails.ts
├── trigger/ # 트리거 서비스
│ ├── email-monitor.ts
│ └── webhook.ts
├── config/ # 설정 관리
│ └── env.ts
└── types/ # TypeScript 타입
└── index.ts🔒 보안
- 환경변수로 인증 정보 관리
- TLS/SSL 연결 지원
- 입력 검증 및 에러 처리
- 민감정보 로그 필터링
📚 문서
자세한 구현 계획은 implementation-plan.md를 참조하세요.
🤝 기여
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
📄 라이선스
MIT License - 자세한 내용은 LICENSE 파일을 참조하세요.
🆘 지원
- Issues: GitHub Issues
- Documentation: Wiki
- Email: [email protected]
