Multi-user Gmail integration library and MCP server
Project description
gmail-multi-user-mcp
Multi-user Gmail integration library and MCP server for AI agents and consumer applications.
Features
- Hybrid Distribution: Use as a Python library or MCP server
- Multi-User OAuth: End-users authenticate with their own Gmail accounts
- Automatic Token Management: Encryption, refresh, and storage handled automatically
- Full Gmail Operations: Search, read, send, draft, labels, attachments
- Flexible Storage: SQLite for development, Supabase for production
Quick Start
Installation
pip install gmail-multi-user-mcp
Configuration
- Create a Google Cloud Project and enable the Gmail API
- Create OAuth 2.0 credentials (Desktop or Web application)
- Copy
gmail_config.yaml.exampletogmail_config.yaml - Fill in your credentials
Usage as Library
from gmail_multi_user import GmailClient
# Initialize client (loads config automatically)
client = GmailClient()
# Generate OAuth URL for a user
result = client.get_auth_url(user_id="user_123")
print(f"Please visit: {result.auth_url}")
# After OAuth callback, search emails
messages = client.search(
connection_id="conn_abc",
query="is:unread"
)
for msg in messages.messages:
print(f"{msg.subject} from {msg.from_.email}")
Usage as MCP Server
# Start the MCP server
gmail-mcp serve
# Or with HTTP transport
gmail-mcp serve --transport http --port 8000
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
ruff check .
black --check .
mypy gmail_multi_user gmail_mcp_server
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 gmail_multi_user_mcp-0.1.0.tar.gz.
File metadata
- Download URL: gmail_multi_user_mcp-0.1.0.tar.gz
- Upload date:
- Size: 74.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4d87c9230512f80d98ad721d7916506f600c73bac6ac4c305982816f7336a91
|
|
| MD5 |
07ce333124761a58c79f164e6d4a2d63
|
|
| BLAKE2b-256 |
ac6c545c2fb3ba7dd3ac3502f787294ba2f0c9090947b45faa69b2d134210bc4
|
Provenance
The following attestation bundles were made for gmail_multi_user_mcp-0.1.0.tar.gz:
Publisher:
release.yml on RTinkslinger/gmail-mcp-multi-use
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gmail_multi_user_mcp-0.1.0.tar.gz -
Subject digest:
e4d87c9230512f80d98ad721d7916506f600c73bac6ac4c305982816f7336a91 - Sigstore transparency entry: 815046803
- Sigstore integration time:
-
Permalink:
RTinkslinger/gmail-mcp-multi-use@09f948307b86a4443ca88085d3351c897d51580f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/RTinkslinger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@09f948307b86a4443ca88085d3351c897d51580f -
Trigger Event:
push
-
Statement type:
File details
Details for the file gmail_multi_user_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gmail_multi_user_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 97.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ec9d2ed1125603443d918ff1551f40fbf71c2a990dfc4d517b70a434157294
|
|
| MD5 |
4423d147acf13c7870b5adf35f0daa5a
|
|
| BLAKE2b-256 |
5cdc2f8de28ddbffb9c80b24438edf4ae541ae0bc5d510a752363ba632b361d8
|
Provenance
The following attestation bundles were made for gmail_multi_user_mcp-0.1.0-py3-none-any.whl:
Publisher:
release.yml on RTinkslinger/gmail-mcp-multi-use
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gmail_multi_user_mcp-0.1.0-py3-none-any.whl -
Subject digest:
23ec9d2ed1125603443d918ff1551f40fbf71c2a990dfc4d517b70a434157294 - Sigstore transparency entry: 815046806
- Sigstore integration time:
-
Permalink:
RTinkslinger/gmail-mcp-multi-use@09f948307b86a4443ca88085d3351c897d51580f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/RTinkslinger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@09f948307b86a4443ca88085d3351c897d51580f -
Trigger Event:
push
-
Statement type: