Moist
Allows interaction with Gmail API, providing tools for managing emails, threads, labels, drafts, and searching messages.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Moistfind unread emails from boss"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Moist
Gmail MCP Connector
"Neither rain nor snow nor stranded tokens shall stay this messenger."
Moist is an MCP server that exposes Gmail operations as tools. It handles OAuth 2.0, token refresh, rate limiting, and MIME parsing so consuming applications don't have to.
Quick Start
1. Google Cloud Setup
Create a project in the Google Cloud Console
Enable the Gmail API
Create OAuth 2.0 Client ID credentials (Desktop application type)
Add
http://localhost:3000/oauth/callbackas an authorized redirect URINote your Client ID and Client Secret
2. MCP Configuration
Add Moist to your MCP client configuration:
{
"mcpServers": {
"moist": {
"command": "npx",
"args": ["@ticktockbent/moist"],
"env": {
"MOIST_CLIENT_ID": "your_client_id",
"MOIST_CLIENT_SECRET": "your_client_secret"
}
}
}
}3. First Run
On the first connection, Moist opens your browser for Google OAuth consent. Once authorized, tokens are encrypted and stored locally at ~/.moist/tokens.json. Subsequent runs authenticate automatically.
Related MCP server: Gmail MCP Server
Environment Variables
Variable | Required | Description |
| Yes | Google OAuth 2.0 Client ID |
| Yes | Google OAuth 2.0 Client Secret |
| No | OAuth callback URI (default: |
Tools
Authentication
Tool | Description |
| Check authentication state, email, scopes, and token expiry |
| Revoke tokens and clear stored credentials |
Messages
Tool | Description |
| Search and list messages with pagination and label filtering |
| Get full message details including body, headers, and attachments |
| Send an email (supports replies via |
| Move a message to trash |
| Permanently delete a message (irreversible) |
Threads
Tool | Description |
| List threads with search and label filtering |
| Get a thread with all its messages |
| Move an entire thread to trash |
Labels
Tool | Description |
| List all labels (system and user-created) |
| Add or remove labels from a message |
Search
Tool | Description |
| Search messages using Gmail's full query syntax |
Gmail search supports operators like from:, to:, subject:, has:attachment, is:unread, is:starred, label:, after:, before:, filename:, and "exact phrases". Operators can be combined:
from:bank@example.com has:attachment after:2024/01/01 subject:statementDrafts
Tool | Description |
| Create a new draft email |
| List drafts with pagination |
| Delete a draft |
| Send an existing draft |
Architecture
src/
├── index.ts # MCP server entry point (stdio transport)
├── types.ts # TypeScript interfaces
├── auth/
│ ├── oauth.ts # OAuth 2.0 flow, token refresh, browser consent
│ └── storage.ts # Encrypted token persistence (~/.moist/)
├── client/
│ ├── gmail.ts # Gmail API wrapper, MIME parsing, message building
│ └── rate-limiter.ts # Sliding-window quota tracker
└── tools/
├── auth.ts # Auth status and logout tools
├── messages.ts # Message CRUD tools
├── threads.ts # Thread tools
├── labels.ts # Label tools
├── search.ts # Search tool
└── drafts.ts # Draft toolsKey Design Decisions
Stateless -- No caching. Each tool call hits the Gmail API directly.
Single account -- One Gmail account per server instance. Run multiple instances for multiple accounts.
Raw content -- Message bodies are returned as-is (plain text and HTML). No parsing or summarization.
Encrypted storage -- Tokens at rest are AES-256-CBC encrypted using a machine-specific derived key.
Rate limiting -- Tracks Gmail API quota usage in a sliding 1-second window (250 units/sec per Google's limits). Returns structured errors with retry timing when exceeded.
Error Handling
All tools return consistent error shapes:
{
"error": "not_found",
"message": "Human-readable description",
"details": {}
}Error Code | Meaning |
| Message, thread, or label doesn't exist |
| Gmail API quota exceeded (includes |
| Token expired or revoked |
| Bad parameters |
| Gmail API error (details included) |
OAuth Scopes
Moist requests these scopes during authorization:
Scope | Purpose |
| Read messages, threads, and labels |
| Send messages |
| Modify labels, trash/untrash |
| Create and manage drafts |
Development
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run devLicense
MIT
References
Going Postal -- The source of the name
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TickTockBent/Moist'
If you have feedback or need assistance with the MCP directory API, please join our Discord server