How kasturimaheshbabu2316-mc/gmail-mcp-server works
This is an MCP server that lets an AI client operate on a Gmail account. The principal workflow is a client tool request handled by the server, which validates and performs Gmail API operations, then returns results through MCP. Authentication is a separate setup flow that obtains OAuth tokens and stores credentials. Email composition helpers, label management, and filter management are distinct internal layers. The README documents additional message and batch capabilities; the sampled server excerpt is partial, so those operations are represented at the server boundary rather than as inferred internal call chains.
Main entry points: index.ts MCP tool server · utl.ts Message composition · label-manager.ts Label management · filter-manager.ts Filter management
Components 15
MCP runtime
- MCP tool server
src/index.ts
Authentication
- OAuth setup
src/index.ts - Credential files
Email operations
- Email tools
src/index.ts - Message composition
src/utl.ts - Read and search
src/index.ts - Message actions
src/index.ts - Attachment handling
src/index.ts
Mailbox organization
- Label management
src/label-manager.ts - Filter management
src/filter-manager.ts
Other components
- AI client
- Gmail API
- Google OAuth
- Browser
- Local files
Connections 23
- AI client → MCP tool server: sends MCP requests
- MCP tool server → AI client: returns tool results
- MCP tool server → OAuth setup: starts auth mode
- OAuth setup → Google OAuth: requests tokens
- OAuth setup → Browser: opens consent
- Google OAuth → OAuth setup: returns tokens
- OAuth setup → Credential files: stores credentials
- Credential files → MCP tool server: loads credentials
- MCP tool server → Email tools: dispatches email tools
- Email tools → Message composition: builds raw messages
- Message composition → Email tools: returns message
- Email tools → Gmail API: sends or drafts
- Email tools → Read and search: dispatches read/search
- Read and search → Gmail API: fetches messages
- Email tools → Message actions: dispatches actions
- Message actions → Gmail API: updates messages
- Email tools → Attachment handling: dispatches downloads
- Attachment handling → Gmail API: fetches attachment data
- Attachment handling → Local files: writes downloads
- MCP tool server → Label management: calls label operations
- Label management → Gmail API: manages labels
- MCP tool server → Filter management: calls filter operations
- Filter management → Gmail API: manages filters