Skip to main content

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

  1. Create a Google Cloud Project and enable the Gmail API
  2. Create OAuth 2.0 credentials (Desktop or Web application)
  3. Copy gmail_config.yaml.example to gmail_config.yaml
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gmail_multi_user_mcp-0.1.0.tar.gz (74.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gmail_multi_user_mcp-0.1.0-py3-none-any.whl (97.2 kB view details)

Uploaded Python 3

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

Hashes for gmail_multi_user_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e4d87c9230512f80d98ad721d7916506f600c73bac6ac4c305982816f7336a91
MD5 07ce333124761a58c79f164e6d4a2d63
BLAKE2b-256 ac6c545c2fb3ba7dd3ac3502f787294ba2f0c9090947b45faa69b2d134210bc4

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gmail_multi_user_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gmail_multi_user_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23ec9d2ed1125603443d918ff1551f40fbf71c2a990dfc4d517b70a434157294
MD5 4423d147acf13c7870b5adf35f0daa5a
BLAKE2b-256 5cdc2f8de28ddbffb9c80b24438edf4ae541ae0bc5d510a752363ba632b361d8

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page