Official · MODEL CONTEXT PROTOCOL
mcp-headless-gmail
A MCP (Model Context Protocol) server that provides get, send Gmails without local credential or token setup.
WHAT IT CONNECTS
What mcp-headless-gmail gives an AI Agent
- Get most recent emails from Gmail with the first 1k characters of the body
- Get full email body content in 1k chunks using offset parameter
- Send emails through Gmail
- Refresh access tokens separately
- Automatic refresh token handling
- Python 3.10 or higher
- Google API credentials (client ID, client secret, access token, and refresh token)
- **Create a new builder instance** (if you haven't already):
- **Build and push the image for multiple platforms**:
- **Verify the image is available for the specified platforms**:
- Email metadata (id, threadId, from, to, subject, date, etc.)
- First 1000 characters of the email body
- `body_size_bytes`: Total size of the email body in bytes
- `contains_full_body`: Boolean indicating if the entire body is included (true) or truncated (false)
- A 1k chunk of the email body starting from the specified offset
- `body_size_bytes`: Total size of the email body
- `chunk_size`: Size of the returned chunk
- `contains_full_body`: Boolean indicating if the chunk contains the remainder of the body
- Start by calling the `gmail_refresh_token` tool with either:
- Your full credentials (access token, refresh token, client ID, and client secret), or
- Just your refresh token, client ID, and client secret if the access token has expired
- Use the returned new access token for subsequent API calls.
- If you get a response indicating token expiration, call the `gmail_refresh_token` tool again to get a new token.
- Go to the [Google Cloud Console](https://console.cloud.google.com/)
- Create a new project
- Enable the Gmail API
- Configure OAuth consent screen
- Create OAuth client ID credentials (select "Desktop app" as the application type)
- Save the client ID and client secret
- Use OAuth 2.0 to obtain access and refresh tokens with the following scopes:
- `https://www.googleapis.com/auth/gmail.readonly` (for reading emails)
- `https://www.googleapis.com/auth/gmail.send` (for sending emails)
SECURITY
An MCP listing is not a security review
An MCP server may receive model context, credentials, local files, or permission to call external systems. Review its code, requested environment variables, network behavior, package provenance, and maintenance status before connecting it to an agent.