A real-time voice-driven email assistant using Google Gemini's audio capabilities with Gmail integration through Model Context Protocol (MCP).
- Real-time voice input with Voice Activity Detection (VAD)
- Audio streaming responses with natural speech synthesis
- Gmail integration via MCP for robust email operations
- Action queueing system with undo capability for safer email processing
- Hands-free operation perfect for commutes or multitasking
- Automatic inbox clearing with sequential email processing
-
Install dependencies:
uv sync
-
Set up Gmail MCP server:
npm install -g @gongrzhe/server-gmail-autoauth-mcp
-
Configure environment:
- Copy
mcp_agent.secrets.yaml.exampletomcp_agent.secrets.yaml - Add your Gemini API key and other credentials
- Copy
-
Run the agent:
uv run python main.py
-
Start speaking! Commands like:
- "Archive this email"
- "Mark as read"
- "Delete this email"
- "Read the content"
- "Undo" (cancels pending action)
- "Archive this email" - Removes from inbox
- "Delete this email" - Moves to trash
- "Mark as read/unread" - Changes read status
- "Skip" - Alias for mark as unread
- "Read the content" - Reads full email body
- "Summarize this email" - Provides concise summary
- "Get inbox stats" - Reports total/unread counts
- "Undo" - Cancels pending action and goes back
- "Draft a reply saying..." - Creates draft response
- "Edit draft to say..." - Modifies current draft
- "Read the draft" - Reads draft content
- "Send the draft" - Sends and moves to next email
The agent uses a queuing system for state-changing actions:
- Actions are queued, not immediate - Gives you time to reconsider
- Execution on next action - Previous action executes when you request a new one
- Undo capability - Say "undo" to cancel and go back to previous email
- Final action execution - Last queued action executes on session end
- Google Gemini Live API - Real-time audio streaming and tool calling
- MCP-Agent Framework - Manages MCP server connections
- Gmail MCP Server - Provides Gmail API access through standardized interface
- PyAudio - Handles microphone input and audio playback
- Python 3.11+
- Google Gemini API key
- Node.js and npm (for Gmail MCP server)
- Microphone and speaker access
- Gmail account with API access enabled
The project uses two configuration files:
mcp_agent.config.yaml- MCP server configurationmcp_agent.secrets.yaml- API keys and credentials (create from example)
See GMAIL_SETUP.md for detailed Gmail API setup instructions.