About mailport
mailport is an MCP server for managing Gmail messages, threads, labels, drafts, and sending through the Gmail API. It offers a defined set of ten core tools.
Key features
- 01List and retrieve messages
- 02List and retrieve threads
- 03List labels
- 04Send messages
- 05Create drafts
- 06Modify or trash messages; create labels
Use cases
- 01Review inbox messages and threads
- 02Send Gmail messages
- 03Prepare messages as drafts
- 04Organize mail with labels
MCP support
Exposes ten Gmail API operations as MCP tools, including message and thread access, label listing and creation, sending, draft creation, message modification, and trashing.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
10Saved tool list · updated 1w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | No | Optional Gmail search query to filter messages by. |
| label_ids | array | No | Optional list of label IDs; only messages carrying all of these labels are returned. |
| max_results | number | No | Optional maximum number of messages to return. |
Details
From the project READMEmailport
Gmail messages, threads and labels as MCP tools, talking to the Gmail API. mailport is a clean-room rebuild of the core surface of the Gmail reference MCP server, under a new name: fresh code written from the public Gmail API documentation, no copied branding.
Tools (core subset, 10)
list_messages, get_message, list_threads, get_thread,
list_labels, send_message, create_draft, modify_message,
trash_message, create_label.
Label update/delete, draft get/update/delete/send, message delete and batchModify, history, profile/settings/watch, and attachment downloads from the wider Gmail surface are not in this subset.
Setup
Set a Google OAuth access token:
export GOOGLE_ACCESS_TOKEN=ya29....
Optionally override the API base with GMAIL_API_URL
(default https://gmail.googleapis.com/gmail/v1). Without the token,
every tool call fails with an error naming the missing variable.
CLI
npx @reneturcios/mailport list_messages '{"query":"in:inbox","max_results":5}'
npx @reneturcios/mailport mcp # stdio MCP server
Each tool name is a subcommand taking one JSON object argument.
MCP client config
{
"mcpServers": {
"mailport": {
"command": "npx",
"args": ["-y", "@reneturcios/mailport", "mcp"],
"env": { "GOOGLE_ACCESS_TOKEN": "ya29...." }
}
}
}
Docker
docker run -i -e GOOGLE_ACCESS_TOKEN ghcr.io/cloudcorprecords/mailport
Development
npm install
npm run build
npm test
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.