mcp-google
MCP server for Google APIs — Gmail and Calendar tools for LLM agents.
Install
# Run directly with uvx (no install needed)
uvx mcp-google
# Or install with pip
pip install mcp-google
Environment Variables
| Variable | Description |
|---|---|
GOOGLE_CLIENT_ID |
OAuth2 client ID from Google Cloud Console |
GOOGLE_CLIENT_SECRET |
OAuth2 client secret |
GOOGLE_ACCOUNTS_JSON |
JSON array of account configs (see below) |
GOOGLE_ACCOUNTS_JSON format
[
{"email": "personal@gmail.com", "refresh_token": "1//..."},
{"email": "work@company.com", "refresh_token": "1//..."}
]
The first account in the array is used as default when no account parameter is specified.
Tools
Phase 1 — Read-only
| Tool | Parameters | Description |
|---|---|---|
gmail_list_unread |
account?, max_results? |
List unread emails (subject, sender, date, snippet) |
gmail_get_message |
message_id, account? |
Get full email content by ID |
calendar_today |
account? |
Today's events |
calendar_week |
account? |
This week's agenda |
Phase 2 — Write
| Tool | Parameters | Description |
|---|---|---|
gmail_send |
to, subject, body, account? |
Send an email |
calendar_create_event |
title, start, end, account? |
Create a calendar event |
OAuth Setup
- Go to Google Cloud Console
- Create a project (or select existing)
- Enable Gmail API and Google Calendar API
- Go to Credentials > Create Credentials > OAuth 2.0 Client ID
- Application type: Desktop app
- Note the Client ID and Client Secret
- Configure OAuth consent screen with required scopes:
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/calendar.readonlyhttps://www.googleapis.com/auth/calendar.events
- Obtain refresh tokens for each account using the OAuth2 flow
- Set environment variables (copy
.env.exampleto.envand fill in values)
Obtaining Refresh Tokens
Use the Google OAuth Playground or run a local OAuth flow:
# Quick method via oauth2l
pip install google-auth-oauthlib
python -c "
from google_auth_oauthlib.flow import InstalledAppFlow
flow = InstalledAppFlow.from_client_config(
{'installed': {'client_id': 'YOUR_CLIENT_ID', 'client_secret': 'YOUR_SECRET', 'auth_uri': 'https://accounts.google.com/o/oauth2/auth', 'token_uri': 'https://oauth2.googleapis.com/token'}},
scopes=['https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.send', 'https://www.googleapis.com/auth/calendar.readonly', 'https://www.googleapis.com/auth/calendar.events']
)
creds = flow.run_local_server(port=0)
print(f'Refresh token: {creds.refresh_token}')
"
Running
# As MCP server (stdio transport)
mcp-google
# Or directly
python -m mcp_google.server
Claude Desktop config
{
"mcpServers": {
"google": {
"command": "mcp-google",
"env": {
"GOOGLE_CLIENT_ID": "...",
"GOOGLE_CLIENT_SECRET": "...",
"GOOGLE_ACCOUNTS_JSON": "[{\"email\": \"me@gmail.com\", \"refresh_token\": \"...\"}]"
}
}
}
}
License
MIT
Metadata
Release files for mcp-google 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_google-0.1.1.tar.gz | 66.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_google-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 75.4 kB
Release files / mcp_google-0.1.1.tar.gz
| Download URL | mcp_google-0.1.1.tar.gz |
|---|---|
| Size | 66.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fe68148780072560cedc1876662ec9c5cc508b8c566093634ae6011238d39a3
|
|
BLAKE2b-256 checksum How to use checksums |
af7899008be44ea6d2eb59f9ac32fb3acb5f22ad34f0079d19e94cfb912d7369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / mcp_google-0.1.1-py3-none-any.whl
| Download URL | mcp_google-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b11fb8314cd56a0282ef187b770f93d087053b0a170401fb8acc0ebd3f03279
|
|
BLAKE2b-256 checksum How to use checksums |
1f51595436657dbfa0e8ec5ef7255840316ac173b585baf9f0ece89886813c39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency log