A Model Context Protocol (MCP) server that enables Anthropic's Claude to read unread emails and create draft responses using the Gmail API.
- Python 3.10+
- uv (Python package manager)
- Claude Desktop app installed
- A Google Cloud Project with the Gmail API enabled
- Go to the Google Cloud Console and create a new project
- Enable the Gmail API
- Configure the OAuth Consent Screen and add your email as a Test User
- Create OAuth 2.0 Credentials for a Desktop Application
- Download the JSON file, rename it to
client_secret.json, and place it in this project's root directory
# Install dependencies
uv syncOn first run, Claude Desktop will start the server and open a browser window for OAuth authentication. After authorizing, a token.json file will be created for future use.
Add this server to your Claude Desktop MCP configuration file. Edit claude_desktop_config.json and add:
{
"mcpServers": {
"gmail-assistant": {
"command": "C:\\Users\\Satyam\\.local\\bin\\uv.exe",
"args": [
"--directory",
"C:\\Users\\Satyam\\Downloads\\mlx_application",
"run",
"server.py"
]
}
}
}Update the paths to match your system:
command: Path to youruv.exeexecutable (you can get this by runninguv where)--directory: Path to this project directory
After saving the configuration, restart Claude Desktop to load the server.
Once configured, you can use the tools in Claude Desktop. Simply start a chat and ask something like 'What emails do I need to respond to?'. Claude will use the following tools:
get_unread_emails: Retrieve unread emails from your inboxcreate_draft_reply: Create a draft reply for a specific email thread