google-connections-mcp
Allows reading, sending, searching, labeling, archiving, and managing Gmail messages.
Allows listing, creating, updating, and deleting events across all Google Calendars.
Allows creating documents, reading and editing content, and formatting (bold, italic, fonts, headings, bullets, margins).
Allows searching, listing folders, creating, moving, renaming, deleting, sharing, copying files, and downloading content.
Provides full spreadsheet control with flexible row/column addressing, cell-level operations, and worksheet management including querying, updating, and merging.
Allows managing tasks and task lists, including creation, updating, deleting, completing, and starring tasks.
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-connections-mcpCreate a new Google Doc titled 'Meeting Notes'"
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 Connections MCP
A Model Context Protocol (MCP) server that provides AI assistants with access to Google Workspace APIs. Deploy once on Railway (or any hosting platform), connect from Claude or any MCP-compatible client.
Features
Google Sheets - Full spreadsheet control with flexible row/column addressing (by header name or column letter), cell-level operations, and worksheet management
Google Calendar - List, create, update, and delete events across all your calendars
Gmail - Read, send, search, label, archive, and manage messages
Google Tasks - Full task and task list management
Google Drive - Search, list folders, create/move/rename/delete/share/copy files, download content
Google Docs - Create documents, read/edit content, formatting (bold, italic, fonts, headings, bullets, margins)
Time - Get current date/time in any IANA timezone
How It Works
You deploy this server to Railway (or similar)
You set up OAuth credentials in Google Cloud Console
You authorize with your Google account once
Your AI assistant connects to the server and can access your Google services
Each user deploys their own instance with their own credentials - your data stays yours.
Quick Start
Prerequisites
Python 3.10+
A Google Cloud project with OAuth 2.0 credentials
Railway account (free tier works) or another hosting platform
Claude.ai account (or another MCP-compatible client)
1. Google Cloud Setup
Go to Google Cloud Console
Create a new project (e.g., "My MCP Server")
Enable these APIs (APIs & Services → Enable APIs):
Google Calendar API
Gmail API
Google Drive API
Google Sheets API
Google Tasks API
Configure OAuth consent screen (APIs & Services → OAuth consent screen):
User Type: External
App name: Whatever you want (e.g., "My Google Connections")
User support email: Your email
Developer contact: Your email
Scopes: Add the following:
https://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/spreadsheetshttps://www.googleapis.com/auth/tasks
Test users: Add your email
Important: Click "Publish App" to move from Testing to Production (this prevents tokens from expiring every 7 days)
Create OAuth 2.0 credentials (APIs & Services → Credentials):
Click "Create Credentials" → "OAuth client ID"
Application type: Web application
Name: Whatever you want
Authorized redirect URIs:
https://your-app-name.up.railway.app/oauth/callback(Use your actual Railway URL - you'll get this after deploying)Click "Create" and download the JSON file
2. Deploy to Railway
Fork this repository to your GitHub account
Go to Railway and create a new project
Choose "Deploy from GitHub repo" and select your fork
Railway will auto-detect the Python app and start deploying
Go to Settings → Networking → Generate Domain (note this URL)
Go back to Google Cloud and update your OAuth redirect URI with the actual Railway URL
Add environment variables in Railway (Settings → Variables):
GOOGLE_CREDENTIALS = (paste the entire contents of your downloaded OAuth JSON file)Trigger a redeploy after adding the environment variable
3. Authorize Your Google Account
Visit
https://your-railway-url/oauth/startin your browserSign in with Google and grant permissions
You'll see a success message
Check Railway logs - you'll see the token JSON printed there
Important: Format the token correctly (see below)
Add it as environment variable:
GOOGLE_TOKEN_JSONRedeploy one more time
Formatting the Token JSON
Railway logs wrap the token in extra metadata. You need to extract just the token data.
What Railway logs show:
{
"message": "",
"attributes": {
"token": "ya29.a0ARrdaM...",
"refresh_token": "1//0eXy...",
"token_uri": "https://oauth2.googleapis.com/token",
"client_id": "12345...apps.googleusercontent.com",
"client_secret": "GOCSPX-...",
"scopes": ["https://www.googleapis.com/auth/calendar", ...],
"expiry": "2025-12-15T12:00:00Z"
},
"tags": { ... },
"timestamp": "2025-12-15T..."
}What you need to paste (extract from attributes):
{"token": "ya29.a0ARrdaM...", "refresh_token": "1//0eXy...", "token_uri": "https://oauth2.googleapis.com/token", "client_id": "12345...apps.googleusercontent.com", "client_secret": "GOCSPX-...", "scopes": ["https://www.googleapis.com/auth/calendar", ...], "expiry": "2025-12-15T12:00:00Z"}Quick method: Copy the Railway log output, paste it to Claude or ChatGPT, and ask: "Extract just the token JSON from this Railway log output and format it on one line."
4. Connect to Claude
In Claude.ai, go to Settings → Connections
Add a new MCP connection:
URL:
https://your-railway-url/sse
The connection should show as active
You're done! Claude can now access your Google services.
Available Tools
Google Sheets
All Sheets tools support a mode parameter: "header" (default) uses column header names, "letter" uses column letters (A, B, C...).
Tool | Description |
| Query with filters, sorting, column selection. Supports date comparisons. |
| Get complete row(s) by row number or unique ID lookup |
| Get cell value(s) by A1 notation (e.g., "A1", "B5") |
| Get all values in a column with row numbers (for easy update_cells follow-up) |
| Find row number(s) by searching a column for a value |
| Update specific cells in existing row(s) by row number or unique ID |
| Update cell(s) directly by A1 notation - the core write primitive |
| Append new row(s) to the end of the sheet |
| Insert row at specific position (shifts existing rows down) |
| Delete row(s) by row number or unique ID lookup |
| Insert column at position (shifts right) or append to first empty if no position given |
| Delete a column by header name or letter |
| Create a new Google Sheets document with optional worksheets |
| Add a new worksheet (tab) to an existing spreadsheet |
| Delete a worksheet from a spreadsheet |
| List all worksheets in a spreadsheet with their properties |
| Rename a worksheet |
| Get spreadsheet metadata (title, URL, all worksheets) |
| Clear cell contents in a range without deleting rows/columns |
| Sort entire worksheet by a column |
| Copy a worksheet to the same or a different spreadsheet |
| Merge a range of cells into one |
| Unmerge previously merged cells |
| Freeze rows and/or columns (headers stay visible while scrolling) |
Query Operators: ==, !=, >, <, >=, <=, in, not in, contains, not contains, is_null, not_null
Date Handling: Date columns are automatically parsed and compared correctly. Use == with full date strings (e.g., 1/27/2026 or 2026-01-27) for exact matching. Avoid contains for dates as it does substring matching.
Row Identification: Tools that modify rows accept either {"row": 6} for direct row numbers, or {"unique_id_column": "ID", "unique_id_value": "abc123"} for lookup-based identification.
Google Calendar
Tool | Description |
| List all calendars |
| List events with time range and search |
| Get specific event details |
| Create new event with optional attendees/reminders/timezone |
| Modify existing event |
| Remove event |
Timezone: create_calendar_event and update_calendar_event accept an optional timezone parameter (IANA format, e.g., 'America/New_York', 'Europe/London', 'UTC'). If omitted, uses the calendar's default timezone.
Gmail
Tool | Description |
| Search/list messages with Gmail query syntax |
| Get full message content |
| Send email (with CC/BCC support) |
| Add/remove labels |
| Bulk label operations |
| Mark messages as read/unread |
| Star/unstar messages |
| Archive messages |
| Move messages back to inbox |
| Move to trash |
| Mark as spam |
| List all labels |
| Create new label |
Google Tasks
Tool | Description |
| List all task lists |
| Manage task lists |
| List tasks (with completed/hidden options) |
| Get task details |
| Create task with notes, due date, parent task |
| Modify task |
| Mark complete |
| Remove task |
| Move between lists |
| Star/unstar tasks |
| Clear completed from list |
Google Drive
Tool | Description |
| Search files by query (name, type, etc.) |
| Get file metadata |
| Download and return file content |
| List contents of a folder (simpler than search) |
| Create a new folder |
| Move a file to a different folder |
| Rename a file or folder |
| Delete/trash a file or folder |
| Share a file with another user |
| Create a copy of a file |
Download supports:
Text files → returns text content
PDFs → extracts and returns text (requires PyMuPDF)
Google Docs → exports as plain text
Google Sheets → exports as CSV
Google Slides → exports as plain text
Images → returns base64-encoded data
File operations:
delete_filemoves to trash by default; usepermanent=Trueto delete forevershare_filesupports roles:reader,commenter,writercopy_filecannot copy folders, only files
Google Docs
Tool | Description |
| Create a new Google Doc with optional initial content and folder placement |
| Get document content as plain text with structure info |
| Append text to the end of a document |
| Insert text at a specific index position |
| Find and replace all occurrences of text |
| Delete a range of content by start/end index |
| Remove excessive empty lines/paragraphs (configurable threshold) |
| Apply text formatting by index range (bold, italic, underline, font size, colors) |
| Find text and apply formatting (easier - no indices needed) |
| Apply paragraph formatting: alignment, line spacing, space above/below, indentation |
| Add bullet or numbered list formatting to paragraphs |
| Remove bullet/list formatting from paragraphs |
| Apply heading styles (Heading 1-6 or normal text) |
| Set page margins (top, bottom, left, right in inches) |
| Get detailed document structure with index positions for each element |
| Add a hyperlink to existing text (requires indices) |
| Find text and make it a hyperlink (easier - no indices needed) |
| Insert an image from a URL |
| Create a table with specified rows and columns |
| Insert a page break |
Index positions: Google Docs uses 1-based indexing. Use get_doc_structure to see each paragraph with its start/end indices for precise formatting.
Bullet presets: BULLET_DISC_CIRCLE_SQUARE (default), BULLET_CHECKBOX, NUMBERED_DECIMAL_ALPHA_ROMAN, NUMBERED_DECIMAL_NESTED, and more.
Utility
Tool | Description |
| Get current date/time for any IANA timezone |
Local Development
# Clone the repository
git clone https://github.com/michaelzrork/google-connections-mcp.git
cd google-connections-mcp
# Install uv if you don't have it
pip install uv
# Install dependencies
uv sync
# Set environment variables
export GOOGLE_CREDENTIALS='{"web":{"client_id":"..."}}'
export GOOGLE_TOKEN_JSON='{"token":"...","refresh_token":"..."}'
# Run the server
python -m google_connections_mcp.serverThe server runs on port 8000 by default (or $PORT if set).
Environment Variables
Variable | Required | Description |
| Yes | OAuth client configuration JSON from Google Cloud Console |
| Yes* | User authorization token (obtained via |
| No | Server port (default: 8000) |
*Not required for initial deploy - you'll add this after authorizing.
Endpoints
Endpoint | Description |
| MCP SSE connection endpoint (what Claude connects to) |
| MCP message handling |
| Begin OAuth authorization flow |
| OAuth callback handler |
| Health check (returns auth status) |
Troubleshooting
"Token expired" or constant reauthorization
Make sure you've published your OAuth app to Production in Google Cloud Console. Testing mode tokens expire every 7 days.
Can't connect from Claude
Check that your Railway deployment is running (
/healthendpoint should return{"status": "ok"})Verify the URL is correct (should end in
/sse)Check Railway logs for errors
OAuth callback fails
Make sure your redirect URI in Google Cloud Console exactly matches your Railway URL
The URL should be
https://(nothttp://)Include the full path:
https://your-app.up.railway.app/oauth/callback
PDF text extraction not working
PyMuPDF should be included in dependencies. Check that your deployment includes it. PDFs will fall back to base64 if text extraction fails.
Architecture
This server uses:
FastMCP for MCP protocol handling
gspread for Google Sheets
google-api-python-client for other Google APIs
PyMuPDF for PDF text extraction
Starlette for HTTP/SSE transport
uv for fast dependency management
Known Limitations
Images from Drive: Returned as base64. AI assistants need to decode and save locally to view.
Large files: Very large files may timeout. Consider using
get_drive_filefor metadata and accessing viawebViewLinkinstead.Google Workspace files: Docs/Sheets/Slides are exported to text/CSV, not native format.
License
MIT
Contributing
Issues and pull requests welcome!
Author
This server cannot be installed
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
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/michaelzrork/google-connections-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server