
jasonsum/gmail-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
jasonsum/gmail-mcp-server は [https://github.com/jasonsum/gmail-mcp-server.] からインポートされた MCP サーバーの候補です
概要
jasonsum/gmail-mcp-server は [https://github.com/jasonsum/gmail-mcp-server.] からインポートされた MCP サーバーの候補です
概要(AI 翻訳)
このMCPサーバーは、Gmailと連携し、メールの送信、削除、読み込み、ドラフト、および対応を可能にします。
注記:MCP クライアントがメールを読み、削除、送信できるようにします。 しかしながら、クライアントはそのような活動を行う前にユーザーを指示します。
[https://github.com/user-attachments/assets/5794cd16-00d2-45a2-884a-8ba0c3a90c90]
コンポーネント
ツール
お問い合わせ
-
Eメールアドレスの受信者に電子メールを送信
-
入力:
-
[
recipient_id(文字列): アドレスのメールアドレス -
[
subject(文字列):電子メールの件名 -
[
message(文字列):メールコンテンツ -
ステータスとメッセージを返す id
-
trash-email**
-
メールをゴミ箱に移動する
-
入力:
-
[
email_id(文字列):電子メールの自動生成されたID -
成功メッセージを返す
-
マーク-メール-as-read
-
読まれた電子メールに印を付けて下さい
-
入力:
-
[
email_id(文字列):電子メールの自動生成されたID -
成功メッセージを返す
-** 会員登録
-
未読メールの取得
-
電子メールIDを含む電子メールのリストを返す
-
電子メール
-
メールコンテンツの取得
-
入力:
-
[
email_id(文字列):電子メールの自動生成されたID -
電子メールメタデータとマークメールの辞書を読み込みとして返します
-
オープンメール
-
ブラウザでメールを開く
-
入力:
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Gmail Server for Model Context Protocol (MCP)
This MCP server integrates with Gmail to enable sending, removing, reading, drafting, and responding to emails.
Note: This server enables an MCP client to read, remove, and send emails. However, the client prompts the user before conducting such activities.
https://github.com/user-attachments/assets/5794cd16-00d2-45a2-884a-8ba0c3a90c90
Components
Tools
-
send-email
- Sends email to email address recipient
- Input:
recipient_id(string): Email address of addresseesubject(string): Email subjectmessage(string): Email content
- Returns status and message_id
-
trash-email
- Moves email to trash
- Input:
email_id(string): Auto-generated ID of email
- Returns success message
-
mark-email-as-read
- Marks email as read
- Input:
email_id(string): Auto-generated ID of email
- Returns success message
-
get-unread-emails
- Retrieves unread emails
- Returns list of emails including email ID
-
read-email
- Retrieves given email content
- Input:
email_id(string): Auto-generated ID of email
- Returns dictionary of email metadata and marks email as read
-
open-email
- Open email in browser
- Input:
email_id(string): Auto-generated ID of email
- Returns success message and opens given email in default browser
Setup
Gmail API Setup
- Create a new Google Cloud project
- Enable the Gmail API
- Configure an OAuth consent screen
- Select “external”. However, we will not publish the app.
- Add your personal email address as a “Test user”.
- Add OAuth scope
https://www.googleapis.com/auth/gmail/modify - Create an OAuth Client ID for application type “Desktop App”
- Download the JSON file of your client’s OAuth keys
- Rename the key file and save it to your local machine in a secure location. Take note of the location.
- The absolute path to this file will be passed as parameter
--creds-file-pathwhen the server is started.
- The absolute path to this file will be passed as parameter
Authentication
When the server is started, an authentication flow will be launched in your system browser.
Token credentials will be subsequently saved (and later retrieved) in the absolute file path passed to parameter --token-path.
For example, you may use a dot directory in your home folder, replacing [your-home-folder].:
| Parameter | Example |
|---|---|
--creds-file-path |
/[your-home-folder]/.google/client_creds.json |
--token-path |
/[your-home-folder]/.google/app_tokens.json |
Usage with Desktop App
インストール
npx @modelcontextprotocol/inspector uv run [absolute-path-to-git-repo]/src/gmail/server.py --creds-file-path [absolute-path-to-credentials-file] --token-path [absolute-path-to-access-tokens-file]設定
{
"mcpServers": {
"gdrive": {
"command": "uv",
"args": [
"--directory",
"[absolute-path-to-git-repo]",
"run",
"gmail",
"--creds-file-path",
"[absolute-path-to-credentials-file]",
"--token-path",
"[absolute-path-to-access-tokens-file]"
]
}
}
}