YAGMS, which stands for "Yet Another Gmail MCP Server," acts as a bridge between an AI assistant and a Gmail account. In simple terms, it gives an AI the ability to "read" and organize emails just like a human would. Instead of a user having to manually copy and paste messages into a chat window, this tool allows the AI to look into the inbox, find specific messages, and check for new updates directly. It makes managing a busy inbox much smoother by letting an AI handle the tedious task of searching through years of conversations. Under the hood, this server utilizes the Gmail API to provide a structured set of tools for advanced email management. It includes specific functions for listing recent messages, retrieving the full content of individual emails, and fetching account labels. One of its most powerful features is the search tool, which supports standard Gmail search syntax. This means the AI can perform complex queries, such as finding all emails from a specific sender that contain attachments or filtering messages based on highly specific keywords and date ranges. For developers building LLM-powered applications, YAGMS offers a lightweight and efficient solution built with Bun. It simplifies the authentication process via OAuth 2.0, securely handling credentials through a local configuration. By integrating this server into an MCP-compatible environment, developers can empower their AI agents to act as intelligent email secretaries. Whether the goal is to summarize long threads, identify urgent action items, or categorize a messy inbox, this tool provides the necessary infrastructure to turn a standard language model into a functional email management system.
Category: Communication & Messaging
Tags: email, gmail, inbox, oauth
~/.yagms-oauth.keys.json. 2. Install Runtime: Install Bun. Build Steps: bash bun install bun run build-gmail # This generates ./dist/gmail.js Authentication: Before running the server, you must authenticate your Google account: bash bun run dist/gmail.js auth This will open a browser to sign in and save credentials to ~/.yagms-credentials.json. ---claude_desktop_config.json or Cursor settings): json { "mcpServers": { "gmail": { "command": "bun", "args": ["run", "/path/to/yagms/dist/gmail.js"], "env": {}, "disabled": false, "autoApprove": [] } } } Optional Environment Variables: - GMAIL_OAUTH_PATH: Custom path to OAuth keys (default: ~/.yagms-oauth.keys.json). - GMAIL_CREDENTIALS_PATH: Custom path to save credentials (default: ~/.yagms-credentials.json). ---senderEmail (optional): Filter by sender. * maxResults (optional, default: 10): Number of emails to return. * labelIds (optional, default: ["INBOX"]): Filter by specific labels. * get-email: Get a specific email by ID. * emailId: The unique ID of the email. * search-emails: Search using Gmail's advanced search syntax. * query: Search string (e.g., from:example@gmail.com has:attachment). * maxResults (optional, default: 10). * get-labels: List all Gmail labels in the account. ---list-emails to fetch recent messages, analyzes the body text, and provides a bulleted list of deadlines and requests found in the emails.search-emails tool with Gmail’s advanced search syntax (e.g., has:attachment or `after:202301/01), the AI can pinpoint specific documents based on conversational requests. **Example**: A user says, "Find the PDF invoice from the hardware store that I received last November." The AI executessearch-emails(query: "hardware invoice has:attachment after:2023/11/01 before:2023/12/01"), identifies the correct thread, and retrieves the specific details usingget-email`.
search-emails with a query for the sender and project name, then uses get-email to read the specific message and summarize the requirements for the developer's current task.list-emails filtered by labelIds to monitor specific categories and then process the content to determine the "temperature" or urgency of the message. Example: A user asks, "Check my 'Support' label and tell me if any customers…Part of MCP Servers