Google Workspace MCP Server
Allows sending and drafting emails via Gmail using the authenticated user's account.
Allows appending text to the end of an existing Google Document.
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., "@Google Workspace MCP Serversend an email to john@example.com with subject 'Hello' and body 'Just checking in'"
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 Server
A generic Model Context Protocol (MCP) Server that exposes Google Workspace capabilities to AI agents. Currently, it supports sending and drafting emails via Gmail and appending content to Google Docs.
Prerequisites
Node.js (v18 or higher recommended)
Google Cloud Project with the following APIs enabled:
Gmail API
Google Docs API
Related MCP server: Gmail MCP
Setup Instructions
1. Configure Google Cloud OAuth
Go to the Google Cloud Console.
Create a new project or select an existing one.
Navigate to APIs & Services > Library and enable Gmail API and Google Docs API.
Navigate to APIs & Services > OAuth consent screen and configure it. Add your email address as a test user if the app is in "Testing" mode.
Navigate to APIs & Services > Credentials.
Click Create Credentials > OAuth client ID.
Select Desktop app as the application type and create it.
Download the client ID and client secret.
2. Configure Environment Variables
Copy
.env.exampleto.env:cp .env.example .envUpdate
.envwith yourGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET.
3. Install Dependencies
npm install4. Authenticate
Run the authentication script to generate and save your OAuth tokens locally:
npm run authFollow the prompt in your terminal. It will provide a URL for you to visit. Log in with your Google account, authorize the requested scopes, and copy the provided code back into the terminal.
This will generate a .credentials.json file in the root of the project. Keep this file secure and do not commit it to version control.
5. Build and Run Locally
To compile the TypeScript code:
npm run buildTo run the MCP server (starts an Express server on port 3000 by default):
npm startFor development, you can use:
npm run dev6. Deploy to Railway
Push your repository to GitHub.
Create a new project on Railway and deploy from your GitHub repo.
In the Railway Variables dashboard, add the following variables:
GOOGLE_CLIENT_ID: Your Google OAuth Client ID.GOOGLE_CLIENT_SECRET: Your Google OAuth Client Secret.GOOGLE_OAUTH_CREDENTIALS: Copy the entire contents of your local.credentials.jsonand paste it here.
Railway will automatically build and start the Express server.
Configuring an MCP Client
This server uses Server-Sent Events (SSE) over HTTP, meaning it is meant to be accessed via a URL rather than a local command.
If your AI client supports connecting to remote MCP servers via SSE (like some custom clients or extensions), point it to your Railway URL (or localhost if running locally):
SSE URL: https://your-app-name.up.railway.app/sse
If you are using a client that requires a local executable (like Claude Desktop), you will need a proxy or wrapper that bridges stdio to the remote SSE endpoints, as Claude Desktop currently natively spawns local processes via stdio.
Available Tools
send_email: Sends an email using the authenticated user's Gmail account.draft_email: Creates a draft email in the authenticated user's Gmail account.append_to_doc: Appends text to the end of an existing Google Document.
This server cannot be deployed
Maintenance
Related MCP Connectors
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables Gmail, Google Calendar, and Google Drive access through the Model Context Protocol, supporting email management, event scheduling, and file operations.8528MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to send, read, search, and manage Gmail emails, drafts, and labels via the Model Context Protocol.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to compose and send Gmail emails and append text to Google Docs using the Model Context Protocol.1,091MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to send emails via Gmail and append text to Google Docs through the Model Context Protocol.205MIT