Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables AI assistants to create, read, and modify Google Slides, Sheets, Docs, and Drive documents programmatically. Supports file management, content editing, and version history retrieval.

README.md

Google Workspace MCP Server

MCP server for Google Slides, Sheets, Docs, and Drive. Enables AI assistants to create, read, and modify Google Workspace documents programmatically.

Quick Start

npm install
npm run build
npm run get-token  # One-time OAuth setup
npm start

Configuration

Required Environment Variables

GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REFRESH_TOKEN=your_refresh_token

Optional Module Toggles

All modules enabled by default. Set to false to disable:

ENABLE_SHEETS=false
ENABLE_SLIDES=false
ENABLE_DOCS=false
ENABLE_REVISIONS=false

Drive tools are always enabled (core functionality).

Claude Code Configuration

Add to your MCP settings:

{
  "mcpServers": {
    "google-workspace-mcp": {
      "command": "node",
      "args": ["/path/to/google-workspace-mcp/build/index.js"],
      "env": {
        "GOOGLE_CLIENT_ID": "your_client_id",
        "GOOGLE_CLIENT_SECRET": "your_client_secret",
        "GOOGLE_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

Available Tools

Drive (always enabled)

| Tool | Description | |------|-------------| | create_folder | Create a folder in Google Drive | | list_files | List files/folders with filtering, pagination, and sorting. Supports Shared Drives. | | get_file | Get detailed metadata for a specific file (permissions, capabilities, owners) | | search_files | Search Drive using query syntax (e.g., name contains 'report') | | export_file | Export Google Docs/Sheets/Slides to PDF, text, CSV, docx, etc. |

Sheets

| Tool | Description | |------|-------------| | create_spreadsheet | Create a new spreadsheet | | get_spreadsheet | Get spreadsheet metadata | | get_sheet_values | Read cell values | | update_sheet_values | Write cell values | | batch_update_spreadsheet | Apply formatting/structural changes | | append_sheet_values | Append rows | | summarize_spreadsheet | Extract all data | | copy_sheet | Copy sheet between spreadsheets |

Slides

| Tool | Description | |------|-------------| | create_presentation | Create a new presentation | | get_presentation | Get presentation metadata | | batch_update_presentation | Apply updates to slides | | get_page | Get specific slide details | | summarize_presentation | Extract text from all slides |

Docs

| Tool | Description | |------|-------------| | create_document | Create a new document | | get_document | Get document content | | batch_update_document | Insert/delete/format text | | summarize_document | Extract text content |

Version History

| Tool | Description | |------|-------------| | list_revisions | List document version history | | get_revision | Get revision details with restore instructions |

Security

OAuth Scopes

This server requests the minimum scopes needed:

| Scope | Purpose | |-------|---------| | presentations | Create/edit Google Slides | | spreadsheets | Create/edit Google Sheets | | documents | Create/edit Google Docs | | drive.readonly | Browse, search, and read file metadata (including Shared Drives) | | drive.file | Export and manage files created by this app |

What This Server CAN Access

  • All Slides presentations in your account
  • All Sheets spreadsheets in your account
  • All Docs documents in your account
  • Drive file metadata, browsing, and search (including Shared Drives)
  • Export Google Workspace files to other formats (PDF, text, CSV, etc.)

What This Server CANNOT Access

  • Gmail, Calendar, or other Google services
  • Delete or permanently modify files you don't own
  • Your Google account password or 2FA settings

Security Best Practices

  1. Never commit .env files to version control
  2. Use a dedicated Google Cloud project for this server
  3. Review access at Google Account Permissions
  4. Regenerate tokens with npm run get-token if compromised

OAuth Setup

1. Enable APIs

In Google Cloud Console:

  1. Create or select a project
  2. Enable: Slides API, Sheets API, Docs API, Drive API

2. Create Credentials

  1. Go to APIs & Services > Credentials
  2. Create OAuth client ID (Desktop app type)
  3. Download client ID and secret

3. Configure Consent Screen

Add these scopes:

  • https://www.googleapis.com/auth/presentations
  • https://www.googleapis.com/auth/spreadsheets
  • https://www.googleapis.com/auth/documents
  • https://www.googleapis.com/auth/drive.readonly
  • https://www.googleapis.com/auth/drive.file

4. Generate Refresh Token

# Add client ID and secret to .env first
npm run get-token

The refresh token is generated once and stored. Regenerate only if:

  • You change OAuth scopes
  • You revoke access from your Google account
  • You need to use a different account

Troubleshooting

"Request had insufficient authentication scopes"

  1. Verify all 5 scopes are in your OAuth consent screen
  2. Regenerate token: npm run get-token
  3. Restart the MCP server

"API has not been used in project"

Enable the missing API in Google Cloud Console. The error message includes a direct link.

One service works but another doesn't

The token was generated without all scopes. Add missing scopes to consent screen and regenerate with npm run get-token.

Development

npm install          # Install dependencies
npm run build        # Compile TypeScript
npm run lint         # Run ESLint
npm test             # Run tests
npm run get-token    # Generate OAuth token

Testing with MCP Inspector

export $(cat .env | xargs) && npx @modelcontextprotocol/inspector node build/index.js

License

ISC

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Files & Docs servers.