How j3k0/mcp-google-workspace works
This is an MCP server that exposes multi-account Gmail and Google Calendar operations to an AI client. The main workflow is a client tool request, account/OAuth setup, dispatch to the Gmail or Calendar tool handler, then a Google API operation and a structured response. Gmail covers search, retrieval, drafts/replies, archiving, and attachment handling; Calendar covers calendar/event listing and event creation/deletion. The README documents these capabilities, while sampled source confirms the server routing, OAuth service, and tool implementations; some individual Gmail operations are not fully shown in the excerpts.
Main entry points: gauth.ts Google auth service · server.ts Workspace server · gmail.ts Gmail operations · calendar.ts Calendar operations
Components 13
MCP Server
- Workspace server
src/server.ts - OAuth callback
src/server.ts
Accounts & OAuth
- Auth CLI
src/authenticate.ts - Google auth service
src/services/gauth.ts - OAuth credentials
src/services/gauth.ts
Gmail
- Gmail operations
src/tools/gmail.ts - Gmail formatting
src/tools/gmail-helpers.ts - Attachment files
Calendar
- Calendar operations
src/tools/calendar.ts
Other components
- MCP client
- Google OAuth
- Gmail API
- Calendar API
Connections 18
- MCP client → Workspace server: sends tools
- Workspace server → Google auth service: initializes auth
- Workspace server → Gmail operations: dispatches Gmail
- Workspace server → Calendar operations: dispatches Calendar
- Workspace server → Google auth service: checks accounts
- Workspace server → Google auth service: loads credentials
- Workspace server → Google OAuth: opens consent
- Google OAuth → OAuth callback: returns code
- OAuth callback → Google auth service: exchanges code
- Auth CLI → Google auth service: authenticates accounts
- Google auth service → Google OAuth: requests tokens
- Google auth service → OAuth credentials: reads and writes
- Gmail operations → Google auth service: lists accounts
- Calendar operations → Google auth service: lists accounts
- Gmail operations → Gmail API: queries and updates
- Gmail operations → Gmail formatting: formats content
- Gmail operations → Attachment files: writes attachments
- Calendar operations → Calendar API: reads and updates