How to give Claude access to your Gmail with an MCP server
Install a Gmail MCP server so Claude Desktop or Claude Code can read, search and draft email through your own credentials.
The Model Context Protocol (MCP) lets Claude call external tools. A Gmail MCP server gives Claude functions like search messages, read a thread, and create a draft, all running locally with your Google OAuth credentials. This guide sets one up for Claude Desktop. Nothing is sent to Anthropic except the tool results Claude needs to answer you.
- Claude Desktop installed
- Node.js 18 or newer
- A Google Cloud project with the Gmail API enabled
- An OAuth client (Desktop app) credentials JSON file
Step 1: Enable the Gmail API and get OAuth credentials
In Google Cloud Console, create or pick a project, open APIs and Services, and enable the Gmail API. Then go to Credentials, create an OAuth client ID, choose Desktop app, and download the JSON. Add your own email as a test user on the OAuth consent screen so it works without a published app review.
Step 2: Run the Gmail MCP server once to authorize
Most Gmail MCP servers ship on npm. Place the credentials file where the server expects it, then run the auth command. A browser window opens for the Google consent screen. Approve it and the server stores a refresh token locally.
Step 3: Register the server in Claude Desktop
Open Claude Desktop, go to Settings, Developer, Edit Config. Add the Gmail server to the mcpServers block. The file is claude_desktop_config.json in your Application Support (macOS) or AppData (Windows) folder.
{
"mcpServers": {
"gmail": {
"command": "npx",
"args": ["@gongrzhe/server-gmail-autoauth-mcp"]
}
}
}Step 4: Restart Claude and try a command
Quit and reopen Claude Desktop. You should see a tools icon showing the Gmail server connected. Ask Claude to do something concrete and it will request permission to call the tool the first time.
Result: Claude can now triage, summarize and draft inside your real mailbox on demand, using your own Google credentials, without copying email text back and forth.
Watch related tutorials
1:42:18
28:14
41:09
9:47
8:23
52:31