gmail_get_email_body_chunk
Get a 1k character chunk of an email body starting from the specified offset
Read recent Gmail and send new mail with Google credentials handed in on each call, pulling a long body one 1k chunk at a time instead of all at once.
LABSCO SUMMARY
That is the decision to understand before installing it: no account is stored, the access token is in the arguments each time, and gmail_refresh_token exists to renew it partway through a long session. Reading is chunked at 1k characters by design — snippets and a first chunk from gmail_get_recent_emails, then one gmail_get_email_body_chunk call per further chunk — which keeps a big thread from arriving all at once but makes reading one long message several calls. Search, labels and delete are not part of the set; it covers recent mail, one body at a time, and sending.
A Gmail server that takes its Google OAuth credentials as tool arguments rather than from stored configuration, 4 tools covering token refresh, recent mail, body paging and sending.
Google OAuth credentials supplied per call: google_access_token on every tool, plus google_client_id, google_client_secret and google_refresh_token for gmail_refresh_token. MIT licensed.
One command — npx @peakmojo/mcp-server-headless-gmail
USE CASES
Pull recent messages with metadata, snippets and the first slice of each body, then page through the ones that are longer than that first slice, chunk by chunk.
Find the message, read enough of the body to answer it properly, and send the reply as plain text or HTML without switching to a mail client.
When the access token in the arguments expires partway through, exchange the refresh token and client credentials for a new one and carry on with the same tools.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
gmail_get_email_body_chunkGet a 1k character chunk of an email body starting from the specified offset
gmail_get_recent_emailsGet the most recent emails from Gmail (returns metadata, snippets, and first 1k chars of body)
gmail_refresh_tokenRefresh the access token using the refresh token and client credentials
gmail_send_emailSend an email via Gmail
BEFORE YOU INSTALL
4 tools when we connected.
CONTEXT COST
Rated by the size of the 4 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
Add the block to your client, or run the command directly.
{
"mcpServers": {
"mcp-server-headless-gmail": {
"command": "npx",
"args": [
"@peakmojo/mcp-server-headless-gmail"
]
}
}
}npx @peakmojo/mcp-server-headless-gmail