google-workspace-mcp
A unified MCP server for Google Workspace APIs providing tools for Chat, Gmail, and Calendar operations including messaging, email management, and event scheduling.
README
Google Workspace MCP
A unified MCP server for Google Workspace APIs: Chat, Gmail, and Calendar.
Installation
npm install
Setup
The MCP handles authentication automatically via OpenCode:
- First Run: When OpenCode starts the MCP, it passes
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETvia environment variables - OAuth Flow: On first run, the server checks for tokens in
~/.local/share/opencode/mcp-auth.json - If 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.js
The 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 test
Tests 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.