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
Metadata
Release files for gmail-multi-user-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gmail_multi_user_mcp-0.1.0.tar.gz | 74.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gmail_multi_user_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 171.4 kB
Release files / gmail_multi_user_mcp-0.1.0.tar.gz
| Download URL | gmail_multi_user_mcp-0.1.0.tar.gz |
|---|---|
| Size | 74.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4d87c9230512f80d98ad721d7916506f600c73bac6ac4c305982816f7336a91
|
|
BLAKE2b-256 checksum How to use checksums |
ac6c545c2fb3ba7dd3ac3502f787294ba2f0c9090947b45faa69b2d134210bc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Jan 12, 2026.
Transparency logRelease files / gmail_multi_user_mcp-0.1.0-py3-none-any.whl
| Download URL | gmail_multi_user_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 97.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23ec9d2ed1125603443d918ff1551f40fbf71c2a990dfc4d517b70a434157294
|
|
BLAKE2b-256 checksum How to use checksums |
5cdc2f8de28ddbffb9c80b24438edf4ae541ae0bc5d510a752363ba632b361d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Jan 12, 2026.
Transparency logSecurity for gmail-multi-user-mcp 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for gmail_multi_user_mcp-0.1.0.tar.gz
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 Jan 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.