### Quick Start: Run Google Workspace MCP Server with uvx Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This snippet demonstrates how to quickly start the Google Workspace MCP server using `uvx`. It includes setting necessary Google OAuth credentials as environment variables and examples for starting the server with all tools, specific tools, or in HTTP debug mode. This method is recommended for instant setup and requires Python 3.11+ and `uvx`. ```bash export GOOGLE_OAUTH_CLIENT_ID="your-client-id.apps.googleusercontent.com" export GOOGLE_OAUTH_CLIENT_SECRET="your-client-secret" uvx workspace-mcp uvx workspace-mcp --tools gmail drive calendar uvx workspace-mcp --transport streamable-http ``` -------------------------------- ### Manually Configure Claude Desktop for Stdio Mode (uv Development) Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This JSON configuration snippet provides an alternative manual setup for Claude Desktop, specifically for development installations using `uv run main.py`. It includes specifying the current working directory (`cwd`) in addition to command, arguments, and environment variables. ```json { "mcpServers": { "google_workspace": { "command": "uv", "args": ["run", "main.py"], "cwd": "/path/to/google_workspace_mcp", "env": { "GOOGLE_OAUTH_CLIENT_ID": "your-client-id.apps.googleusercontent.com", "GOOGLE_OAUTH_CLIENT_SECRET": "your-client-secret" } } } } ``` -------------------------------- ### Start Google Workspace MCP Server with uv Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This section provides various `uv run` commands to start the Google Workspace MCP server in different modes: default stdio, HTTP streamable, single-user, and with selective tool registration. It illustrates how to customize server behavior. ```bash # Default (stdio mode for MCP clients) uv run main.py ``` ```bash # HTTP mode (for web interfaces and debugging) uv run main.py --transport streamable-http ``` ```bash # Single-user mode (simplified authentication) uv run main.py --single-user ``` ```bash # Selective tool registration (only register specific tools) uv run main.py --tools gmail drive calendar ``` ```bash uv run main.py --tools sheets docs ``` ```bash uv run main.py --single-user --tools gmail # Can combine with other flags ``` -------------------------------- ### Development Installation: Clone and Run Google Workspace MCP Server Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This snippet provides instructions for setting up the Google Workspace MCP server for development or customization. It involves cloning the repository from GitHub, navigating into the directory, and running the main script using `uv`. This method is suitable for contributors or users who need to modify the codebase. ```bash git clone https://github.com/taylorwilsdon/google_workspace_mcp.git cd google_workspace_mcp uv run main.py ``` -------------------------------- ### Start MCPO Proxy Server with Bash Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This Bash command initiates the MCPO proxy server, making the configured Google Workspace tools available on a specified port. It allows for custom port assignment, loading a configuration file, and securing the proxy with an optional API key for external access. ```bash mcpo --port 8001 --config config.json --api-key "your-optional-secret-key" ``` -------------------------------- ### Auto-install Claude Desktop Configuration for Stdio Mode Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This command executes a Python script to automatically configure Claude Desktop for connecting to the Google Workspace MCP server in stdio mode. This is the recommended approach for quick setup. ```python python install_claude.py ``` -------------------------------- ### Set Development and User Email Environment Variables Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This snippet demonstrates setting OAUTHLIB_INSECURE_TRANSPORT for development purposes and USER_GOOGLE_EMAIL as an optional default email for authentication, simplifying single-user setups. ```bash export OAUTHLIB_INSECURE_TRANSPORT=1 # Development only export USER_GOOGLE_EMAIL=your.email@gmail.com # Optional: Default email for auth - use this for single user setups and you won't need to set your email in system prompt for magic auth ``` -------------------------------- ### Manually Configure Claude Desktop for Stdio Mode (uvx) Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This JSON configuration snippet shows how to manually set up Claude Desktop to connect to the Google Workspace MCP server using `uvx` in stdio mode. It includes specifying the command, arguments, and environment variables for OAuth credentials. ```json { "mcpServers": { "google_workspace": { "command": "uvx", "args": ["workspace-mcp"], "env": { "GOOGLE_OAUTH_CLIENT_ID": "your-client-id.apps.googleusercontent.com", "GOOGLE_OAUTH_CLIENT_SECRET": "your-client-secret" } } } } ``` -------------------------------- ### Run Google Workspace MCP Server using Docker Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This snippet provides Docker commands to build an image for the Google Workspace MCP server and then run it, mapping port 8000 and mounting the current directory. It demonstrates containerized deployment. ```bash docker build -t workspace-mcp . docker run -p 8000:8000 -v $(pwd):/app workspace-mcp --transport streamable-http ``` -------------------------------- ### Google Workspace Tools API Reference Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md Detailed reference for available Google Workspace tools, categorized by service, including their names and functionalities. All tools support automatic authentication via @require_google_service() decorators with 30-minute service caching. ```APIDOC Google Calendar: list_calendars: List accessible calendars get_events: Retrieve events with time range filtering get_event: Fetch detailed information of a single event by ID create_event: Create events (all-day or timed) with optional Drive file attachments modify_event: Update existing events delete_event: Remove events Google Drive: search_drive_files: Search files with query syntax get_drive_file_content: Read file content (supports Office formats) list_drive_items: List folder contents create_drive_file: Create new files or fetch content from public URLs Gmail: search_gmail_messages: Search with Gmail operators get_gmail_message_content: Retrieve message content send_gmail_message: Send emails draft_gmail_message: Create drafts Google Docs: search_docs: Find documents by name get_doc_content: Extract document text list_docs_in_folder: List docs in folder create_doc: Create new documents read_doc_comments: Read all comments and replies create_doc_comment: Create new comments reply_to_comment: Reply to existing comments resolve_comment: Resolve comments Google Sheets: list_spreadsheets: List accessible spreadsheets get_spreadsheet_info: Get spreadsheet metadata read_sheet_values: Read cell ranges modify_sheet_values: Write/update/clear cells create_spreadsheet: Create new spreadsheets create_sheet: Add sheets to existing files read_sheet_comments: Read all comments and replies create_sheet_comment: Create new comments reply_to_sheet_comment: Reply to existing comments resolve_sheet_comment: Resolve comments Google Slides: create_presentation: Create new presentations get_presentation: Retrieve presentation details batch_update_presentation: Apply multiple updates at once get_page: Get specific slide information get_page_thumbnail: Generate slide thumbnails read_presentation_comments: Read all comments and replies create_presentation_comment: Create new comments reply_to_presentation_comment: Reply to existing comments resolve_presentation_comment: Resolve comments Google Forms: create_form: Create new forms with title and description get_form: Retrieve form details, questions, and URLs set_publish_settings: Configure form template and authentication settings get_form_response: Get individual form response details list_form_responses: List all responses to a form with pagination Google Chat: list_spaces: List chat spaces/rooms get_messages: Retrieve space messages send_message: Send messages to spaces search_messages: Search across chat history ``` -------------------------------- ### Google Workspace MCP Project Directory Structure Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md Illustrates the hierarchical organization of files and directories within the Google Workspace Multi-Cloud Proxy (MCP) project, highlighting key components like authentication, core utilities, service-specific tools, and entry points. ```text google_workspace_mcp/ ├── auth/ # Authentication system with decorators ├── core/ # MCP server and utilities ├── g{service}/ # Service-specific tools ├── main.py # Server entry point ├── client_secret.json # OAuth credentials (not committed) └── pyproject.toml # Dependencies ``` -------------------------------- ### Configure Google OAuth Credentials via Environment Variables Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This snippet shows how to set Google OAuth client ID, client secret, and redirect URI as environment variables. This method is recommended for production and containerized deployments as it avoids storing secrets in version control. ```bash export GOOGLE_OAUTH_CLIENT_ID="your-client-id.apps.googleusercontent.com" export GOOGLE_OAUTH_CLIENT_SECRET="your-client-secret" export GOOGLE_OAUTH_REDIRECT_URI="http://localhost:8000/oauth2callback" # Optional ``` -------------------------------- ### Configure Claude Desktop for HTTP Mode Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This JSON configuration snippet demonstrates how to set up Claude Desktop to connect to the Google Workspace MCP server via HTTP mode. It uses `npx mcp-remote` to proxy the connection to the specified local server URL. ```json { "mcpServers": { "google_workspace": { "command": "npx", "args": ["mcp-remote", "http://localhost:8000/mcp"] } } } ``` -------------------------------- ### Configure MCPO for Open WebUI Integration with JSON Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This JSON configuration defines how the MCPO server should expose a Google Workspace service as a streamable HTTP endpoint. It specifies the type of server and the URL where the Google Workspace MCP is running, enabling integration with external platforms like Open WebUI. ```json { "mcpServers": { "google_workspace": { "type": "streamablehttp", "url": "http://localhost:8000/mcp" } } } ``` -------------------------------- ### Define a Google Workspace Tool in Python Source: https://github.com/taylorwilsdon/google_workspace_mcp/blob/main/README.md This Python snippet demonstrates how to define a new tool that interacts with Google Workspace services. It utilizes the @require_google_service decorator for automatic service injection and scope management, allowing the tool to access Google Drive and return native Python objects. ```python from auth.service_decorator import require_google_service @require_google_service("drive", "drive_read") # Service + scope group async def your_new_tool(service, param1: str, param2: int = 10): """Tool description""" # service is automatically injected and cached result = service.files().list().execute() return result # Return native Python objects ```