workspace-mcp-http


Nameworkspace-mcp-http JSON
Version 0.0.7 PyPI version JSON
download
home_pageNone
SummaryComprehensive, highly performant Google Workspace Streamable HTTP & SSE MCP Server for Calendar, Gmail, Docs, Sheets, Slides & Drive
upload_time2025-08-19 08:42:12
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT
keywords mcp google workspace llm ai claude model context protocol server
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Google Workspace MCP Server

A comprehensive Model Context Protocol (MCP) server for Google Workspace services including Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, and Chat with OAuth2 authentication.

## Features

- **Gmail Operations**: List labels, search messages, send emails, get message content
- **Google Drive**: File management, content access, and file creation
- **Google Calendar**: Event management and calendar operations
- **Google Docs**: Document creation and content access
- **Google Sheets**: Spreadsheet operations, data reading and creation
- **Google Slides**: Presentation management and creation
- **Google Forms**: Form creation and management
- **Google Tasks**: Task list and task management
- **Google Chat**: Space management and messaging
- **OAuth2 Authentication**: Secure access via Google Access Tokens
- **Stateless Architecture**: Each request is independent with Bearer token authentication
- **Service Filtering**: Enable specific services as needed

## Quick Start

### Starting the Server

```bash
# Start HTTP server on port 30000 (default)
python google_workspace_mcp_stateless.py

# Start on custom port
python google_workspace_mcp_stateless.py --port 8080

# Start with debug logging
python google_workspace_mcp_stateless.py --log-level DEBUG

# Enable specific services only
python google_workspace_mcp_stateless.py --tools gmail,drive,calendar

# Install and run from PyPI
pip install workspace-mcp-http
workspace-mcp-http
```

The server provides these endpoints:
- **`POST /mcp/`** - Main MCP endpoint for tool execution
- **`GET /health`** - Health check endpoint

### Authentication

All requests require a Google Access Token via Authorization header:

```bash
Authorization: Bearer ya29.your-google-access-token
```

[Set up Google OAuth2](https://developers.google.com/workspace/guides/auth-overview) and obtain access tokens with appropriate scopes.

## Tools

The server provides 25 tools for comprehensive Google Workspace API access. Each tool requires `Authorization: Bearer <token>` header.

### Gmail Tools

#### 1. gmail_list_labels
List all Gmail labels.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "tools/call",
    "params": {
      "name": "gmail_list_labels",
      "arguments": {}
    }
  }'
```

#### 2. gmail_search_messages
Search Gmail messages.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "2",
    "method": "tools/call",
    "params": {
      "name": "gmail_search_messages",
      "arguments": {
        "query": "is:unread from:important@example.com",
        "max_results": 20
      }
    }
  }'
```

#### 3. gmail_get_message_content
Get detailed information about a specific Gmail message.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "3",
    "method": "tools/call",
    "params": {
      "name": "gmail_get_message_content",
      "arguments": {
        "message_id": "1234567890abcdef"
      }
    }
  }'
```

#### 4. gmail_send_message
Send a Gmail message.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "4",
    "method": "tools/call",
    "params": {
      "name": "gmail_send_message",
      "arguments": {
        "to": "recipient@example.com",
        "subject": "Hello from Google Workspace MCP",
        "body": "This email was sent via the MCP server!"
      }
    }
  }'
```

### Google Drive Tools

#### 5. drive_list_files
List Google Drive files.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "5",
    "method": "tools/call",
    "params": {
      "name": "drive_list_files",
      "arguments": {
        "query": "name contains \"project\"",
        "max_results": 15
      }
    }
  }'
```

#### 6. drive_get_file_content
Get Google Drive file content.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "6",
    "method": "tools/call",
    "params": {
      "name": "drive_get_file_content",
      "arguments": {
        "file_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
      }
    }
  }'
```

#### 7. drive_create_file
Create a Google Drive file.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "7",
    "method": "tools/call",
    "params": {
      "name": "drive_create_file",
      "arguments": {
        "name": "my-document.txt",
        "content": "Hello, this is my new document content!",
        "parent_folder_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
      }
    }
  }'
```

### Google Calendar Tools

#### 8. calendar_list_events
List Google Calendar events.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "8",
    "method": "tools/call",
    "params": {
      "name": "calendar_list_events",
      "arguments": {
        "max_results": 25
      }
    }
  }'
```

#### 9. calendar_list_calendars
List Google Calendars.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "9",
    "method": "tools/call",
    "params": {
      "name": "calendar_list_calendars",
      "arguments": {}
    }
  }'
```

#### 10. calendar_create_event
Create a Google Calendar event.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "10",
    "method": "tools/call",
    "params": {
      "name": "calendar_create_event",
      "arguments": {
        "summary": "Team Meeting",
        "start_time": "2024-01-15T10:00:00-08:00",
        "end_time": "2024-01-15T11:00:00-08:00"
      }
    }
  }'
```

### Google Docs Tools

#### 11. docs_get_document
Get Google Docs document.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "11",
    "method": "tools/call",
    "params": {
      "name": "docs_get_document",
      "arguments": {
        "document_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
      }
    }
  }'
```

#### 12. docs_create_document
Create a Google Docs document.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "12",
    "method": "tools/call",
    "params": {
      "name": "docs_create_document",
      "arguments": {
        "title": "My New Document",
        "content": "This is the initial content of my document."
      }
    }
  }'
```

### Google Sheets Tools

#### 13. sheets_get_spreadsheet
Get Google Sheets spreadsheet.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "13",
    "method": "tools/call",
    "params": {
      "name": "sheets_get_spreadsheet",
      "arguments": {
        "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
      }
    }
  }'
```

#### 14. sheets_read_values
Read values from Google Sheets.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "14",
    "method": "tools/call",
    "params": {
      "name": "sheets_read_values",
      "arguments": {
        "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
        "range_name": "A1:D10"
      }
    }
  }'
```

#### 15. sheets_create_spreadsheet
Create a Google Sheets spreadsheet.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "15",
    "method": "tools/call",
    "params": {
      "name": "sheets_create_spreadsheet",
      "arguments": {
        "title": "My New Spreadsheet"
      }
    }
  }'
```

### Google Slides Tools

#### 16. slides_get_presentation
Get Google Slides presentation.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "16",
    "method": "tools/call",
    "params": {
      "name": "slides_get_presentation",
      "arguments": {
        "presentation_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
      }
    }
  }'
```

#### 17. slides_create_presentation
Create a Google Slides presentation.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "17",
    "method": "tools/call",
    "params": {
      "name": "slides_create_presentation",
      "arguments": {
        "title": "My New Presentation"
      }
    }
  }'
```

### Google Tasks Tools

#### 18. tasks_list_task_lists
List Google Tasks task lists.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "18",
    "method": "tools/call",
    "params": {
      "name": "tasks_list_task_lists",
      "arguments": {}
    }
  }'
```

#### 19. tasks_list_tasks
List tasks from a Google Tasks list.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "19",
    "method": "tools/call",
    "params": {
      "name": "tasks_list_tasks",
      "arguments": {
        "task_list_id": "@default"
      }
    }
  }'
```

#### 20. tasks_create_task
Create a task in Google Tasks.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "20",
    "method": "tools/call",
    "params": {
      "name": "tasks_create_task",
      "arguments": {
        "task_list_id": "@default",
        "title": "Complete project documentation",
        "notes": "Review and finalize all documentation for the project"
      }
    }
  }'
```

### Google Forms Tools

#### 21. forms_create_form
Create a Google Form.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "21",
    "method": "tools/call",
    "params": {
      "name": "forms_create_form",
      "arguments": {
        "title": "Customer Feedback Survey"
      }
    }
  }'
```

#### 22. forms_get_form
Get Google Form information.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "22",
    "method": "tools/call",
    "params": {
      "name": "forms_get_form",
      "arguments": {
        "form_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
      }
    }
  }'
```

### Google Chat Tools

#### 23. chat_list_spaces
List Google Chat spaces.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "23",
    "method": "tools/call",
    "params": {
      "name": "chat_list_spaces",
      "arguments": {}
    }
  }'
```

#### 24. chat_send_message
Send a message to Google Chat.

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "24",
    "method": "tools/call",
    "params": {
      "name": "chat_send_message",
      "arguments": {
        "space_name": "spaces/AAAAxxxxxxx",
        "text": "Hello from the Google Workspace MCP Server!"
      }
    }
  }'
```

## List Available Tools

Get the complete list of available tools:

```bash
curl -X POST http://localhost:30000/mcp/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer ya29.your-google-access-token" \
  -d '{
    "jsonrpc": "2.0",
    "id": "tools-list",
    "method": "tools/list",
    "params": {}
  }'
```

## Installation

### From PyPI
```bash
pip install workspace-mcp-http
workspace-mcp-http
```

### From Source
```bash
pip install -r requirements.txt
python google_workspace_mcp_stateless.py
```

## Authentication Setup

1. **Create Google Cloud Project:**
   - Go to [Google Cloud Console](https://console.cloud.google.com/)
   - Create a new project or select existing
   - Enable required APIs (Gmail, Drive, Calendar, etc.)

2. **Set up OAuth2:**
   - Go to "Credentials" → "Create Credentials" → "OAuth 2.0 Client IDs"
   - Configure OAuth consent screen
   - Download client configuration

3. **Required Scopes:**
   ```
   https://www.googleapis.com/auth/gmail.readonly
   https://www.googleapis.com/auth/gmail.send
   https://www.googleapis.com/auth/drive
   https://www.googleapis.com/auth/calendar
   https://www.googleapis.com/auth/documents
   https://www.googleapis.com/auth/spreadsheets
   https://www.googleapis.com/auth/presentations
   https://www.googleapis.com/auth/tasks
   https://www.googleapis.com/auth/forms.body
   https://www.googleapis.com/auth/chat.spaces
   ```

4. **Get Access Token:**
   - Use Google OAuth2 flow to obtain access tokens
   - Pass tokens via `Authorization: Bearer` header

## Usage with Claude Desktop

Add the following to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "google-workspace": {
      "command": "python",
      "args": ["/path/to/google_workspace_mcp_stateless.py"],
      "env": {
        "GOOGLE_ACCESS_TOKEN": "ya29.your-google-access-token"
      }
    }
  }
}
```

## Configuration

### Environment Variables

```bash
# Optional - server will get token from Authorization header if not set
GOOGLE_ACCESS_TOKEN=ya29.your-google-access-token

# Server Configuration
PORT=30000
LOG_LEVEL=INFO
```

### Service Filtering

Enable specific services only:

```bash
# Enable only Gmail and Drive
python google_workspace_mcp_stateless.py --tools gmail,drive

# Enable Calendar, Docs, and Sheets
python google_workspace_mcp_stateless.py --tools calendar,docs,sheets
```

Available services: `gmail`, `drive`, `calendar`, `docs`, `sheets`, `slides`, `forms`, `tasks`, `chat`

## Use Cases

### Email Management
- Search and filter Gmail messages
- Send automated emails
- Manage labels and organization
- Extract email content and metadata

### Document Collaboration
- Create and manage Google Docs
- Access document content
- Automate document workflows
- Sync content across services

### Data Analysis
- Read and write Google Sheets data
- Create automated reports
- Manage spreadsheet operations
- Export data for analysis

### Project Management
- Manage Google Tasks and task lists
- Create calendar events and schedules
- Track project milestones
- Coordinate team activities

### Communication
- Manage Google Chat spaces
- Send automated notifications
- Create Google Forms for feedback
- Coordinate team communications

## Error Handling

The server provides detailed error messages for common issues:
- **401**: Invalid or expired Google access token
- **403**: Insufficient permissions or missing scopes
- **404**: Resource not found (document, file, etc.)
- **429**: Rate limit exceeded
- **500**: Internal server errors

## Google Workspace Concepts

### File IDs
Google Drive, Docs, Sheets, and Slides use unique file IDs:
- Found in URLs: `https://docs.google.com/document/d/{FILE_ID}/edit`
- Format: Long alphanumeric string (e.g., `1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms`)

### Resource Names
Google Chat spaces use resource names:
- Format: `spaces/{SPACE_ID}`
- Example: `spaces/AAAAxxxxxxx`

### Time Formats
Calendar events use RFC3339 format:
- Format: `YYYY-MM-DDTHH:MM:SS±HH:MM`
- Example: `2024-01-15T10:00:00-08:00`

## Development

### Run in Development Mode
```bash
python google_workspace_mcp_stateless.py --log-level DEBUG --port 8080
```

### Testing
```bash
python test_token_auth.py
```

## License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "workspace-mcp-http",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "mcp, google, workspace, llm, ai, claude, model, context, protocol, server",
    "author": null,
    "author_email": "Taylor Wilsdon <taylor@taylorwilsdon.com>",
    "download_url": "https://files.pythonhosted.org/packages/5a/39/f7f2aba3752fe0913adf1b9552166141191f9af30bba941e909436f52b7a/workspace_mcp_http-0.0.7.tar.gz",
    "platform": null,
    "description": "# Google Workspace MCP Server\n\nA comprehensive Model Context Protocol (MCP) server for Google Workspace services including Gmail, Drive, Calendar, Docs, Sheets, Slides, Forms, Tasks, and Chat with OAuth2 authentication.\n\n## Features\n\n- **Gmail Operations**: List labels, search messages, send emails, get message content\n- **Google Drive**: File management, content access, and file creation\n- **Google Calendar**: Event management and calendar operations\n- **Google Docs**: Document creation and content access\n- **Google Sheets**: Spreadsheet operations, data reading and creation\n- **Google Slides**: Presentation management and creation\n- **Google Forms**: Form creation and management\n- **Google Tasks**: Task list and task management\n- **Google Chat**: Space management and messaging\n- **OAuth2 Authentication**: Secure access via Google Access Tokens\n- **Stateless Architecture**: Each request is independent with Bearer token authentication\n- **Service Filtering**: Enable specific services as needed\n\n## Quick Start\n\n### Starting the Server\n\n```bash\n# Start HTTP server on port 30000 (default)\npython google_workspace_mcp_stateless.py\n\n# Start on custom port\npython google_workspace_mcp_stateless.py --port 8080\n\n# Start with debug logging\npython google_workspace_mcp_stateless.py --log-level DEBUG\n\n# Enable specific services only\npython google_workspace_mcp_stateless.py --tools gmail,drive,calendar\n\n# Install and run from PyPI\npip install workspace-mcp-http\nworkspace-mcp-http\n```\n\nThe server provides these endpoints:\n- **`POST /mcp/`** - Main MCP endpoint for tool execution\n- **`GET /health`** - Health check endpoint\n\n### Authentication\n\nAll requests require a Google Access Token via Authorization header:\n\n```bash\nAuthorization: Bearer ya29.your-google-access-token\n```\n\n[Set up Google OAuth2](https://developers.google.com/workspace/guides/auth-overview) and obtain access tokens with appropriate scopes.\n\n## Tools\n\nThe server provides 25 tools for comprehensive Google Workspace API access. Each tool requires `Authorization: Bearer <token>` header.\n\n### Gmail Tools\n\n#### 1. gmail_list_labels\nList all Gmail labels.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"1\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"gmail_list_labels\",\n      \"arguments\": {}\n    }\n  }'\n```\n\n#### 2. gmail_search_messages\nSearch Gmail messages.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"2\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"gmail_search_messages\",\n      \"arguments\": {\n        \"query\": \"is:unread from:important@example.com\",\n        \"max_results\": 20\n      }\n    }\n  }'\n```\n\n#### 3. gmail_get_message_content\nGet detailed information about a specific Gmail message.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"3\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"gmail_get_message_content\",\n      \"arguments\": {\n        \"message_id\": \"1234567890abcdef\"\n      }\n    }\n  }'\n```\n\n#### 4. gmail_send_message\nSend a Gmail message.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"4\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"gmail_send_message\",\n      \"arguments\": {\n        \"to\": \"recipient@example.com\",\n        \"subject\": \"Hello from Google Workspace MCP\",\n        \"body\": \"This email was sent via the MCP server!\"\n      }\n    }\n  }'\n```\n\n### Google Drive Tools\n\n#### 5. drive_list_files\nList Google Drive files.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"5\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"drive_list_files\",\n      \"arguments\": {\n        \"query\": \"name contains \\\"project\\\"\",\n        \"max_results\": 15\n      }\n    }\n  }'\n```\n\n#### 6. drive_get_file_content\nGet Google Drive file content.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"6\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"drive_get_file_content\",\n      \"arguments\": {\n        \"file_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\"\n      }\n    }\n  }'\n```\n\n#### 7. drive_create_file\nCreate a Google Drive file.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"7\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"drive_create_file\",\n      \"arguments\": {\n        \"name\": \"my-document.txt\",\n        \"content\": \"Hello, this is my new document content!\",\n        \"parent_folder_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\"\n      }\n    }\n  }'\n```\n\n### Google Calendar Tools\n\n#### 8. calendar_list_events\nList Google Calendar events.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"8\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"calendar_list_events\",\n      \"arguments\": {\n        \"max_results\": 25\n      }\n    }\n  }'\n```\n\n#### 9. calendar_list_calendars\nList Google Calendars.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"9\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"calendar_list_calendars\",\n      \"arguments\": {}\n    }\n  }'\n```\n\n#### 10. calendar_create_event\nCreate a Google Calendar event.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"10\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"calendar_create_event\",\n      \"arguments\": {\n        \"summary\": \"Team Meeting\",\n        \"start_time\": \"2024-01-15T10:00:00-08:00\",\n        \"end_time\": \"2024-01-15T11:00:00-08:00\"\n      }\n    }\n  }'\n```\n\n### Google Docs Tools\n\n#### 11. docs_get_document\nGet Google Docs document.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"11\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"docs_get_document\",\n      \"arguments\": {\n        \"document_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\"\n      }\n    }\n  }'\n```\n\n#### 12. docs_create_document\nCreate a Google Docs document.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"12\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"docs_create_document\",\n      \"arguments\": {\n        \"title\": \"My New Document\",\n        \"content\": \"This is the initial content of my document.\"\n      }\n    }\n  }'\n```\n\n### Google Sheets Tools\n\n#### 13. sheets_get_spreadsheet\nGet Google Sheets spreadsheet.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"13\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"sheets_get_spreadsheet\",\n      \"arguments\": {\n        \"spreadsheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\"\n      }\n    }\n  }'\n```\n\n#### 14. sheets_read_values\nRead values from Google Sheets.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"14\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"sheets_read_values\",\n      \"arguments\": {\n        \"spreadsheet_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\",\n        \"range_name\": \"A1:D10\"\n      }\n    }\n  }'\n```\n\n#### 15. sheets_create_spreadsheet\nCreate a Google Sheets spreadsheet.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"15\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"sheets_create_spreadsheet\",\n      \"arguments\": {\n        \"title\": \"My New Spreadsheet\"\n      }\n    }\n  }'\n```\n\n### Google Slides Tools\n\n#### 16. slides_get_presentation\nGet Google Slides presentation.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"16\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"slides_get_presentation\",\n      \"arguments\": {\n        \"presentation_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\"\n      }\n    }\n  }'\n```\n\n#### 17. slides_create_presentation\nCreate a Google Slides presentation.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"17\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"slides_create_presentation\",\n      \"arguments\": {\n        \"title\": \"My New Presentation\"\n      }\n    }\n  }'\n```\n\n### Google Tasks Tools\n\n#### 18. tasks_list_task_lists\nList Google Tasks task lists.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"18\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"tasks_list_task_lists\",\n      \"arguments\": {}\n    }\n  }'\n```\n\n#### 19. tasks_list_tasks\nList tasks from a Google Tasks list.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"19\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"tasks_list_tasks\",\n      \"arguments\": {\n        \"task_list_id\": \"@default\"\n      }\n    }\n  }'\n```\n\n#### 20. tasks_create_task\nCreate a task in Google Tasks.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"20\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"tasks_create_task\",\n      \"arguments\": {\n        \"task_list_id\": \"@default\",\n        \"title\": \"Complete project documentation\",\n        \"notes\": \"Review and finalize all documentation for the project\"\n      }\n    }\n  }'\n```\n\n### Google Forms Tools\n\n#### 21. forms_create_form\nCreate a Google Form.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"21\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"forms_create_form\",\n      \"arguments\": {\n        \"title\": \"Customer Feedback Survey\"\n      }\n    }\n  }'\n```\n\n#### 22. forms_get_form\nGet Google Form information.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"22\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"forms_get_form\",\n      \"arguments\": {\n        \"form_id\": \"1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms\"\n      }\n    }\n  }'\n```\n\n### Google Chat Tools\n\n#### 23. chat_list_spaces\nList Google Chat spaces.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"23\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"chat_list_spaces\",\n      \"arguments\": {}\n    }\n  }'\n```\n\n#### 24. chat_send_message\nSend a message to Google Chat.\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"24\",\n    \"method\": \"tools/call\",\n    \"params\": {\n      \"name\": \"chat_send_message\",\n      \"arguments\": {\n        \"space_name\": \"spaces/AAAAxxxxxxx\",\n        \"text\": \"Hello from the Google Workspace MCP Server!\"\n      }\n    }\n  }'\n```\n\n## List Available Tools\n\nGet the complete list of available tools:\n\n```bash\ncurl -X POST http://localhost:30000/mcp/ \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json, text/event-stream\" \\\n  -H \"Authorization: Bearer ya29.your-google-access-token\" \\\n  -d '{\n    \"jsonrpc\": \"2.0\",\n    \"id\": \"tools-list\",\n    \"method\": \"tools/list\",\n    \"params\": {}\n  }'\n```\n\n## Installation\n\n### From PyPI\n```bash\npip install workspace-mcp-http\nworkspace-mcp-http\n```\n\n### From Source\n```bash\npip install -r requirements.txt\npython google_workspace_mcp_stateless.py\n```\n\n## Authentication Setup\n\n1. **Create Google Cloud Project:**\n   - Go to [Google Cloud Console](https://console.cloud.google.com/)\n   - Create a new project or select existing\n   - Enable required APIs (Gmail, Drive, Calendar, etc.)\n\n2. **Set up OAuth2:**\n   - Go to \"Credentials\" \u2192 \"Create Credentials\" \u2192 \"OAuth 2.0 Client IDs\"\n   - Configure OAuth consent screen\n   - Download client configuration\n\n3. **Required Scopes:**\n   ```\n   https://www.googleapis.com/auth/gmail.readonly\n   https://www.googleapis.com/auth/gmail.send\n   https://www.googleapis.com/auth/drive\n   https://www.googleapis.com/auth/calendar\n   https://www.googleapis.com/auth/documents\n   https://www.googleapis.com/auth/spreadsheets\n   https://www.googleapis.com/auth/presentations\n   https://www.googleapis.com/auth/tasks\n   https://www.googleapis.com/auth/forms.body\n   https://www.googleapis.com/auth/chat.spaces\n   ```\n\n4. **Get Access Token:**\n   - Use Google OAuth2 flow to obtain access tokens\n   - Pass tokens via `Authorization: Bearer` header\n\n## Usage with Claude Desktop\n\nAdd the following to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"google-workspace\": {\n      \"command\": \"python\",\n      \"args\": [\"/path/to/google_workspace_mcp_stateless.py\"],\n      \"env\": {\n        \"GOOGLE_ACCESS_TOKEN\": \"ya29.your-google-access-token\"\n      }\n    }\n  }\n}\n```\n\n## Configuration\n\n### Environment Variables\n\n```bash\n# Optional - server will get token from Authorization header if not set\nGOOGLE_ACCESS_TOKEN=ya29.your-google-access-token\n\n# Server Configuration\nPORT=30000\nLOG_LEVEL=INFO\n```\n\n### Service Filtering\n\nEnable specific services only:\n\n```bash\n# Enable only Gmail and Drive\npython google_workspace_mcp_stateless.py --tools gmail,drive\n\n# Enable Calendar, Docs, and Sheets\npython google_workspace_mcp_stateless.py --tools calendar,docs,sheets\n```\n\nAvailable services: `gmail`, `drive`, `calendar`, `docs`, `sheets`, `slides`, `forms`, `tasks`, `chat`\n\n## Use Cases\n\n### Email Management\n- Search and filter Gmail messages\n- Send automated emails\n- Manage labels and organization\n- Extract email content and metadata\n\n### Document Collaboration\n- Create and manage Google Docs\n- Access document content\n- Automate document workflows\n- Sync content across services\n\n### Data Analysis\n- Read and write Google Sheets data\n- Create automated reports\n- Manage spreadsheet operations\n- Export data for analysis\n\n### Project Management\n- Manage Google Tasks and task lists\n- Create calendar events and schedules\n- Track project milestones\n- Coordinate team activities\n\n### Communication\n- Manage Google Chat spaces\n- Send automated notifications\n- Create Google Forms for feedback\n- Coordinate team communications\n\n## Error Handling\n\nThe server provides detailed error messages for common issues:\n- **401**: Invalid or expired Google access token\n- **403**: Insufficient permissions or missing scopes\n- **404**: Resource not found (document, file, etc.)\n- **429**: Rate limit exceeded\n- **500**: Internal server errors\n\n## Google Workspace Concepts\n\n### File IDs\nGoogle Drive, Docs, Sheets, and Slides use unique file IDs:\n- Found in URLs: `https://docs.google.com/document/d/{FILE_ID}/edit`\n- Format: Long alphanumeric string (e.g., `1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms`)\n\n### Resource Names\nGoogle Chat spaces use resource names:\n- Format: `spaces/{SPACE_ID}`\n- Example: `spaces/AAAAxxxxxxx`\n\n### Time Formats\nCalendar events use RFC3339 format:\n- Format: `YYYY-MM-DDTHH:MM:SS\u00b1HH:MM`\n- Example: `2024-01-15T10:00:00-08:00`\n\n## Development\n\n### Run in Development Mode\n```bash\npython google_workspace_mcp_stateless.py --log-level DEBUG --port 8080\n```\n\n### Testing\n```bash\npython test_token_auth.py\n```\n\n## License\n\nThis MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Comprehensive, highly performant Google Workspace Streamable HTTP & SSE MCP Server for Calendar, Gmail, Docs, Sheets, Slides & Drive",
    "version": "0.0.7",
    "project_urls": {
        "Changelog": "https://github.com/taylorwilsdon/google_workspace_mcp/releases",
        "Documentation": "https://github.com/taylorwilsdon/google_workspace_mcp#readme",
        "Homepage": "https://workspacemcp.com",
        "Issues": "https://github.com/taylorwilsdon/google_workspace_mcp/issues",
        "Repository": "https://github.com/taylorwilsdon/google_workspace_mcp"
    },
    "split_keywords": [
        "mcp",
        " google",
        " workspace",
        " llm",
        " ai",
        " claude",
        " model",
        " context",
        " protocol",
        " server"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "85447c4b16f0b2fa746bed8d8a2c0619521216ef94b15519cc53a5d3700e5650",
                "md5": "814170f11e4d0f3f522e05360f175023",
                "sha256": "c2c73f83770a66b61d0d5120eb4e5d22aec394ebdbe12fa582ba7491910b2f6d"
            },
            "downloads": -1,
            "filename": "workspace_mcp_http-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "814170f11e4d0f3f522e05360f175023",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 133655,
            "upload_time": "2025-08-19T08:42:10",
            "upload_time_iso_8601": "2025-08-19T08:42:10.323453Z",
            "url": "https://files.pythonhosted.org/packages/85/44/7c4b16f0b2fa746bed8d8a2c0619521216ef94b15519cc53a5d3700e5650/workspace_mcp_http-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5a39f7f2aba3752fe0913adf1b9552166141191f9af30bba941e909436f52b7a",
                "md5": "64b6a83e1bb08f1929eb6e7cd7398e09",
                "sha256": "2cd5fc5e91db02d60d5b10b170267c8ea8fdac61104839ca8e8696189c191fc6"
            },
            "downloads": -1,
            "filename": "workspace_mcp_http-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "64b6a83e1bb08f1929eb6e7cd7398e09",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 101995,
            "upload_time": "2025-08-19T08:42:12",
            "upload_time_iso_8601": "2025-08-19T08:42:12.123235Z",
            "url": "https://files.pythonhosted.org/packages/5a/39/f7f2aba3752fe0913adf1b9552166141191f9af30bba941e909436f52b7a/workspace_mcp_http-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-19 08:42:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "taylorwilsdon",
    "github_project": "google_workspace_mcp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "workspace-mcp-http"
}
        
Elapsed time: 0.51708s