Allows Claude to search and retrieve emails from Gmail using an MCP server, enabling email queries and content access.
Configuration
View docs{
"mcpServers": {
"vinayak-mehta-gmail-mcp": {
"command": "/Users/username/.local/bin/uvx",
"args": [
"--from",
"git+https://github.com/vinayak-mehta/gmail-mcp",
"gmail-mcp"
],
"env": {
"GMAIL_CREDS_PATH": "/Users/username/path/to/gmail-mcp/credentials.json",
"GMAIL_TOKEN_PATH": "/Users/username/path/to/gmail-mcp/token.json"
}
}
}
}This Gmail MCP server lets Claude search Gmail, list messages, and fetch full email content by using a local MCP runtime. It enables you to perform email queries and retrieve emails directly through Claude’s prompts, turning Gmail data into actionable insights.
You will interact with the Gmail MCP server through Claude by asking it to search emails, list recent messages, or fetch the content of a specific email. Use natural language prompts like “Search for all emails from [email protected],” “List my 5 most recent emails,” or “Show me the full content of the email with the subject 'Meeting Tomorrow'.” The MCP handles the underlying Gmail API calls and returns the results in a structured format.
Prerequisites: you need a local MCP runtime environment and access to edit your Claude configuration file.
{
"mcpServers": {
"gmail": {
"args": [
"--from",
"git+https://github.com/vinayak-mehta/gmail-mcp",
"gmail-mcp"
],
"command": "/Users/username/.local/bin/uvx",
"env": {
"GMAIL_CREDS_PATH": "/Users/username/path/to/gmail-mcp/credentials.json",
"GMAIL_TOKEN_PATH": "/Users/username/path/to/gmail-mcp/token.json"
}
}
}
}Environment variables control where your credentials and token files are stored. Create a .env file in your project root with these variables to simplify configuration.
Environment variables used by this server are: - GMAIL_CREDS_PATH: Path to your credentials.json file - GMAIL_TOKEN_PATH: Path to your token.json file
Keep your credentials.json and token.json files secure. Limit access to these files to trusted users only and rotate tokens if you notice unusual activity.
Query Gmail to find emails matching your criteria (sender, subject, date, etc.). Returns matching emails with basic metadata.
Retrieve the full content of a selected email, including body and attachments if available.
List a set of recent messages from your Gmail inbox, with basic identifiers for quick reference.