Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Automating Gmail with Claude | Smarter Communication & Time Control
Agentic AI for Automating Daily Office Tasks

bookAutomating Gmail with Claude

Email management is fundamental to every profession, yet Claude's built-in Google integrations offer limited functionality - such as only checking your inbox without the ability to create drafts or send emails. This chapter demonstrates how to install and configure a free Gmail MCP server that provides comprehensive email automation capabilities.

Google Cloud Console Setup

Project Creation
expand arrow
  1. Navigate to Google Cloud Console;
  2. Create a new project or select an existing one;
  3. Enter project name (e.g., "gmail mcp agent");
  4. Accept suggested organization and location settings;
  5. Click Create and wait for project initialization.
Enable Gmail API
expand arrow
  1. From the side menu, go to "APIs & Services" β†’ "Library";
  2. Search for "Gmail API";
  3. Select the first result and click "Enable";
  4. This grants your project permission to access Gmail functionality.
Configure OAuth Consent Screen
expand arrow
  1. Navigate to the "Credentials" tab;
  2. If prompted, click "Configure consent screen";
  3. Click "Get started";
  4. Enter application name (e.g., "gmail agent");
  5. Input your email address;
  6. Select "External Audience" for user type, if you use general Gmail account;
  7. Re-enter your email address when prompted;
  8. Accept the user data policy;
  9. Click Continue and Create.
Create OAuth Credentials
expand arrow
  1. Click "Create OAuth Client";
  2. Select "Web Application";
  3. Accept the suggested name or customize;
  4. Click "Add URI";
  5. Enter the redirect URI: http://localhost:3000/oauth2callback;
  6. Click the blue Create button;
  7. Download the JSON credentials file;
  8. Rename the file to: gsp-oauth.keys.json.
Create Credentials Directory
expand arrow

Navigate to your root/home directory:

  • Mac: Home folder Users/user_nameor Windows: C:\Users\Your_Username\;
  • Use Command + Shift + . (Mac) or Ctrl + Shift + . (Windows) to show hidden files;
  • Create a new folder named: .gmail-mcp;
  • Move the gsp-oauth.keys.json file into this folder;
  • Use Command + Shift + . again to hide folders.

The server is configured to automatically locate credentials in this directory.

Note
Definition

Smithery is a package manager specifically designed for MCP servers that simplifies installation and management of AI agents through automated setup commands.

Configuring the Gmail MCP Server

Automatic Installation
expand arrow
  • Open Claude with Desktop Commander MCP installed. For quick setup, use Smithery command;
  • In a new Claude chat, type the prompt:
run npx -y @smithery/cli install @gongrzhe/server-gmail-autoauth-mcp --client claude
  • During execution, Claude asks permission to use Desktop Commander MCP. Click Allow always or Allow once;
  • You'll be redirected to a Google Auth page. Select the same email used for the Cloud project. Click Allow to grant Gmail access. Wait for the Success message;
  • Restart Claude Desktop. The new server should now show as connected.
Adding the Config Block
expand arrow
  • Copy the prompt and paste to Claude new or alredy opened chat:
add next config block to claude config file
{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": [
        "@gongrzhe/server-gmail-autoauth-mcp"
      ]
    }
  }
}
  • Run the prompt β†’ Claude will update the config file.
  • Confirm the block was added correctly (Optional). Go to Settings (shortcut: Cmd + ,) β†’ Developer β†’ Edit Config β†’ open claude_desktop_config.json file in text editor;
  • Completely close and reopen Claude Desktop.
Manual Installation (if Automatic Doesn't Work)
expand arrow

Update Configuration File

  • In Claude Desktop, press Command + , (Mac) or Ctrl + , (Windows);
  • Click "Edit Config";
  • Open the configuration file in a text editor;
  • Copy the configuration block;
{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": [
        "-y",
        "@wonderwhy-er/desktop-commander"
      ]
    },
    "gmail": {
      "command": "npx",
      "args": [
        "@gongrzhe/server-gmail-autoauth-mcp"
      ]
    }
  }
}
  • Paste it into your Claude config file after previous configuration block and before two last closing curly brackets;
  • Save the file (Command/Ctrl + S);
  • Completely close and reopen Claude Desktop.

Now you can read, organize, and summarize emails, draft, and send emails directly with prompts.

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 1

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Awesome!

Completion rate improved to 10

bookAutomating Gmail with Claude

Swipe to show menu

Email management is fundamental to every profession, yet Claude's built-in Google integrations offer limited functionality - such as only checking your inbox without the ability to create drafts or send emails. This chapter demonstrates how to install and configure a free Gmail MCP server that provides comprehensive email automation capabilities.

Google Cloud Console Setup

Project Creation
expand arrow
  1. Navigate to Google Cloud Console;
  2. Create a new project or select an existing one;
  3. Enter project name (e.g., "gmail mcp agent");
  4. Accept suggested organization and location settings;
  5. Click Create and wait for project initialization.
Enable Gmail API
expand arrow
  1. From the side menu, go to "APIs & Services" β†’ "Library";
  2. Search for "Gmail API";
  3. Select the first result and click "Enable";
  4. This grants your project permission to access Gmail functionality.
Configure OAuth Consent Screen
expand arrow
  1. Navigate to the "Credentials" tab;
  2. If prompted, click "Configure consent screen";
  3. Click "Get started";
  4. Enter application name (e.g., "gmail agent");
  5. Input your email address;
  6. Select "External Audience" for user type, if you use general Gmail account;
  7. Re-enter your email address when prompted;
  8. Accept the user data policy;
  9. Click Continue and Create.
Create OAuth Credentials
expand arrow
  1. Click "Create OAuth Client";
  2. Select "Web Application";
  3. Accept the suggested name or customize;
  4. Click "Add URI";
  5. Enter the redirect URI: http://localhost:3000/oauth2callback;
  6. Click the blue Create button;
  7. Download the JSON credentials file;
  8. Rename the file to: gsp-oauth.keys.json.
Create Credentials Directory
expand arrow

Navigate to your root/home directory:

  • Mac: Home folder Users/user_nameor Windows: C:\Users\Your_Username\;
  • Use Command + Shift + . (Mac) or Ctrl + Shift + . (Windows) to show hidden files;
  • Create a new folder named: .gmail-mcp;
  • Move the gsp-oauth.keys.json file into this folder;
  • Use Command + Shift + . again to hide folders.

The server is configured to automatically locate credentials in this directory.

Note
Definition

Smithery is a package manager specifically designed for MCP servers that simplifies installation and management of AI agents through automated setup commands.

Configuring the Gmail MCP Server

Automatic Installation
expand arrow
  • Open Claude with Desktop Commander MCP installed. For quick setup, use Smithery command;
  • In a new Claude chat, type the prompt:
run npx -y @smithery/cli install @gongrzhe/server-gmail-autoauth-mcp --client claude
  • During execution, Claude asks permission to use Desktop Commander MCP. Click Allow always or Allow once;
  • You'll be redirected to a Google Auth page. Select the same email used for the Cloud project. Click Allow to grant Gmail access. Wait for the Success message;
  • Restart Claude Desktop. The new server should now show as connected.
Adding the Config Block
expand arrow
  • Copy the prompt and paste to Claude new or alredy opened chat:
add next config block to claude config file
{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": [
        "@gongrzhe/server-gmail-autoauth-mcp"
      ]
    }
  }
}
  • Run the prompt β†’ Claude will update the config file.
  • Confirm the block was added correctly (Optional). Go to Settings (shortcut: Cmd + ,) β†’ Developer β†’ Edit Config β†’ open claude_desktop_config.json file in text editor;
  • Completely close and reopen Claude Desktop.
Manual Installation (if Automatic Doesn't Work)
expand arrow

Update Configuration File

  • In Claude Desktop, press Command + , (Mac) or Ctrl + , (Windows);
  • Click "Edit Config";
  • Open the configuration file in a text editor;
  • Copy the configuration block;
{
  "mcpServers": {
    "desktop-commander": {
      "command": "npx",
      "args": [
        "-y",
        "@wonderwhy-er/desktop-commander"
      ]
    },
    "gmail": {
      "command": "npx",
      "args": [
        "@gongrzhe/server-gmail-autoauth-mcp"
      ]
    }
  }
}
  • Paste it into your Claude config file after previous configuration block and before two last closing curly brackets;
  • Save the file (Command/Ctrl + S);
  • Completely close and reopen Claude Desktop.

Now you can read, organize, and summarize emails, draft, and send emails directly with prompts.

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 1
some-alt