Skip to main content
Glama
adityai4

gmail-cleanup-mcp

by adityai4

Gmail 정리 MCP 서버

이메일 정리를 위한 Model Context Protocol 서버 — 이메일 휴지통 이동, 필터 관리, 구독 취소 링크 추출 기능을 제공합니다. 이메일 검색, 읽기, 초안 작성, 보내기를 처리하는 Anthropic의 내장 Gmail 커넥터를 보완하도록 설계되었습니다.

dc/gmail-cleanup-mcp의 패치 버전 (MIT 라이선스). 이 포크는 search_and_trashbatch_trash_emails가 실패를 자동으로 재시도하지 않고 조용히 무시하던 버그를 수정합니다 — 동시에 50개의 휴지통 요청을 보내면 Gmail의 속도 제한에 걸려 오류 메시지 없이 약 절반의 요청이 유실될 수 있습니다. 이제 두 도구 모두 배치 크기를 줄이고, 백오프(backoff)를 적용하며, 자동 재시도하고, 실패한 각 메시지에 대해 실제 오류를 보고합니다.

도구

도구

설명

trash_email

단일 이메일을 휴지통으로 이동 (30일 보관 기간)

batch_trash_emails

메시지 ID로 최대 500개의 이메일을 휴지통으로 이동 (50개씩 배치 처리)

search_and_trash

Gmail 쿼리로 이메일을 찾아 휴지통으로 이동 — 시험 실행(dry-run) 지원

create_filter

자동 보관, 라벨 지정, 삭제 또는 전달을 위한 필터 생성

list_filters

기준 및 작업을 포함한 모든 기존 Gmail 필터 나열

delete_filter

ID로 Gmail 필터 삭제

get_unsubscribe_info

이메일에서 List-Unsubscribe 헤더 추출

Related MCP server: Gmail AutoAuth MCP Server

사전 요구 사항

  • Node.js 18+

  • Gmail API가 활성화된 Google Cloud 프로젝트

  • OAuth 2.0 자격 증명 (데스크톱 앱 유형)

설정

1. Google Cloud OAuth

이미 다른 Gmail MCP 서버에서 ~/.gmail-mcp/gcp-oauth.keys.json 파일을 가지고 있나요? 2단계로 건너뛰세요 — 이 서버는 동일한 자격 증명 위치를 사용합니다.

  1. Google Cloud 콘솔로 이동

  2. 프로젝트 생성 (또는 기존 프로젝트 사용) 및 Gmail API 활성화

  3. 사용자 인증 정보사용자 인증 정보 만들기OAuth 클라이언트 ID로 이동

  4. 데스크톱 앱 선택, JSON 다운로드

  5. ~/.gmail-mcp/gcp-oauth.keys.json으로 저장 (또는 프로젝트 디렉토리에 gcp-oauth.keys.json 배치 — 첫 실행 시 자동으로 복사됩니다)

2. 설치 및 빌드

git clone https://github.com/davidcerniglia/gmail-cleanup-mcp.git
cd gmail-cleanup-mcp
npm install
npm run build

3. 인증

npm run auth

브라우저에서 Google OAuth 동의 화면이 열립니다. 자격 증명은 0600 권한(소유자만 읽기/쓰기)으로 ~/.gmail-mcp/credentials.json에 저장됩니다.

4. Claude Desktop에 추가

~/Library/Application Support/Claude/claude_desktop_config.json에 추가 (macOS):

{
  "mcpServers": {
    "gmail-cleanup": {
      "command": "node",
      "args": ["/absolute/path/to/gmail-cleanup-mcp/dist/index.js"]
    }
  }
}

또는 Claude Code의 경우 .claude/settings.json에 추가:

{
  "mcpServers": {
    "gmail-cleanup": {
      "command": "node",
      "args": ["/absolute/path/to/gmail-cleanup-mcp/dist/index.js"]
    }
  }
}

사용 예시

프롬프트

동작

"6개월 이상 된 newsletter@spam.com의 모든 이메일 휴지통으로 이동"

Gmail 쿼리 구문으로 search_and_trash 실행

"LinkedIn에서 온 이메일 중 삭제될 항목을 미리 보여줘"

dryRun: truesearch_and_trash 실행 — 일치 항목 미리보기

"nextdoor.com에서 온 이메일을 자동으로 보관하는 필터 생성"

removeLabelIds: ["INBOX"]create_filter 실행

"그 마케팅 이메일에 구독 취소 링크가 있는지 확인해줘"

get_unsubscribe_infoList-Unsubscribe 헤더 추출

내장 Gmail 커넥터와의 연동 방식

내장 Gmail 커넥터

이 서버

검색 및 읽기

지원

초안 작성 및 보내기

지원

이메일 휴지통 이동

지원

대량 정리

지원 (호출당 최대 500개)

필터 관리

지원

구독 취소 추출

지원

보안

  • 최소 권한 범위: gmail.modify + gmail.settings.basic — 휴지통 및 필터 작업에 필요한 최소한의 권한

  • 휴지통 이동, 영구 삭제 아님: 모든 삭제 작업은 Gmail의 휴지통(30일 복구 기간)을 사용하며, 영구 삭제는 절대 수행하지 않습니다

  • 시험 실행 모드: search_and_trash는 실행 전에 일치 항목을 미리 볼 수 있습니다

  • 제한적인 파일 권한: 자격 증명은 0600 권한(소유자만 읽기/쓰기)으로 저장됩니다

  • 첨부 파일 미처리: 첨부 파일을 다루지 않아 경로 탐색(path traversal) 위험이 없습니다

  • 파일 시스템 접근 없음: ~/.gmail-mcp/의 자격 증명 저장 외에는 파일 시스템에 접근하지 않습니다

환경 변수

변수

기본값

설명

GMAIL_OAUTH_PATH

~/.gmail-mcp/gcp-oauth.keys.json

OAuth 클라이언트 키 경로

GMAIL_CREDENTIALS_PATH

~/.gmail-mcp/credentials.json

저장된 자격 증명 경로

라이선스

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    Enables comprehensive Gmail management through the Gmail API, including sending/receiving emails, organizing labels and threads, managing drafts, and configuring account settings with secure OAuth2 authentication.
    64
    1,398
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage Gmail through natural language interactions, supporting email operations (send, read, search, draft), comprehensive attachment handling (send, receive, download), label management, filters, and batch operations with automatic OAuth2 authentication.
    192
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Provides comprehensive Gmail integration with 25+ tools for intelligent email management, including AI-powered categorization, advanced search and filtering, automated archiving and cleanup, analytics, and secure OAuth2 authentication.
    192
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage Gmail through natural language, supporting operations like sending, searching, and reading emails. It includes comprehensive label management, batch processing, and a streamlined OAuth2 auto-authentication flow.
    MIT

View all related MCP servers

Related MCP Connectors

  • Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…

  • Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…

  • AI email automation, follow-ups, training, previews, and mailbox troubleshooting.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/adityai4/gmail-cleanup-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server