Google Workspace MCP Server
Allows sending emails via Gmail, supporting To, CC, BCC, HTML, and Reply-To.
Allows appending text to 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 Sarah with subject 'Hello'"
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 enables AI agents to securely interact with Google Workspace services. The server exposes tools for sending emails via Gmail and appending content to Google Docs.
It is built with Express and SSE Transport, making it perfect for cloud deployments (like Railway) so remote AI agents can connect over HTTP.
Features
send_email: Send an email (Supports To, CC, BCC, HTML, Reply-To).append_to_google_doc: Append text to an existing Google Document.
Related MCP server: Google Workspace MCP Server
Setup Instructions
1. Google Cloud Console Setup
Create a project in Google Cloud Console.
Enable the Gmail API and Google Docs API.
Create OAuth 2.0 Client IDs (Desktop application type).
Download the credentials and save them as
credentials.jsonin the root of this project.
2. Generate Tokens
Install dependencies:
npm installRun the token generation script:
npm run authFollow the CLI prompt to authorize the application. The tokens will be saved locally and output a Refresh Token.
3. Deploy to Railway (Cloud Hosting)
Push this repository to your GitHub account.
Sign in to Railway.app and create a New Project from your GitHub Repository.
In the Railway Dashboard for this service, navigate to Variables and add the following:
GOOGLE_CLIENT_ID: Your Client IDGOOGLE_CLIENT_SECRET: Your Client SecretGOOGLE_REFRESH_TOKEN: The Refresh Token generated in Step 2.API_KEY: Generate a secure random string (e.g., a UUID). This protects your server from unauthorized access!
Railway will automatically build and deploy the server. Once deployed, note the public Domain provided by Railway.
Integrating with AI Agents
Since this is an SSE-based server, your agent needs to connect to the /sse endpoint via HTTP, passing the API Key as a Bearer token.
For an MCP Client that supports SSE natively, configure it with:
URL:
https://your-railway-app-url.up.railway.app/sseHeaders:
{"Authorization": "Bearer YOUR_API_KEY"}
This server cannot be deployed
Maintenance
Related MCP Connectors
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Connect AI assistants to Google Sheets through controlled tools for reading and updating rows.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to send emails via Gmail and append text to Google Docs or local files.-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to send emails and append content to Google Docs using Gmail and Google Docs APIs.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to create Gmail drafts and append content to Google Docs, supporting automated review analysis and notification workflows.1,091 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely interact with Google Workspace services, including sending emails via Gmail and appending content to Google Docs.205 npmMIT