Gmail API integration for Google Workspace via MCP.
Tested up to: 6.9 Stable tag: 2.0.6 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html
This add-on plugin provides Gmail API integration through MCP (Model Context Protocol) for Google Workspace accounts. Your AI assistant can send emails, read inbox messages, reply to threads, and manage labels. Personal Gmail accounts are not supported.
Concrete example: your support inbox receives refund and invoice emails all day. With this plugin, an AI assistant can read unread billing messages, draft or send a reply in the same thread, label the message as handled, and archive it without you opening Gmail.
Part of the MCP Expose Abilities ecosystem.
- WordPress 6.9+
- PHP 8.0+
- Abilities API plugin
- MCP Adapter plugin
- Google Workspace with service account (domain-wide delegation). Personal Gmail accounts are not supported.
- Install the required plugins (Abilities API, MCP Adapter)
- Download the latest release from Releases
- Upload via WordPress Admin > Plugins > Add New > Upload Plugin
- Activate the plugin
- Configure Google Workspace Gmail API credentials (see Setup below)
- Go to Google Cloud Console
- Create a project or select existing
- Enable Gmail API
- Create service account with domain-wide delegation
- Download JSON key file
In Google Workspace Admin:
- Go to Security > API controls > Domain-wide delegation
- Add the service account client ID
- Add scopes:
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.labels
Use gmail/configure ability to set up credentials. The service_account_json parameter must be raw JSON content (not a file path).
| Ability | Description |
|---|---|
gmail/configure |
Set up Gmail API service account credentials |
gmail/status |
Check API connection status and configuration |
gmail/list-labels |
List Gmail labels |
gmail/get-label |
Get a Gmail label by ID |
gmail/create-label |
Create a Gmail label |
gmail/update-label |
Update a Gmail label |
gmail/delete-label |
Delete a Gmail label |
gmail/list |
List inbox messages with filtering |
gmail/list-threads |
List Gmail threads |
gmail/get |
Get full email content by ID |
gmail/get-thread |
Get a Gmail thread |
gmail/get-attachment |
Fetch a message attachment (base64) |
gmail/send |
Send email with HTML, attachments, CC, BCC |
gmail/modify |
Modify labels (archive, mark read/unread, etc.) |
gmail/reply |
Reply to an existing email thread |
email/send |
Send email via WordPress wp_mail (non-Gmail fallback) |
{
"ability_name": "gmail/configure",
"parameters": {
"service_account_json": "{...raw service account JSON...}",
"impersonate_email": "user@yourdomain.com"
}
}{
"ability_name": "gmail/send",
"parameters": {
"to": "recipient@example.com",
"subject": "Meeting Tomorrow",
"body": "<p>Hi,</p><p>Just confirming our meeting tomorrow at 2 PM.</p>",
"html": true
}
}{
"ability_name": "gmail/list",
"parameters": {
"max_results": 10,
"label": "INBOX"
}
}{
"ability_name": "gmail/reply",
"parameters": {
"thread_id": "abc123",
"body": "Thanks for the update!"
}
}{
"ability_name": "gmail/modify",
"parameters": {
"id": "message123",
"remove_labels": ["INBOX"]
}
}- List unread support emails:
{
"ability_name": "gmail/list",
"parameters": {
"label": "INBOX",
"q": "is:unread subject:(invoice OR billing OR refund)",
"max_results": 5
}
}- Get the full message content for the top hit:
{
"ability_name": "gmail/get",
"parameters": {
"id": "MESSAGE_ID_FROM_LIST"
}
}- Reply in the same thread:
{
"ability_name": "gmail/reply",
"parameters": {
"thread_id": "THREAD_ID_FROM_GET",
"body": "Hi! Thanks for contacting us. I have checked your invoice and processed the correction. You will receive the updated receipt shortly."
}
}- Label and archive the handled message:
{
"ability_name": "gmail/modify",
"parameters": {
"id": "MESSAGE_ID_FROM_LIST",
"add_labels": ["Label_1234567890"],
"remove_labels": ["INBOX", "UNREAD"]
}
}- Uses Google service accounts (no user passwords stored)
- Domain-wide delegation controlled by Workspace admin
- Scopes limited to Gmail API operations only
- All operations require WordPress authentication
- Docs: expanded the WordPress-standard
readme.txtso the published ZIP now includes fuller requirements, setup guidance, use cases, and Devenia ecosystem links
- Security: gmail/configure now accepts raw JSON only (no file path reads)
- Docs: sync stable tag and parameter examples with current behavior
- Fixed: Removed hard plugin header dependency on abilities-api to avoid slug-mismatch activation blocking
- Cache config access and tighten API response handling
- Reduce readme tags to 5 for plugin check compliance
- Rename plugin to Google Workspace (repo + folder + docs)
- Clarify Google Workspace-only support (service accounts, domain-wide delegation)
- Initial release
GPL-2.0+
Devenia - We've been doing SEO and web development since 1993.