search_emailsLABSCO SUMMARY
Mail search for an agent, with nothing granted that could send or delete.
It asks Google for read access and nothing else, which makes it the version of Gmail access you can hand to an assistant without thinking hard about it — and the search takes real Gmail queries, so narrowing is as precise as it is in the web client.
What it is
A read-only Gmail server: one search tool over Gmail's own query syntax, plus a resource that returns your ten most recent inbox messages.
What you get
- A search over your mail using Gmail's standard query syntax
- A result cap you set per search, defaulting to ten
- Your ten most recent inbox messages, available as a resource without a search
- Read access only — the OAuth scope requested carries no write permission
Requirements
A Google Cloud project with the Gmail API enabled and OAuth desktop credentials downloaded, then two paths in the environment: one pointing at those credentials, and one where the token is written after you authorize in the browser. Python, installed into its own environment.
Setup effort
Build from source — git clone https://github.com/ajbr0wn/gmail-mcp-server.git
USE CASES
Digging out an email you half remember
Search with the same operators you would type into Gmail — sender, date, attachment — and cap the results at a number you will actually read.
Seeing what just arrived
Read the recent-inbox resource instead of composing a query, when the question is simply what is new.
Pulling the facts out of a thread for a summary
Search the thread down to its messages and let the assistant summarize from them in place.
Giving an assistant mail access you can defend
Authorize once in the browser; the token is stored locally and access can be revoked from your Google account settings.
1 tool
Listed in project docs. Your client may show a different list.
BEFORE YOU INSTALL
What to know first
Tools you get
1 tool named in the project's documentation. Recent inbox emails come from the gmail://inbox/recent resource, not a tool. The server only reads Gmail: there is no send, draft, reply or delete.
Requires
GMAIL_CREDENTIALS_FILE in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
This one is built from source rather than installed with a single command.
Server setup
# Get the source
git clone https://github.com/ajbr0wn/gmail-mcp-server.git
# Create a conda environment
conda create -n mcp-gmail python=3.12
conda activate mcp-gmail
# Install the package
cd gmail-mcp-server
pip install -e .MCP Clients
Claude Desktop
{
"mcpServers": {
"gmail": {
"command": "<YOUR_PATH_TO_CONDA_ENVS_MCP_GMAIL>",
"args": [
"-m",
"gmail_mcp_server.server"
],
"env": {
"PYTHONPATH": "<YOUR_PATH_TO_GMAIL_MCP_SERVER>/src",
"GMAIL_CREDENTIALS_FILE": "<YOUR_GMAIL_CREDENTIALS_FILE>",
"GMAIL_TOKEN_FILE": "<YOUR_GMAIL_TOKEN_FILE>"
}
}
}
}