Gmail AI Agent MCP Server

Gmail AI Agent MCP Server

Enables AI assistants to connect to Gmail accounts, check connection status, and send emails through a secure OAuth 2.0 interface.

Category
Visit Server

README

Gmail AI Agent MCP Server

A Model Context Protocol (MCP) server that provides Gmail integration capabilities for AI models and tools. This server enables AI assistants to connect to Gmail accounts, check connection status, and send emails through a secure interface.

Tools

The server implements the following Gmail-related tools:

connect-gmail

Initiates a connection to a Gmail account. This tool will provide a redirect URL for OAuth authentication.

check-gmail-connection

Checks the current Gmail connection status and displays user profile information including email address, total messages, and total threads.

send-email

Sends an email through the connected Gmail account. Parameters:

  • to: The email address of the recipient
  • subject: The subject of the email
  • body: The body content of the email

Setup

Prerequisites

  1. Composio API Key: You'll need a Composio API key to use the Gmail integration. You can get one by signing up at Composio.

  2. Gmail Account: A Gmail account that you want to connect to the AI agent.

Installation

You can configure the Gmail AI agent server in your MCP client. Here is an example configuration for Claude Desktop (Settings -> Developer -> Edit Config):

{
  "mcpServers": {
    "gmail-agent": {
      "command": "node",
      "args": ["path/to/your/gmail-mcp/dist/index.js"],
      "env": {
        "COMPOSIO_API_KEY": "<YOUR_COMPOSIO_API_KEY>"
      }
    }
  }
}

Development Setup

If you're running from source:

# Clone the repository
git clone <repository-url>
cd gmail-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Run the server
npm start

Then configure your MCP client to point to the built server:

{
  "mcpServers": {
    "gmail-agent": {
      "command": "node",
      "args": ["/path/to/gmail-mcp/dist/index.js"],
      "env": {
        "COMPOSIO_API_KEY": "<YOUR_COMPOSIO_API_KEY>"
      }
    }
  }
}

Usage

  1. Configure the server in your MCP client (like Claude Desktop)
  2. Restart your client to load the new configuration
  3. Connect to Gmail by using the connect-gmail tool - this will provide an OAuth link
  4. Authorize the connection by clicking the provided link and following the Gmail authorization flow
  5. Check connection using check-gmail-connection to verify everything is working
  6. Send emails using the send-email tool with recipient, subject, and body parameters

Security

  • The server uses OAuth 2.0 for secure Gmail authentication
  • No passwords are stored locally
  • All Gmail operations are performed through secure API calls
  • The connection is maintained securely through Composio's infrastructure

Example Workflow

  1. Initial Setup: Use connect-gmail to start the OAuth flow
  2. Verification: Use check-gmail-connection to confirm successful connection
  3. Email Operations: Use send-email to compose and send emails through your connected Gmail account

Troubleshooting

  • Connection Issues: If you encounter connection problems, try using connect-gmail again to re-authenticate
  • API Key Issues: Ensure your Composio API key is correctly set in the environment variables
  • Permission Errors: Make sure you've granted the necessary permissions during the OAuth flow

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured