Skip to main content
Glama

MCP Gmail Server

A server that uses model context protocol[https://modelcontextprotocol.io/] to read and create drafts of emails from Gmail.

Project setup

Create Oauth client and add secrets:

Create a Google Cloud Project

  1. Go to https://console.cloud.google.com/

  2. In the top-left, open the project dropdown and click New Project

  3. Give your project a name (e.g., Gmail API Demo)

  4. Click Create Your project is now created; make sure it’s selected in the project dropdown.

Enable the Gmail API

  1. Go to the API Library: https://console.cloud.google.com/apis/library

  2. Search for Gmail API

  3. Click it → Enable

Configure OAuth 2.0 Credentials

  1. Navigate to: APIs & Services → Credentials

  2. You’ll be prompted to configure the OAuth Consent Screen (if first time creating OAuth credentials)

  3. Choose External if users outside your Google Workspace will use it

  4. Fill in details

  5. Add test users (email addresses allowed to authorize during development)

  6. Save the configuration

  7. Click Create Credentials → OAuth client ID

  8. Choose the application type: Desktop app (for testing/dev)

  9. Name it

  10. Click Create

You will now receive:

  • Client ID

  • Client Secret Download them as JSON for use in your code.

Save the JSON as "client_secret_oauth_gcp.json" in the root of this project. (note this should be stored securely and not commited to github.)

Install and run app

Install uv: https://docs.astral.sh/uv/getting-started/installation/

Install dependencies with uv: uv sync

Start server: uv run -m src.mcp_server_gmail

Claude desktop

Install Claude Desktop

Set claude_desktop_config.json file to:

{
  "mcpServers": {
    "gmail": {
      "command": "/Users/myname/Documents/Coding/fac-mcp-gmail-server/.venv/bin/python",
      "args": [
        "-m",
        "mcp_server_gmail"
      ],
      "env": {
        "PYTHONPATH": "/Users/myname/Documents/Coding/fac-mcp-gmail-server/src"
      },
      "cwd": "/Users/myname/Documents/Coding/fac-mcp-gmail-server"
    }
  }
}

Ensuring the directory paths are replaced appropriately with your local directory paths.

Test (manual)

Go to claude desktop

Try the following: "Get last 3 unread emails" "Create draft emails for these"

See /docs/working_examples, for examples screenshots of the mcp server

Related MCP server: gmail-mcp-server

Features

  • Gmail Oauth set up

  • MCP server for read and drafting emails on gmail

Available Tools

2 tools
create_draft_replyC

Create a draft reply to an email

Inputs: message_content (required), message_id (required). Returns: result

get_unread_emailsA

Get a list of unread emails

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: one retrieves unread emails, the other creates draft replies. No overlap or ambiguity.

    Naming Consistency5/5

    Both tools follow the verb_noun pattern with snake_case, consistent and predictable naming.

    Tool Count2/5

    With only 2 tools for a Gmail server, the surface is too thin. A typical Gmail integration would require many more operations.

    Completeness1/5

    The tool set is severely incomplete for email management: missing send, search, archive, delete, label management, and other essential operations.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Integrates Gmail with Claude to fetch unread emails and generate draft replies based on user context and writing style guidelines stored in Google Docs. It enables automated email management and drafting through natural language interactions within the Model Context Protocol framework.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that enables Claude Desktop to interact with Gmail through secure OAuth 2.0 authentication. Send emails, search messages, read emails, and manage multiple Gmail accounts directly from Claude Desktop.
      298 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to send, read, search, and manage Gmail emails, drafts, and labels via the Model Context Protocol.
      5
      MIT