MCP & Connectors

How do you connect Claude to Gmail via MCP?

QUICK ANSWER

To connect Claude to Gmail via the Model Context Protocol (MCP), add the official Google Gmail MCP server configuration to your Claude Desktop configuration file. Authenticate by creating a client credential via the Google Cloud Console and running the initial OAuth consent flow.

Step-by-step Connection

  1. Go to the Google Cloud Console, create a new project, and enable the Gmail API.
  2. Configure the OAuth consent screen (choose External or Internal) and create an OAuth 2.0 Client ID credential. Download the JSON credentials file.
  3. Install the Gmail MCP server package using your package manager: npm install -g @modelcontextprotocol/server-gmail.
  4. Locate your Claude Desktop config file (claude_desktop_config.json) and add the server definition pointing to your credentials file:
    {
      "mcpServers": {
        "gmail": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-gmail",
            "--credentials",
            "/absolute/path/to/your/oauth-credentials.json"
          ]
        }
      }
    }
  5. Restart Claude Desktop. A prompt will appear in your default browser requesting OAuth access to your Gmail account. Authorize the application.

Notes

  • Keep your oauth-credentials.json file in a secure local directory that Claude has read permissions to.
  • For security, configure the Google Cloud OAuth Consent Screen with minimal scopes (e.g., gmail.readonly or gmail.modify) rather than full control.
Verified against: Gmail MCP Connector v1.2 ยท Claude API 2025-07-01