Skip to main content
Glama

Gmail 두 번째 계정 MCP 서버

Version Python Node OAuth

Claude.ai 및 Claude Code에서 하나의 Gmail 사서함을 읽고 씁니다. Claude.ai 자체 Gmail 커넥터는 단일 계정만 처리하므로, 이 서버는 두 번째 계정을 위해 존재합니다. 사서함마다 인스턴스를 실행하면 각 커넥터는 지정된 주소에만 정확히 연결됩니다.

인스턴스당 하나의 사서함

인스턴스가 제공하는 계정은 GMAIL_CREDENTIALS_DIR에서 결정되며, 해당 프로세스에서는 그 외의 어떤 것에도 접근할 수 없습니다. 이러한 분리는 제한 사항이 아니라 핵심입니다. 서버가 항상 한 세트의 자격 증명만 보유하므로 초안이 잘못된 사서함에 들어갈 수 없습니다.

Related MCP server: Gmail MCP Local Server

도구

읽기

도구

제공 내용

gmail_profile

이 인스턴스가 제공하는 사서함과 그 개수

gmail_search

Gmail 고유의 검색 구문으로 검색

gmail_get_message

본문이 포함된 메시지 하나

gmail_get_thread

전체 대화, 오래된 순서부터

gmail_list_attachments

메시지의 파일 이름, 유형, 크기

gmail_list_labels

ID가 포함된 모든 라벨

gmail_list_drafts / gmail_get_draft

사서함에 대기 중인 초안

쓰기

도구

기능

gmail_create_draft

초안 작성, 선택적으로 답장 스레드로 연결

gmail_update_draft

초안 내용 교체

gmail_delete_draft

초안 삭제

gmail_modify_labels

메시지에 라벨 추가 또는 제거

gmail_archive

받은편지함에서 메시지 꺼내기

gmail_mark_read

읽음 또는 읽지 않음으로 표시

gmail_trash / gmail_untrash

휴지통으로 이동 및 복원

gmail_create_label / gmail_delete_label

라벨 관리

gmail_send_draft

기존 초안 보내기

gmail_send_message

작성과 전송을 한 번에

두 전송 도구는 파괴적 동작으로 표시되어 있으며 설명에도 그렇게 명시되어 있습니다. 다른 사람에게 도달하며 되돌릴 수 없습니다. 안전한 방식은 gmail_create_draft로 초안을 작성하고, 이를 읽은 다음, 사람이 텍스트를 승인한 후 gmail_send_draft로 보내는 것입니다.

검색

gmail_search는 Gmail 검색창과 동일한 연산자를 사용합니다:

is:unread from:client.com
subject:invoice has:attachment newer_than:7d
label:important -in:trash

본문 대신 메시지별 헤더와 스니펫을 반환하므로 넓은 검색도 가볍게 유지됩니다. 이후 gmail_get_message 또는 gmail_get_thread로 이어서 확인하세요.

구성 방식

Claude.ai / Claude Code
        |  HTTPS
   Cloudflare Tunnel, or any proxy that gives you HTTPS
        |
   nginx  127.0.0.1:8461
        |
   auth-server.js  :8462    handles the login and the tokens
        |
   gmail-mcp  :8460         the server itself, local only
        |
   gmail.googleapis.com

MCP에는 자체 로그인이 없으며 로컬 머신 외의 어떤 곳에서도 수신 대기하지 않습니다. 따라서 MCP에 도달하는 모든 것은 이미 로그인을 통과한 상태입니다.

구성

Gmail API가 활성화된 Google Cloud OAuth 클라이언트와 사서함의 갱신 토큰이 필요합니다. 자격 증명 디렉터리에는 두 개의 파일이 있습니다:

credentials.json        {"refresh_token": "..."}
gcp-oauth.keys.json     the downloaded OAuth client

gmail.modify가 부여할 범위입니다. 읽기, 라벨링, 초안 작성, 보내기를 포함합니다. 자격 증명 자체가 전송할 수 없게 하려면 gmail.readonlygmail.compose로 낮추세요.

git clone https://github.com/rollecode/gmail-second-account-mcp.git
cd gmail-second-account-mcp
uv venv && uv pip install -e .
npm install --omit=dev

CONFIG_DIR=~/.config/gmail-mcp node set-password.js 'your-password-here'
openssl rand -hex 32 > ~/.config/gmail-mcp/token
chmod 600 ~/.config/gmail-mcp/token

systemd/*.servicenginx/gmail-mcp.conf에서 YOUR_USER, 호스트 이름, 자격 증명 디렉터리를 입력한 다음:

sudo cp systemd/*.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now gmail-mcp gmail-mcp-auth

sudo cp nginx/gmail-mcp.conf /etc/nginx/sites-enabled/gmail-mcp
sudo nginx -t && sudo systemctl reload nginx

터널 또는 HTTPS 프록시를 127.0.0.1:8461로 연결하세요. OAuth에는 HTTPS가 필요합니다.

외부에서 확인하세요: discovery는 메타데이터를 반환하고, 토큰 없이 /mcp에 접근하면 401을 반환해야 합니다.

curl https://your-host/.well-known/oauth-authorization-server
curl -o /dev/null -w '%{http_code}\n' -X POST https://your-host/mcp

연결

Claude.ai: 설정(Settings), 커넥터(Connectors), 사용자 지정 커넥터 추가(Add custom connector), https://your-host/mcp, 클라이언트 ID와 시크릿은 비워 둡니다.

Claude Code:

claude mcp add --transport http gmail https://your-host/mcp \
  --header "Authorization: Bearer $(cat ~/.config/gmail-mcp/token)" --scope user

서버 없이 stdio를 통한 로컬 연결:

GMAIL_CREDENTIALS_DIR=/path/to/creds claude mcp add gmail -- /path/to/.venv/bin/gmail-mcp

설정

변수

용도

GMAIL_CREDENTIALS_DIR

credentials.jsongcp-oauth.keys.json이 있는 디렉터리

GMAIL_ACCOUNT_LABEL

서버 지침에 표시되는 사서함 이름

MCP_PUBLIC_URL

아이콘을 알리는 데 사용되는 공개 주소

ISSUER

로그인 서버의 공개 출처(origin)

PORT

로그인 서버 포트, 기본값 8462

UPSTREAM

MCP 서버 URL, 기본값 http://127.0.0.1:8460

CONFIG_DIR

비밀번호, 토큰, OAuth 데이터베이스가 저장되는 위치

액세스 토큰은 만료되면 메모리에서 갱신됩니다. 디스크에서 읽는 것은 갱신 토큰뿐입니다.

크레딧

로그인 계층은 rollecode/obsidian-remote-mcp에서 가져왔습니다.

A
license - permissive license
A
quality
A
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
2Releases (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
    Not graded
    quality
    F
    maintenance
    Enables reading, sending, searching, and managing Gmail through Claude using the official Google Gmail API.
    165
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude to read, search, send, and manage Gmail messages and threads through natural language.
    205
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Gmail integration with Claude Code for reading, sending, searching emails, and managing labels through natural language.
    205
    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…

  • Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.

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/rollecode/gmail-second-account-mcp'

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