google-workspace-mcp
Provides tools to list, read, search, send, and manage emails and labels in Gmail.
Provides tools to search conversations, list and search messages, and send messages in Google Chat.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-workspace-mcpfind free slots tomorrow at 2pm"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Workspace MCP
A unified MCP server for Google Workspace APIs: Chat, Gmail, and Calendar.
Installation
npm installRelated MCP server: mcp-gsuite
Setup
The MCP handles authentication automatically via OpenCode:
First Run: When OpenCode starts the MCP, it passes
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETvia environment variablesOAuth Flow: On first run, the server checks for tokens in
~/.local/share/opencode/mcp-auth.jsonIf No Tokens: Server initiates OAuth flow (browser login)
Subsequent Runs: Tokens are loaded automatically
No manual setup needed when running via OpenCode.
Manual Setup (if needed)
For testing outside OpenCode, set environment variables and run the server:
export GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
export GOOGLE_CLIENT_SECRET="your-secret-here"
node server.jsThe server will detect missing tokens and initiate OAuth flow automatically.
Usage
The MCP provides 16 tools across 3 services:
Chat (4 tools)
chat_search_conversations— Search/list Google Chat spaceschat_list_messages— Retrieve messages from a space or threadchat_search_messages— Search messages by keywords, sender, timechat_send_message— Send message to space or reply to thread
Gmail (6 tools)
gmail_list_messages— List emails with optional querygmail_get_message— Retrieve full message detailsgmail_search_messages— Search emails with Gmail syntaxgmail_send_message— Send new emailgmail_list_labels— List all labels and countsgmail_modify_message— Add/remove labels from message
Calendar (6 tools)
calendar_list_events— List events in time rangecalendar_get_event— Retrieve event detailscalendar_create_event— Create new calendar eventcalendar_update_event— Modify existing eventcalendar_delete_event— Delete calendar eventcalendar_find_free_slots— Find available time slots
Testing
npm run testTests require tokens to exist. Run npm run setup first if you haven't authenticated.
Configuration
The MCP is configured in opencode.jsonc:
{
"mcp": {
"google-workspace": {
"type": "local",
"command": ["node", "D:\\OneDrive\\Workspace\\google-workspace-mcp\\server.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id-here.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-secret-here"
},
"enabled": true
}
}
}Both GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET must be set for OAuth to work.
Architecture
server.js— MCP dispatcher with all 16 tools (receives env from OpenCode)services/— Modular service implementations (Chat, Gmail, Calendar)utils/— Shared OAuth token management and HTTP client
Token Refresh
Tokens are automatically refreshed when:
Access token expires (< 60 seconds remaining)
A tool request is made
Refresh logic is transparent — no manual intervention needed.
See AGENTS.md for repository conventions, contribution guidance, and security notes.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/camposdelima/google-workspace-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server