gmail-mcp
Provides tools for reading, searching, and managing Gmail messages, threads, labels, and drafts, with support for multiple accounts. No sending of emails is allowed; only draft creation and label modifications.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gmail-mcplist my draft emails"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gmail-mcp
Gmail remote MCP — read + draft only, no send (TypeScript / Hono / Cloudflare Workers).
「読み取り+下書きまで、送信は人間」を実装レベルで強制する Gmail remote MCP サーバー。
エンドポイント:
https://gmail-mcp.ippoan.org/mcp(claude.ai / Claude Code のカスタムコネクタ URL)稼働 worker:
gmail-mcp-staging(staging=prod パターン、ci-dashboard と同じ)
設計原則
send 系ツールは実装しない。
messages.send/drafts.sendに到達する経路をサーバーに一切置かない。スコープ上は送信可能なトークン(gmail.modify)だが、MCP サーバーが送信エンドポイントを公開しないため Claude 経由の送信経路が存在しない。CI の snapshot テストが send 系ツール名の混入を弾く削除系は
delete_draft(下書き)のみ。 メッセージ/スレッドの完全削除はもちろん、TRASH / SPAM への移動もmodify_labelsが拒否する(Gmail API に届く前にバリデーション)マルチアカウント: 全ツールに
account?: string(エイリアス、省略時"default")。公式 Gmail コネクタの「1 アカウントのみ」制限を超えるのが動機の一つメール本文は信頼しない: 本文経由の prompt injection に対する最大の緩和策が「送信不可」設計そのもの。下書きは必ず人間が Gmail UI で確認してから送信する
Related MCP server: Gmail MCP Server
ツール(v1)
ツール | 区分 | 説明 |
| read | 登録アカウント一覧。 |
| read | Gmail 検索構文で検索(default 10 / 上限 50 件) |
| read | 本文取得。text/plain 優先 → HTML タグ除去。ISO-2022-JP 等対応。添付はメタのみ |
| read | ラベル一覧 |
| write | 下書き作成。 |
| read | 下書き一覧 |
| write | 唯一の削除系 |
| write | ラベル付け外し。アーカイブ = |
| read | 疎通確認 |
認証の2層構造
Claude ──[① binding_jwt]──▶ gmail-mcp ──[② Google OAuth]──▶ Gmail APIコネクタ認証 — auth-worker(
AUTH_WORKER_ORIGIN=https://auth-staging.ippoan.orgが実稼働 AS)の binding_jwt を/mcp/introspectへ転送して検証。worker 側に shared secret 不要・fail-closed。CF Access は host をmeで保護し/mcpのみ bypassAll(org 標準パターン)Gmail 認可 — ブラウザで
/oauth/start?alias=<name>→ Google 同意(gmail.modify, offline+consent)→/oauth/callbackが refresh_token を KV に保存。CSRF は KV の state nonce(TTL 600s・one-shot)
トークンの置き場
値 | 性質 | 置き場 |
client_secret | 静的 | Secrets Store binding |
refresh_token | 動的(テストモードで 7 日失効 → callback が再保存) | KV |
access_token は保存せず都度 refresh(1h 有効)。
7 日失効の運用(テストモード、許容済み)
OAuth 同意画面はテストモードのまま運用する(本番公開・検証手続きはしない)。refresh token が失効すると各ツールが再認証 URL(/oauth/start?alias=<name>)を返すので、ブラウザで 1 分の再認可で復帰する。
アカウントの追加
Google Cloud Console → OAuth 同意画面(テストモード)の テストユーザーに対象 Gmail を追加
ブラウザで
https://gmail-mcp.ippoan.org/oauth/start?alias=<新しいalias>を開いて認可list_accountsで確認。以降ツールのaccount: "<alias>"で指定
セットアップ(新規に立てる場合の要点)
GCP: プロジェクトに Gmail API 有効化、OAuth クライアント(Web 型、redirect URI
https://gmail-mcp.ippoan.org/oauth/callback)secrets:
gmail-mcp-google-client-secretを GCP SM に投入 → secrets-inventorysync_from_gcpで CF Secrets Store へCF Access: host を
meで保護 +/mcpを bypassAllauth-worker:
MCP_RESOURCE_ORIGINS_ALLOWLISTにhttps://gmail-mcp.ippoan.orgを登録(slug =gmail-mcp)deploy は CI(
frontend-ci.ymlworker 型、PR ごとに staging deploy → auto-merge)
開発
npm install # 要 NODE_AUTH_TOKEN (read:packages)。無い場合は下記
npm run typecheck
npm test
npx wrangler devローカルに GitHub Packages の token が無い場合は、@ippoan/mcp-cf-workers が
TS ソース直配布(public repo)であることを利用して一時的に git spec で入れる:
npm pkg set "dependencies.@ippoan/mcp-cf-workers=github:ippoan/mcp-cf-workers"
npm install
# 作業後、commit 前に戻す
npm pkg set "dependencies.@ippoan/mcp-cf-workers=dev"注意(stateless MCP): deploy でツールが増えても接続済みコネクタの tools/list は
固定のまま。コネクタを再接続すると反映される。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/ippoan/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server