YAGMS
An MCP server for interacting with the Gmail API, enabling email management.
yagms
Yet Another Gmail MCP Server
Setup and Usage
Gmail MCP Server
The Gmail MCP server provides tools to interact with your Gmail account through the Model Context Protocol (MCP).
Prerequisites
- Create OAuth credentials for Gmail API:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Gmail API
- Create OAuth 2.0 credentials (Desktop application)
- Download the credentials JSON file and save it as
~/.yagms-oauth.keys.json
Build this project
- Install Bun.
- Build the code
bun install
bun run build-gmail # It will emit ./dist/gmail.js
Authentication
Before using the Gmail MCP server, you need to authenticate with your Google account:
# Run the authentication flow
bun run dist/gmail.js auth
This will:
- Launch a browser window for you to sign in to your Google account
- Request permission to access your Gmail account
- Save the authentication credentials to
~/.yagms-credentials.json
Running the Server
After authentication, you can run the Gmail MCP server:
# Run the server
bun run src/gmail.ts
Configuration
You can customize the paths for OAuth keys and credentials using environment variables:
GMAIL_OAUTH_PATH: Path to the OAuth keys file (default:~/.yagms-oauth.keys.json)GMAIL_CREDENTIALS_PATH: Path to save the credentials (default:~/.yagms-credentials.json)
Available Tools
The Gmail MCP server provides the following tools:
-
list-emails: Get emails from your inbox
- Parameters:
senderEmail(optional): Filter by sender emailmaxResults(optional, default: 10): Maximum number of emails to returnlabelIds(optional, default: ["INBOX"]): Label IDs to filter by
- Parameters:
-
get-email: Get a specific email by ID
- Parameters:
emailId: The ID of the email to retrieve
- Parameters:
-
search-emails: Search for emails using Gmail search syntax
- Parameters:
query: Gmail search query (e.g., "from:[email protected] has:attachment")maxResults(optional, default: 10): Maximum number of emails to return
- Parameters:
-
get-labels: Get all Gmail labels
- No parameters required
Example MCP Configuration
Add this to your MCP settings file:
{
"mcpServers": {
"gmail": {
"command": "bun",
"args": ["run", "/path/to/yagms/dist/gmail.js"],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
Servidores relacionados
MCP反馈收集器
An MCP server for collecting interactive user feedback through a graphical user interface.
mcp-gmail
MCP server for full Gmail operations via Unipile API. 9 tools: send, reply, list, read, delete, search, labels, attachments, drafts. Dry-run by default, 55 unit tests. MIT licensed.
Rongcloud Native MCP
Rongcloud IM Service based on the MCP Protocol, acting as a Rust SDK Wrapper.
Machine 2 Machine Protocol
A proof-of-concept for autonomous economic interactions between AI agents using MCP, A2A, and x402 protocols.
Twilio SMS Server
Send SMS messages using the Twilio API. Functions as an MCP server or a standalone REST API.
MCP Mail
Perform actions with your GMail account using the GMail API.
WaliChat WhatsApp API
Automate WhatsApp by sending messages, summarizing conversations, and managing chats using natural language with AI assistants.
Voice Mode
A server for natural voice conversations with AI assistants like Claude and ChatGPT.
Telinfy MCP server
Send SMS, WhatsApp, and RCS messages programmatically with DLT compliance. Manage contacts, schedule campaigns, and track delivery reports.
Beyond MCP Server
Provides standardized access to social platform and onchain data using the Neynar API.