Gmail & Google Docs MCP Server
Allows to send emails via your Gmail account.
Allows to append text to your Google Docs documents.
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., "@Gmail & Google Docs MCP ServerSend an email to sarah@example.com saying 'Lunch at 1?'"
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.
Gmail & Google Docs MCP Server
This Model Context Protocol (MCP) server allows AI assistants to:
Send emails via your Gmail account.
Append text to your Google Docs or local files.
Setup Instructions
1. Install Dependencies
In this directory, install the required Python packages:
pip3 install -r requirements.txt2. Get Google OAuth Credentials
To use the Google APIs, you need to create a project in Google Cloud Console and download an OAuth client ID:
Go to the Google Cloud Console.
Create a new project.
Enable the following APIs for your project:
Gmail API
Google Docs API
Go to APIs & Services > OAuth consent screen. Configure the consent screen (choose "External" if you are a regular Gmail user, or "Internal" if you are on Google Workspace). You must add your email as a test user if the app is in Testing mode.
Go to APIs & Services > Credentials.
Click Create Credentials > OAuth client ID.
Choose Desktop app as the application type.
Click Create and then download the JSON file.
Rename the downloaded file to
credentials.jsonand place it in this directory (/Users/aparanaraghuvanshi/Mcp server/gmail-docs-mcp).
3. Generate the Token
Before the MCP server can run headless, you need to authenticate once:
python3 auth_setup.pyThis will open a browser window asking you to log into your Google account and grant permissions. Once completed, a token.json file will be created in this directory.
4. Configuring your AI Client (Claude Desktop / Cursor)
For Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"gmail-docs": {
"command": "python3",
"args": ["/Users/aparanaraghuvanshi/Mcp server/gmail-docs-mcp/server.py"]
}
}
}(Make sure to replace python with the absolute path to your python executable if you are using a virtual environment).
For Cursor
Go to Cursor Settings > Features > MCP, and add a new MCP server:
Type:
commandName:
gmail-docs-mcpCommand:
python3 "/Users/aparanaraghuvanshi/Mcp server/gmail-docs-mcp/server.py"
Related MCP server: MCP Server for Gmail & Google Docs
Deployment (Railway)
To host this MCP Server in the cloud 24/7, you can deploy it to Railway.
Push to GitHub: Commit this entire folder to a private GitHub repository.
Deploy on Railway:
Go to Railway, click New Project -> Deploy from GitHub repo.
Select your repository.
Configure Persistent Volume:
In your Railway project, go to Settings -> Volumes.
Click Add Volume and set the Mount Path to
/app/data.
Authenticate in Production:
Your initial deploy will fail because
credentials.jsonis missing.Go to the Terminal tab of your service in the Railway dashboard.
Run
cd /app/data.Upload or create your
credentials.jsonhere (e.g.cat > credentials.jsonand paste your JSON, then pressCtrl+D).Run
python3 /app/auth_setup.py. Follow the link to authenticate.A
token.jsonwill be saved to/app/data.
Connect Client to Cloud: Instead of using a local command, configure your AI Client (Cursor/Claude) to connect via Server-Sent Events (SSE) using the URL provided by Railway (e.g.,
https://your-app.up.railway.app/sse).
Usage
Once connected, your AI assistant will have access to:
send_gmail(to, subject, body)append_to_doc(document_id_or_path, content_to_append)
This server cannot be deployed
Maintenance
Related MCP Connectors
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
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…
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to send emails and append content to Google Docs using Gmail and Google Docs APIs.-
- FlicenseNot gradedqualityBmaintenanceEnables sending and drafting emails via Gmail and appending content to Google Docs through natural language commands.-
- 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 send emails via Gmail and append text to Google Docs through the Model Context Protocol.205 npmMIT