Google Workspace MCP Server
Allows creating draft emails in Gmail.
Allows appending content to Google Documents.
Click on "Install 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 ServerCreate a draft email to manager@acme.com summarizing the latest product reviews."
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 Model Context Protocol (MCP) server that enables AI agents to interact with Google Workspace — specifically Gmail (draft emails) and Google Docs (append content).
Primary Use Case: Review Analysis Pipeline
An AI agent collects product reviews, normalizes ratings to a 5-point scale, performs sentiment analysis, and uses this MCP server to:
Append the full analysis report to a Google Doc
Draft a summary notification email via Gmail
Related MCP server: Gmail & Google Docs MCP Server
Quick Start
Prerequisites
Node.js 18+ installed
A Google Cloud project with Gmail API and Google Docs API enabled
OAuth 2.0 Client ID credentials (Desktop application type)
1. Clone & Install
git clone https://github.com/<your-username>/google-workspace-mcp.git
cd google-workspace-mcp
npm install2. Configure Environment
cp .env.example .envEdit .env and add your Google OAuth credentials:
GOOGLE_CLIENT_ID="your-client-id-here"
GOOGLE_CLIENT_SECRET="your-client-secret-here"3. Build
npm run build4. Run Locally (Stdio — for local MCP clients)
npm startOn first run, the server will print an authorization URL. Open it in your browser, sign in with your Google account, and grant the requested permissions. A token.json file will be created automatically.
5. Run as HTTP Server (for Railway / remote deployment)
npm run start:httpThis starts an Express server with Streamable HTTP transport on port 3000.
Connect to an MCP Client
Claude Desktop (Local — Stdio)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"google-workspace": {
"command": "node",
"args": ["<path-to-project>/build/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id",
"GOOGLE_CLIENT_SECRET": "your-client-secret"
}
}
}
}Claude Desktop (Remote — Railway)
{
"mcpServers": {
"google-workspace": {
"url": "https://<your-app>.up.railway.app/mcp",
"transport": "streamable-http"
}
}
}Available Tools
Tool | Description | Arguments |
| Create a draft email in Gmail |
|
| Append text to a Google Document |
|
Deploy to Railway
Push this repo to GitHub
Go to railway.app → New Project → Deploy from GitHub Repo
Set environment variables in Railway dashboard:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_OAUTH_TOKEN(paste contents of your localtoken.json)
Railway will auto-build and deploy using
railway.jsonconfig
See deploymentplan.md for detailed deployment instructions.
Google Cloud Setup
Go to Google Cloud Console
Create a new project (or select existing)
Enable Gmail API and Google Docs API
Go to Credentials → Create Credentials → OAuth Client ID
Application type: Desktop application
Download the credentials and copy
Client IDandClient Secretto.envConfigure the OAuth consent screen (add test users if in testing mode)
Project Structure
google-workspace-mcp/
├── src/
│ ├── index.ts # MCP server entry point (Stdio transport — local)
│ ├── server.ts # MCP server entry point (HTTP transport — Railway)
│ ├── auth.ts # OAuth 2.0 authentication & token caching
│ ├── gmail.ts # Gmail draft creation
│ └── docs.ts # Google Docs content appending
├── .env.example # Environment variable template
├── railway.json # Railway deployment configuration
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This fileSecurity Notes
Tokens are local:
token.jsonis stored locally and never committedDrafts only: Emails are saved as drafts — the user must manually send
Scoped access: Only requests
gmail.composeanddocumentsscopesNo data sent to AI: All auth is handled server-side
License
ISC
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/aryaprashant23/MCP_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server