A powerful Model Context Protocol (MCP) server that seamlessly integrates Claude Desktop with Google Workspace services. This project enables AI assistants to interact with Google Sheets, Gmail, and Google Calendar through a standardized MCP interface.
- Read data from spreadsheets
- Write and update cell values
- Append rows to sheets
- Get spreadsheet metadata
- List and search emails
- Get detailed email information
- Send emails
- Advanced email filtering
- List upcoming events
- Create new events
- Update existing events
- Delete events
- Get event details
- PostgreSQL integration via MCP
- MongoDB integration via MCP
- Full CRUD operations
- Query execution and data management
- Python 3.8 or higher
- Google Cloud Project with APIs enabled:
- Google Sheets API
- Gmail API
- Google Calendar API
- Claude Desktop installed
-
Clone the repository
git clone https://github.com/yourusername/claude-google-workspace-integration.git cd claude-google-workspace-integration -
Install dependencies
pip install -r requirements.txt
-
Set up Google OAuth
- Download
credentials.jsonfrom Google Cloud Console - Place it in the project root directory
- Run the setup script:
python src/config_setup.py
- Download
-
Configure the application
- Copy
config.example.jsontoconfig.json - Fill in your configuration details
- Copy
-
Configure Claude Desktop
- Locate your Claude Desktop config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- Windows:
- Add the MCP server configuration (see
claude_desktop_config.example.json) - Update the file paths to match your installation
- Restart Claude Desktop
- Locate your Claude Desktop config file:
Once configured, you can interact with Google Workspace services through Claude Desktop:
- "Read data from Sheet1!A1:B10 in my spreadsheet"
- "Write these values to my spreadsheet: [['Name', 'Age'], ['John', '30']]"
- "Append this row to Sheet1: ['Task', 'Description', 'Status']"
- "Show me my last 10 emails"
- "Search for emails from john@example.com"
- "Send an email to jane@example.com with subject 'Meeting' and body 'Let's meet tomorrow'"
- "List my upcoming calendar events"
- "Create a calendar event for tomorrow at 2pm titled 'Team Meeting'"
- "Update the event with ID xyz123 to change the time to 3pm"
.
├── src/
│ ├── main_server.py # Main MCP server
│ ├── auth_manager.py # OAuth2 authentication
│ ├── sheets_manager.py # Google Sheets integration
│ ├── email_manager.py # Gmail integration
│ ├── calendar_manager.py # Calendar integration
│ ├── mongo_handler.py # MongoDB operations
│ ├── mongo_server.py # MongoDB MCP server
│ ├── postgres_handler.py # PostgreSQL operations
│ ├── postgres_server.py # PostgreSQL MCP server
│ ├── automation_agent.py # Automation agent
│ └── config_setup.py # Setup script
├── config.example.json # Configuration template
├── claude_desktop_config.example.json # Claude Desktop config template
├── requirements.txt # Python dependencies
└── README.md # This file
read_sheet- Read data from a rangewrite_sheet- Write data to a rangeappend_sheet- Append rows to a sheetget_sheet_info- Get spreadsheet metadata
list_emails- List emails from inboxget_email_detail- Get detailed email informationsend_email- Send an emailsearch_emails- Search emails with query
list_calendar_events- List upcoming eventscreate_calendar_event- Create a new eventupdate_calendar_event- Update an existing eventdelete_calendar_event- Delete an eventget_calendar_event- Get event details
- PostgreSQL:
execute_query,execute_write,run_custom_sql,list_tables,describe_table,get_table_count - MongoDB:
list_databases,list_collections,find_documents,insert_document,update_document,delete_document, and more
- Never commit
credentials.json,tokens.json, orconfig.jsonto version control - These files are already in
.gitignore - Keep your OAuth credentials secure
- Regularly rotate credentials if compromised
- Verify Python is in your system PATH
- Check that the file path in Claude Desktop config is correct
- Ensure all dependencies are installed:
pip install -r requirements.txt
- Check Claude Desktop logs for errors
- Verify authentication:
tokens.jsonexists and is valid - Re-run setup:
python src/config_setup.py - Completely restart Claude Desktop
- Re-authenticate:
python src/config_setup.py - Verify
credentials.jsonis valid - Check that all required APIs are enabled in Google Cloud Console
This project is provided as-is for personal and educational use. Please ensure you comply with Google's API Terms of Service when using this integration.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Built with Model Context Protocol (MCP)
- Uses Google APIs Client Library for Python
- Designed for integration with Claude Desktop
If you encounter any issues:
- Check the Troubleshooting section
- Review the Google API documentation
- Open an issue on GitHub with a detailed description
Note: This project is not affiliated with, endorsed by, or associated with Anthropic or Google. It is an independent integration project.