mcp-server-google-workspace
Allows listing, reading, searching, and sending emails through the Gmail API.
Allows listing calendars (including shared), listing events, and creating events with timezone support.
Provides file management capabilities (coming soon).
Click on "Deploy 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., "@mcp-server-google-workspace show my schedule for tomorrow"
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.
MCP Server - Google Workspace
A Model Context Protocol (MCP) server for Google Workspace integration, providing tools for Gmail, Google Calendar, and Google Drive access.
Features
🔐 Simple Authentication: Environment variable based credentials
📧 Gmail: List, read, search, and send emails
📅 Calendar: List calendars (including shared), list and create events in any accessible calendar
📁 Drive: File management (coming soon)
🔄 Auto Token Refresh: Automatic OAuth token refresh
🏢 Multi-User Support: Host applications can decrypt and inject user-specific credentials
🤝 Shared Calendar Support: Access and manage events in calendars shared with you
Related MCP server: Google Workspace MCP Server
Installation
For Individual Use
npm install mcp-server-google-workspace
# or
pnpm add mcp-server-google-workspaceFor Development
git clone <repo-url>
cd mcp-server-google-workspace
pnpm install
pnpm buildAuthentication
The MCP server reads Google OAuth credentials from environment variables:
# .env
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REFRESH_TOKEN=your_refresh_token
GOOGLE_ACCESS_TOKEN=your_access_token # optionalMulti-User Platforms
For platforms serving multiple users, the host application should:
Fetch encrypted credentials from database
Decrypt credentials (e.g., using AWS KMS)
Pass decrypted credentials as environment variables when starting the MCP server
This keeps the MCP server simple and delegates credential management to the host application.
Available Tools
Gmail Tools
gmail_list_emails
List recent emails from Gmail inbox.
Parameters:
hours(number, optional): Hours to look back (default: 24)maxResults(number, optional): Max emails to return (default: 50)query(string, optional): Gmail search query
Example:
{
"hours": 168,
"maxResults": 50,
"query": "from:boss@company.com"
}gmail_read_email
Read full content of a specific email.
Parameters:
emailId(string, required): Gmail message ID
gmail_search_emails
Search emails with Gmail query syntax.
Parameters:
query(string, required): Search querymaxResults(number, optional): Max results (default: 50)
Query Examples:
"from:user@example.com subject:meeting""has:attachment after:2025/11/01""is:unread label:important"
Calendar Tools
calendar_list_calendars
List all accessible calendars, including shared calendars.
Parameters:
showHidden(boolean, optional): Include hidden calendars (default: false)minAccessRole(string, optional): Minimum access role filter (freeBusyReader, reader, writer, owner)
Example:
{
"showHidden": false,
"minAccessRole": "reader"
}Response:
Returns a list of calendars with their IDs, names, access roles, and other metadata. Use the calendar id field for other calendar operations.
calendar_list_events
List calendar events for a date range. Returns events with timezone information.
Parameters:
calendarId(string, optional): Calendar ID (default: 'primary'). Usecalendar_list_calendarsto get IDs of shared calendars.date(string, optional): Start date (YYYY-MM-DD), default: todaydays(number, optional): Number of days (default: 1)maxResults(number, optional): Max events (default: 50)
Response:
Each event includes startTimeZone and endTimeZone fields, making it easy to handle events across different timezones (e.g., ET vs UTC).
calendar_create_event
Create a new calendar event with proper timezone support.
Parameters:
calendarId(string, optional): Calendar ID (default: 'primary'). Usecalendar_list_calendarsto get IDs of shared calendars.summary(string, required): Event titlestart(string, required): Start time (ISO 8601)end(string, required): End time (ISO 8601)timeZone(string, optional): IANA timezone (e.g., "America/New_York", "America/Los_Angeles", "UTC"). If not specified, uses the calendar's default timezone.description(string, optional): Event descriptionlocation(string, optional): Event locationattendees(array, optional): Attendee emails
Examples:
Creating event in EST timezone:
{
"calendarId": "primary",
"summary": "Team Meeting",
"start": "2025-11-02T10:00:00",
"end": "2025-11-02T11:00:00",
"timeZone": "America/New_York",
"description": "Quarterly review",
"attendees": ["team@company.com"]
}Creating event in UTC (default if not specified):
{
"summary": "Team Meeting",
"start": "2025-11-02T15:00:00Z",
"end": "2025-11-02T16:00:00Z"
}Usage
With Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"google-workspace": {
"command": "npx",
"args": ["-y", "mcp-server-google-workspace"],
"env": {
"GOOGLE_CLIENT_ID": "your_client_id",
"GOOGLE_CLIENT_SECRET": "your_client_secret",
"GOOGLE_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}Programmatic Usage (e.g., with Claude Agent SDK)
For multi-user platforms, decrypt credentials and inject them when starting the server:
import { Agent } from '@anthropic-ai/claude-agent-sdk';
// Your backend decrypts credentials from database
const credentials = await decryptUserCredentials(userId);
const agent = new Agent({
mcpServers: [{
command: 'node',
args: ['path/to/mcp-server-google-workspace/dist/index.js'],
env: {
GOOGLE_CLIENT_ID: credentials.clientId,
GOOGLE_CLIENT_SECRET: credentials.clientSecret,
GOOGLE_REFRESH_TOKEN: credentials.refreshToken,
}
}]
});Development
# Install dependencies
pnpm install
# Build
pnpm build
# Watch mode
pnpm watch
# Run locally
pnpm devTesting
With MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsWith Environment Variables
cp .env.example .env
# Edit .env with your credentials
pnpm devOAuth Setup
To get Google OAuth credentials:
Go to Google Cloud Console
Create a new project or select existing
Enable Gmail API and Google Calendar API
Create OAuth 2.0 credentials
Add authorized redirect URI
Get client ID and client secret
Use OAuth playground to get refresh token
Contributing
Contributions welcome! Please feel free to submit a Pull Request.
License
MIT
Author
iskifogl
Available Tools
8 toolscalendar_create_eventB
Create a new calendar event with title, time, and optional details. Can create events in any writable calendar.
Inputs: summary (required), start (required), end (required), calendarId, +4 more.
calendar_list_calendarsA
List all accessible calendars including shared calendars. Use this to get calendar IDs for other calendar operations.
Inputs: showHidden, minAccessRole.
calendar_list_eventsA
List calendar events for a specific date range. Can list events from any accessible calendar. Returns event times with their timezone information.
Inputs: calendarId, date, days, maxResults.
get_user_emailA
Get the authenticated user's email address
Inputs: no named parameters.
gmail_list_emailsB
List recent emails from Gmail inbox with optional filtering. Returns email metadata and content.
Inputs: hours, maxResults, query.
gmail_read_emailA
Read the full content of a specific email by ID
Inputs: emailId (required).
gmail_search_emailsA
Search emails using Gmail query syntax. Supports complex queries with operators like from:, to:, subject:, has:, is:, after:, before:
Inputs: query (required), maxResults.
gmail_send_emailB
Send an email via Gmail with subject, body, and recipients
Inputs: to (required), subject (required), body (required), cc, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The tools are cleanly separated by domain (calendar vs. Gmail) and within each domain, each tool has a distinct purpose (e.g., list vs. create vs. read). No overlapping functionality between tools.
Most tools follow a consistent 'domain_action' pattern in snake_case (e.g., calendar_create_event, gmail_send_email). However, 'get_user_email' lacks a domain prefix and is an exception.
8 tools is a well-scoped set for a Google Workspace server covering calendar and Gmail operations. It provides essential functionality without being overwhelming.
The toolset covers core operations for both calendar (create, list) and Gmail (list, read, search, send). Missing update/delete for events and messages, but these are minor gaps for common workflows.
Maintenance
Related MCP Connectors
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
Your Gmail, Calendar, Drive, GitHub, Oura, wallet and confirmed profile facts in any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to send, read, search, and manage Gmail emails, drafts, and labels via the Model Context Protocol.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to compose and send Gmail emails and append text to Google Docs using the Model Context Protocol.1,807 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables sending and drafting emails via Gmail and appending content to Google Docs through the Model Context Protocol.22 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send emails via Gmail and append text to Google Docs through the Model Context Protocol.511 npmMIT