google-workspace
A Model Context Protocol server for Google Workspace integration (Gmail and Calendar)
claude mcp add --transport stdio epaproditus-google-workspace-mcp-server node /path/to/google-workspace-server/build/index.js \ --env GOOGLE_CLIENT_ID="YOUR_CLIENT_ID" \ --env GOOGLE_CLIENT_SECRET="YOUR_CLIENT_SECRET" \ --env GOOGLE_REFRESH_TOKEN="YOUR_REFRESH_TOKEN"
How to use
This MCP server exposes tools to manage Gmail messages and Google Calendar events via the MCP interface. It provides Gmail tools such as listing emails, searching with Gmail query syntax, sending emails, and modifying emails (labels). It also exposes Calendar tools to list, create, update, and delete events. You can interact with these capabilities by sending MCP requests that include the appropriate method and payload for the desired tool. The server relies on OAuth credentials (client ID, client secret, and refresh token) that you configure in credentials.json and environment variables to authorize operations against Gmail and Google Calendar APIs.
How to install
Prerequisites:
- Node.js >= 14
- Access to Google Cloud Console with Gmail and Google Calendar APIs enabled
- OAuth 2.0 Client ID/Secret and a refresh token
Installation steps:
- Clone the repository
git clone https://github.com/epaproditus/google-workspace-mcp-server.git
cd google-workspace-mcp-server
- Install dependencies
npm install
- Create OAuth credentials file (credentials.json)
{
"web": {
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"redirect_uris": ["http://localhost:4100/code"],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token"
}
}
- Get a refresh token
node get-refresh-token.js
This will open a browser to authorize and will save tokens to token.json and display the refresh token. 5. Configure MCP settings (example snippet):
{
"mcpServers": {
"google-workspace": {
"command": "node",
"args": ["/path/to/google-workspace-server/build/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your_client_id",
"GOOGLE_CLIENT_SECRET": "your_client_secret",
"GOOGLE_REFRESH_TOKEN": "your_refresh_token"
}
}
}
}
- Build and run
npm run build
Run the server via your MCP host using the configured command and arguments as shown above.
Additional notes
Environment variables GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and GOOGLE_REFRESH_TOKEN are required for authentication. Ensure the Gmail API and Google Calendar API are enabled in your Google Cloud project and that the OAuth client ID has the correct redirect URI (http://localhost:4100/code). If you encounter authentication issues, re-authenticate or re-issue tokens. When updating scopes, re-run the refresh token flow to obtain valid credentials. Keep credentials secure and do not commit credentials.json or token.json to version control.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.