MCP Hub
Back to servers

google-workspace-unlimited

A comprehensive Google Workspace integration for MCP that provides access to Gmail, Drive, Calendar, Docs, and more with advanced Jinja2 templating and semantic search capabilities.

Stars
8
Forks
2
Tools
11
Updated
Jan 18, 2026
Validated
Jan 25, 2026

🚀 GoogleUnlimited Google Workspace Platform

docs pypi license

GoogleUnlimited is a comprehensive MCP framework that provides seamless Google Workspace integration through an advanced middleware architecture. It enables AI assistants and MCP clients to interact with Gmail, Google Drive, Docs, Sheets, Slides, Calendar, Forms, Chat, and Photos services using a unified, secure API.

📋 Table of Contents

⚡ Quick Installation Instructions

What is GoogleUnlimited?

GoogleUnlimited provides AI assistants with access to Google Workspace services through the Model Context Protocol (MCP). It supports 90+ tools across 9 Google services, enabling seamless integration between AI workflows and Google Workspace applications with revolutionary performance improvements.

Architecture Overview

🛠️ Installation Methods

Method 1: Quick Install via uvx (Recommended)

The fastest way to get started - install directly from PyPI:

{
  "mcpServers": {
    "google-workspace-unlimited": {
      "command": "uvx",
      "args": ["google-workspace-unlimited"],
      "disabled": false,
      "timeout": 300
    }
  }
}

That's it! The server runs in stdio mode by default, perfect for MCP clients like Claude Desktop, Cursor, Roo, etc.

Method 2: Clone and Development Setup

For development or customization:

  1. Clone and setup:

    git clone https://github.com/dipseth/google_workspace_fastmcp2.git
    cd google_workspace_fastmcp2
    uv sync
    
  2. Configure Google OAuth:

    a. Go to Google Cloud Console

    b. Create a new project (or select existing)

    c. Enable the APIs you need: Gmail, Drive, Docs, Sheets, Slides, Calendar, Forms, Chat, Photos

    d. Go to APIs & Services > Credentials > Create Credentials > OAuth client ID

    e. Select Web application as the application type

    f. Under Authorized redirect URIs, add:

    http://localhost:8002/oauth2callback
    

    g. Click Create and copy your Client ID and Client Secret

  3. Setup environment:

    cp .env.example .env
    

    Edit .env with your credentials:

    # Your OAuth credentials from Google Cloud Console
    GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
    GOOGLE_CLIENT_SECRET=your-client-secret
    
    # Must match EXACTLY what you set in Google Cloud Console
    OAUTH_REDIRECT_URI=http://localhost:8002/oauth2callback
    

    Alternative: Instead of GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET, you can download the JSON file from Google and set GOOGLE_CLIENT_SECRETS_FILE=credentials.json

  4. Start the server:

    uv run python server.py
    

📚 Configuration Resources:

📋 Environment Variables Reference

VariableRequiredDefaultDescription
GOOGLE_CLIENT_IDYes*-OAuth 2.0 client ID from Google Cloud Console
GOOGLE_CLIENT_SECRETYes*-OAuth 2.0 client secret from Google Cloud Console
GOOGLE_CLIENT_SECRETS_FILEYes*-Alternative: path to OAuth JSON file
OAUTH_REDIRECT_URIYeshttp://localhost:8002/oauth2callbackMust match Google Console exactly
SERVER_HOSTNolocalhostServer bind address
SERVER_PORTNo8002Server port
ENABLE_HTTPSNofalseEnable HTTPS/SSL
SSL_CERT_FILEIf HTTPS-Path to SSL certificate
SSL_KEY_FILEIf HTTPS-Path to SSL private key
CREDENTIAL_STORAGE_MODENoFILE_ENCRYPTEDFILE_ENCRYPTED, FILE_PLAINTEXT, MEMORY_ONLY
CREDENTIALS_DIRNo./credentialsDirectory for stored credentials
LOG_LEVELNoINFODEBUG, INFO, WARNING, ERROR
SESSION_TIMEOUT_MINUTESNo60Session idle timeout
GMAIL_ALLOW_LISTNo-Comma-separated allowed email addresses
QDRANT_URLNohttp://localhost:6333Qdrant vector database URL
QDRANT_KEYNoNONEQdrant API key (use NONE for no auth)
FASTMCP_CLOUDNofalseEnable cloud deployment mode
MINIMAL_TOOLS_STARTUPNotrueStart with only 5 protected tools enabled
MINIMAL_STARTUP_SERVICESNo``Comma-separated services to enable at startup (e.g., drive,gmail)

*Either GOOGLE_CLIENT_ID + GOOGLE_CLIENT_SECRET OR GOOGLE_CLIENT_SECRETS_FILE is required.

🔗 Client Connections

GoogleUnlimited supports multiple connection methods. Here are the two most popular ways to get started:

🎯 Quick Setup Options

Option 1: Cursor IDE (STDIO - Community Verified ✅):

{
  "mcpServers": {
    "google-workspace": {
      "command": "uv",
      "args": [
        "--directory", "/path/to/google_workspace_fastmcp2",
        "run", "python", "server.py"
      ],
      "env": {
        "GOOGLE_CLIENT_SECRETS_FILE": "/path/to/client_secrets.json",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Option 2: HTTP Streamable (VS Code Roo, Claude Desktop, etc.):

# 1. Start server in HTTP mode
uv run python server.py --transport http --port 8002

# 2. Configure your client with:
{
  "google-workspace": {
    "type": "streamable-http",
    "url": "https://localhost:8002/mcp",
    "disabled": false
  }
}

📚 Complete Connection Guide

For detailed setup instructions, troubleshooting, and configurations for all supported clients including:

  • Claude Code CLI (HTTP & STDIO)
  • Claude Desktop
  • VS Code/GitHub Copilot
  • Claude.ai with Cloudflare Tunnel
  • And more...

🔗 Complete Client Connection Guide - Comprehensive setup instructions, troubleshooting, and advanced configurations for all supported AI clients and development environments

🎯 Service Capabilities

GoogleUnlimited supports 9 Google Workspace services with 90+ specialized tools:

ServiceIconToolsKey FeaturesDocumentation
Gmail📧14Send, reply, labels, filters, search, allowlistapi-reference/gmail/
Drive📁9Upload, download, sharing, Office docs, file managementapi-reference/drive/
Docs📄4Create, edit, format, batch operationsapi-reference/docs/
Sheets📊7Read, write, formulas, formattingapi-reference/sheets/
Slides🎯5Presentations, templates, exportapi-reference/slides/
Calendar📅9Events, scheduling, attendees, timezonesapi-reference/calendar/
Forms📝8Creation, responses, validation, publishingapi-reference/forms/
Chat💬24Messaging, cards, spaces, webhooks, unified cardsapi-reference/chat/
Photos📷12Albums, upload, search, metadata, smart searchapi-reference/photos/

📚 API Documentation Resources:

🧠 Middleware Architecture

GoogleUnlimited uses a middleware architecture that provides seamless service integration, intelligent resource management, and powerful templating capabilities.

Middleware Architecture

🔧 Core Middleware Components

  • 🏷️ TagBasedResourceMiddleware: Intelligent resource discovery using URI patterns (service://gmail/messages, user://current/email)
  • 🧠 QdrantUnifiedMiddleware: AI-powered semantic search across all tool responses with vector embeddings
  • 🎨 TemplateMiddleware: Advanced Jinja2 template system for beautiful, structured output formatting

✨ Architecture Benefits

  • 🔄 Unified Resource Access: URI-based access to service data without API calls
  • 🧠 Semantic Intelligence: Natural language search across all stored responses
  • 🎨 Visual Excellence: Consistent, beautiful output formatting for optimal AI consumption
  • 💰 Token Efficiency: Template macros reduce token usage by 60-80% through structured data rendering
  • ⚡ Performance: 30x faster than traditional approaches through intelligent caching

📚 Middleware Documentation Resources:

🚀 Minimal Tools Startup

By default, GoogleUnlimited starts with only 5 protected tools enabled for optimal performance and security. This allows clients to enable only the tools they need.

Protected Tools (Always Available):

  • manage_tools - Enable/disable tools globally or per-session
  • manage_tools_by_analytics - Analytics-based tool management
  • health_check - Server health and configuration status
  • start_google_auth - Initiate OAuth authentication
  • check_drive_auth - Verify authentication status

Configuration:

# Default: Start with minimal tools (only 5 protected tools)
MINIMAL_TOOLS_STARTUP=true

# Optional: Pre-enable specific services at startup
MINIMAL_STARTUP_SERVICES=drive,gmail,calendar

# Disable minimal startup (enable all 90+ tools immediately)
MINIMAL_TOOLS_STARTUP=false

Enabling Tools at Runtime:

# Enable all tools globally
manage_tools(action="enable_all")

# Enable specific tools
manage_tools(action="enable", tool_names=["search_drive_files", "list_gmail_labels"])

# List all registered tools (shows enabled/disabled status)
manage_tools(action="list")

🔧 Session-Scoped Tool Management

GoogleUnlimited supports per-session tool enable/disable functionality, allowing different MCP clients to have different tool availability without affecting other connected clients.

Key Features:

  • Session Isolation: Disable tools for one client session without affecting others
  • Non-Invasive: Session-scoped operations never modify the global tool registry
  • Protected Tools: Core management tools (manage_tools, health_check, etc.) always remain available
  • Middleware-Based: Uses SessionToolFilteringMiddleware for protocol-level filtering

Usage Examples:

# Disable tools for this session only (other clients unaffected)
manage_tools(action="disable", tool_names=["send_gmail_message"], scope="session")

# Disable all except specific tools for this session
manage_tools(action="disable_all_except", tool_names=["search_drive_files", "list_events"], scope="session")

# Re-enable all tools for this session
manage_tools(action="enable_all", scope="session")

# Global operations (original behavior, affects all clients)
manage_tools(action="disable", tool_names=["send_gmail_message"], scope="global")

Response Structure:

{
  "success": true,
  "action": "disable_all_except",
  "scope": "session",
  "enabledCount": 94,
  "disabledCount": 0,
  "toolsAffected": ["tool1", "tool2", "..."],
  "sessionState": {
    "sessionId": "f725be09...",
    "sessionAvailable": true,
    "sessionDisabledTools": ["tool1", "tool2"],
    "sessionDisabledCount": 89
  },
  "message": "Kept 5 tools, disabled 89 tools for this session"
}

🔗 URL-Based Service Filtering (HTTP Transport)

When using HTTP/SSE transport, you can filter tools by service directly via URL query parameters - no code required:

# Enable only Gmail tools
http://localhost:8002/mcp?service=gmail

# Enable Gmail + Drive + Calendar
http://localhost:8002/mcp?service=gmail,drive,calendar

# Resume a previous session
http://localhost:8002/mcp?uuid=your-session-id

# Resume session with specific services
http://localhost:8002/mcp?uuid=abc123&service=gmail,drive

# Disable minimal startup (enable all tools)
http://localhost:8002/mcp?minimal=false

Available URL Parameters:

ParameterExampleDescription
service or services?service=gmail,driveComma-separated list of services to enable
uuid?uuid=abc123Resume a previous session by ID
minimal?minimal=falseOverride minimal startup mode

Available Services: gmail, drive, calendar, docs, sheets, slides, photos, chat, forms, people

📚 Session Tool Management Resources:

🎨 Template System

GoogleUnlimited features powerful Jinja2 template macros that transform raw Google Workspace data into visually stunning, AI-optimized formats.

🎯 Available Template Macros

Template FileMacroPurposeKey Features
email_card.j2render_gmail_labels_chips()Gmail label visualizationInteractive chips, unread counts, direct Gmail links
calendar_dashboard.j2render_calendar_dashboard()Calendar & events dashboardPrimary/shared calendars, upcoming events, dark theme
dynamic_macro.j2render_calendar_events_dashboard()Calendar events dashboardEvent cards, time/location details, clickable links, dark theme
document_templates.j2generate_report_doc()Professional reportsMetrics, tables, charts, company branding
colorfuL_email.j2render_beautiful_email3()Rich HTML emailsMultiple signatures, gradients, responsive design

💡 Template Macro Examples

Gmail Labels Visualization - Transform label lists into beautiful interactive chips:

{{ render_gmail_labels_chips( service://gmail/labels , 'Label summary for: ' + user://current/email ) }}

Calendar Dashboard - Create comprehensive calendar overviews:

{{ render_calendar_dashboard( service://calendar/calendars, service://calendar/events, 'My Calendar Overview' ) }}

Calendar Events Dashboard - Transform calendar events into beautiful, interactive event cards:

{{ render_calendar_events_dashboard( service://calendar/events , 'Upcoming Events for: ' + user://current/email.email ) }}

Calendar Events Dashboard Example

This macro creates a stunning dark-themed dashboard featuring:

  • 📅 Interactive Event Cards: Each event is rendered as a clickable card that opens in Google Calendar
  • 🕐 Smart Time Display: Automatically formats all-day events vs. timed events with timezone support
  • 📍 Location Integration: Displays meeting locations and virtual meeting links
  • 👥 Attendee Information: Shows attendee counts and participant details
  • Status Indicators: Color-coded status (confirmed, tentative, cancelled) with visual feedback
  • 📱 Responsive Design: Mobile-optimized layout with touch-friendly interactions
  • 🎨 Dark Theme Styling: Professional appearance with gradient backgrounds and hover effects

Professional Documents - Generate reports with metrics and charts:

{{ generate_report_doc(
    report_title='Q4 Performance Report',
    metrics=[{'value': '$1.2M', 'label': 'Revenue', 'change': 15}],
    company_name='Your Company'
) }}

🔍 Macro Discovery & Dynamic Creation

Explore all available macros using the template resource system:

# Access the template://macros resource to discover all available macros
macros = await access_resource("template://macros")
# Returns comprehensive macro information with usage examples

# Access specific macro details
macro_details = await access_resource("template://macros/render_gmail_labels_chips")

🎯 Dynamic Macro Creation

Create custom macros at runtime using the create_template_macro tool:

# Create a new macro dynamically
await create_template_macro(
    macro_name="render_task_status_badge",
    macro_content='''
    {% macro render_task_status_badge(status, size='small') %}
    {% if status == 'completed' %}
    <span class="status-badge status-completed {{ size }}">✅ Complete</span>
    {% elif status == 'in_progress' %}
    <span class="status-badge status-in-progress {{ size }}">🔄 In Progress</span>
    {% else %}
    <span class="status-badge status-pending {{ size }}">⏳ {{ status|title }}</span>
    {% endif %}
    {% endmacro %}
    ''',
    description="Renders visual status badges for task states with appropriate icons",
    usage_example="{{ render_task_status_badge('completed', 'large') }}",
    persist_to_file=True
)

# Immediately use the newly created macro
await send_gmail_message(
    html_body="Task Status: {{ render_task_status_badge('completed', 'large') }}"
)

Key Features:

  • Immediate Availability: Macros are instantly available after creation
  • 🎯 Resource Integration: Automatically available via template://macros/macro_name
  • 💾 Optional Persistence: Save macros to disk for permanent availability
  • 🔄 Template Processing: Full Jinja2 syntax validation and error handling

🚀 Real-World Usage

Templates can be directly used in tool calls for beautiful, structured output:

# Send a beautiful email with calendar dashboard
await send_gmail_message(
    to="manager@company.com",
    subject="Weekly Schedule Update",
    html_body="{{ render_calendar_events_dashboard( service://calendar/events, 'My upcoming events') }}",
    content_type="mixed"
)

# Generate and send a professional report
await create_doc(
    title="Q4 Performance Report",
    content="{{ generate_report_doc( report_title='Quarterly Results', company_name='GoogleUnlimited' ) }}"
)

📚 Template System Resources:

🗂️ Resource Discovery

GoogleUnlimited provides a powerful MCP resource system that enables lightning-fast data access without API calls through intelligent URI patterns.

Resource Discovery

🎯 Resource URI Patterns

PatternPurposeExampleReturns
user://profile/{email}User authentication statususer://profile/john@gmail.comProfile + auth state
service://{service}/listsAvailable service listsservice://gmail/lists[filters, labels]
service://{service}/{list_type}All items in listservice://gmail/labelsAll Gmail labels
service://{service}/{list_type}/{id}Specific item detailsservice://gmail/labels/INBOXINBOX label details
recent://{service}Recent itemsrecent://driveRecent Drive files
qdrant://search/{query}Semantic searchqdrant://search/gmail errorsRelevant responses

🏗️ Key Resource Files

⚡ Lightning-Fast Access

# Instant Gmail labels (no API call needed)
labels = await access_resource("service://gmail/labels")

# Current user info from session
user = await access_resource("user://current/email")

# Semantic search across all tool responses
results = await access_resource("qdrant://search/gmail errors today")

# Recent calendar events
events = await access_resource("recent://calendar")

📚 Resource System Documentation:

🧪 Testing Framework

GoogleUnlimited includes comprehensive testing with client tests that validate MCP usage exactly as an LLM would experience it, plus additional testing suites. 559 tests passing with 100% pass rate.

🎯 Client Testing Focus

Testing Framework

The client tests are the most important component - they provide deterministic testing of MCP operations using real resource integration and standardized patterns across all 90+ tools and 9 Google services. These tests validate both explicit email authentication and middleware injection patterns.

🚀 Quick Test Commands

# 🧪 Run all client tests (primary test suite)
uv run pytest tests/client/ -v

# 📧 Test specific service
uv run pytest tests/client/ -k "gmail" -v

# 🔐 Authentication required tests
uv run pytest tests/client/ -m "auth_required" -v

🔬 Real Resource ID Integration

The testing framework fetches real IDs from service resources for realistic testing:

# Available fixtures for real resource testing
real_gmail_message_id      # From service://gmail/messages
real_drive_document_id     # From service://drive/items
real_calendar_event_id     # From service://calendar/events
real_photos_album_id       # From service://photos/albums
real_forms_form_id         # From service://forms/forms
real_chat_space_id         # From service://chat/spaces

🔄 CI/CD Pipeline

Automated testing and publishing via GitHub Actions:

  • CI Workflow: Runs on every PR and push to main
    • Python 3.11 & 3.12 matrix testing
    • Linting with ruff and formatting with black
    • Full test suite execution
  • TestPyPI Publishing: Automated package publishing for testing

📚 Testing Resources:

🔒 Security & Authentication

GoogleUnlimited implements enterprise-grade security with OAuth 2.1 + PKCE, advanced session management, and comprehensive audit capabilities.

Security Architecture

🛡️ Authentication Flows

  1. 🌐 MCP Inspector OAuth: MCP Spec compliant with Dynamic Client Registration
  2. 🖥️ Direct Server OAuth: Web-based authentication for direct access
  3. 🔧 Development JWT: Testing mode with generated tokens
  4. 📁 Enhanced File Credentials: Persistent storage with encryption options
  5. 🔑 Custom OAuth Clients: Bring your own OAuth credentials with automatic fallback

✨ Security Features

  • 🔐 OAuth 2.1 + PKCE: Modern authentication with proof-of-key exchange (supports public clients)
  • 🔒 Session Isolation: Multi-tenant support preventing data leaks
  • 🏷️ 27+ API Scopes: Granular permission management across all services
  • 📊 Audit Logging: Complete security event tracking
  • 🔐 AES-256 Encryption: Machine-specific keys for credential storage
  • 🔄 Three-Tier Fallback: Robust credential persistence across server restarts (State Map → UnifiedSession → Context Storage)

⚙️ Security Configuration

# 🔒 Security settings in .env
CREDENTIAL_STORAGE_MODE=FILE_ENCRYPTED
SESSION_SECRET_KEY=your-secret-key
SESSION_TIMEOUT_MINUTES=30
ENABLE_AUDIT_LOGGING=true
GMAIL_ALLOW_LIST=trusted@example.com

📚 Security Documentation Resources:


🚀 Ready to revolutionize your Google Workspace integration?

📚 Documentation🔧 Configuration🎯 API Reference🧪 Testing

Reviews

No reviews yet

Sign in to write a review