MCP server for Google APIs (Gmail + Calendar)
Project description
mcp-google
MCP server for Google APIs — Gmail and Calendar tools for LLM agents.
Install
pip install -e ".[dev]"
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_google-0.1.0.tar.gz.
File metadata
- Download URL: mcp_google-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
978f2248c88a2883bc0d93628a3ccb5a32851155e35bf32c952110502c628aeb
|
|
| MD5 |
75ab8879715ec890261c6287f875c7c1
|
|
| BLAKE2b-256 |
588eca40d93959ed19c38247a047d4e994944afe57a85ee5f7426edc67f5453f
|
Provenance
The following attestation bundles were made for mcp_google-0.1.0.tar.gz:
Publisher:
publish.yml on antonio-mello-ai/mcp-google
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_google-0.1.0.tar.gz -
Subject digest:
978f2248c88a2883bc0d93628a3ccb5a32851155e35bf32c952110502c628aeb - Sigstore transparency entry: 1719353072
- Sigstore integration time:
-
Permalink:
antonio-mello-ai/mcp-google@461d8b8fe585e45f2847916307032a1055112ae3 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/antonio-mello-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@461d8b8fe585e45f2847916307032a1055112ae3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_google-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_google-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c5b10394be56c85d909465d2f099b4daafb5cf636462e19360adb2b0f0cceb8
|
|
| MD5 |
fee07b1323a254fcd7fc87fd7804948c
|
|
| BLAKE2b-256 |
7e523312ddc17f5ebb1c6358c5f0fc569a7d181abcc474a8eb64f549b3d42ba1
|
Provenance
The following attestation bundles were made for mcp_google-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on antonio-mello-ai/mcp-google
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_google-0.1.0-py3-none-any.whl -
Subject digest:
1c5b10394be56c85d909465d2f099b4daafb5cf636462e19360adb2b0f0cceb8 - Sigstore transparency entry: 1719353225
- Sigstore integration time:
-
Permalink:
antonio-mello-ai/mcp-google@461d8b8fe585e45f2847916307032a1055112ae3 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/antonio-mello-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@461d8b8fe585e45f2847916307032a1055112ae3 -
Trigger Event:
release
-
Statement type: