Automating 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
- Navigate to Google Cloud Console;
- Create a new project or select an existing one;
- Enter project name (e.g., "gmail mcp agent");
- Accept suggested organization and location settings;
- Click Create and wait for project initialization.
- From the side menu, go to "APIs & Services" β "Library";
- Search for "Gmail API";
- Select the first result and click "Enable";
- This grants your project permission to access Gmail functionality.
- Navigate to the "Credentials" tab;
- If prompted, click "Configure consent screen";
- Click "Get started";
- Enter application name (e.g., "gmail agent");
- Input your email address;
- Select "External Audience" for user type, if you use general Gmail account;
- Re-enter your email address when prompted;
- Accept the user data policy;
- Click Continue and Create.
- Click "Create OAuth Client";
- Select "Web Application";
- Accept the suggested name or customize;
- Click "Add URI";
- Enter the redirect URI:
http://localhost:3000/oauth2callback
; - Click the blue Create button;
- Download the JSON credentials file;
- Rename the file to:
gsp-oauth.keys.json
.
Navigate to your root/home directory:
- Mac: Home folder
Users/user_name
or Windows:C:\Users\Your_Username\
; - Use
Command + Shift + .
(Mac) orCtrl + 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.
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
- 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.
- 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.
Update Configuration File
- In Claude Desktop, press
Command + ,
(Mac) orCtrl + ,
(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.
Thanks for your feedback!
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 10
Automating 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
- Navigate to Google Cloud Console;
- Create a new project or select an existing one;
- Enter project name (e.g., "gmail mcp agent");
- Accept suggested organization and location settings;
- Click Create and wait for project initialization.
- From the side menu, go to "APIs & Services" β "Library";
- Search for "Gmail API";
- Select the first result and click "Enable";
- This grants your project permission to access Gmail functionality.
- Navigate to the "Credentials" tab;
- If prompted, click "Configure consent screen";
- Click "Get started";
- Enter application name (e.g., "gmail agent");
- Input your email address;
- Select "External Audience" for user type, if you use general Gmail account;
- Re-enter your email address when prompted;
- Accept the user data policy;
- Click Continue and Create.
- Click "Create OAuth Client";
- Select "Web Application";
- Accept the suggested name or customize;
- Click "Add URI";
- Enter the redirect URI:
http://localhost:3000/oauth2callback
; - Click the blue Create button;
- Download the JSON credentials file;
- Rename the file to:
gsp-oauth.keys.json
.
Navigate to your root/home directory:
- Mac: Home folder
Users/user_name
or Windows:C:\Users\Your_Username\
; - Use
Command + Shift + .
(Mac) orCtrl + 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.
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
- 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.
- 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.
Update Configuration File
- In Claude Desktop, press
Command + ,
(Mac) orCtrl + ,
(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.
Thanks for your feedback!