google-workspace-mcp

google-workspace-mcp

A unified MCP server for Google Workspace APIs providing tools for Chat, Gmail, and Calendar operations including messaging, email management, and event scheduling.

Category
Visit Server

README

Google Workspace MCP

A unified MCP server for Google Workspace APIs: Chat, Gmail, and Calendar.

Installation

npm install

Setup

The MCP handles authentication automatically via OpenCode:

  1. First Run: When OpenCode starts the MCP, it passes GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET via environment variables
  2. OAuth Flow: On first run, the server checks for tokens in ~/.local/share/opencode/mcp-auth.json
  3. If No Tokens: Server initiates OAuth flow (browser login)
  4. Subsequent Runs: Tokens are loaded automatically

No manual setup needed when running via OpenCode.

Manual Setup (if needed)

For testing outside OpenCode, set environment variables and run the server:

export GOOGLE_CLIENT_ID="your-client-id.apps.googleusercontent.com"
export GOOGLE_CLIENT_SECRET="your-secret-here"
node server.js

The server will detect missing tokens and initiate OAuth flow automatically.

Usage

The MCP provides 16 tools across 3 services:

Chat (4 tools)

  • chat_search_conversations — Search/list Google Chat spaces
  • chat_list_messages — Retrieve messages from a space or thread
  • chat_search_messages — Search messages by keywords, sender, time
  • chat_send_message — Send message to space or reply to thread

Gmail (6 tools)

  • gmail_list_messages — List emails with optional query
  • gmail_get_message — Retrieve full message details
  • gmail_search_messages — Search emails with Gmail syntax
  • gmail_send_message — Send new email
  • gmail_list_labels — List all labels and counts
  • gmail_modify_message — Add/remove labels from message

Calendar (6 tools)

  • calendar_list_events — List events in time range
  • calendar_get_event — Retrieve event details
  • calendar_create_event — Create new calendar event
  • calendar_update_event — Modify existing event
  • calendar_delete_event — Delete calendar event
  • calendar_find_free_slots — Find available time slots

Testing

npm run test

Tests require tokens to exist. Run npm run setup first if you haven't authenticated.

Configuration

The MCP is configured in opencode.jsonc:

{
  "mcp": {
    "google-workspace": {
      "type": "local",
      "command": ["node", "D:\\OneDrive\\Workspace\\google-workspace-mcp\\server.js"],
      "env": {
        "GOOGLE_CLIENT_ID": "your-client-id-here.apps.googleusercontent.com",
        "GOOGLE_CLIENT_SECRET": "your-secret-here"
      },
      "enabled": true
    }
  }
}

Both GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET must be set for OAuth to work.

Architecture

  • server.js — MCP dispatcher with all 16 tools (receives env from OpenCode)
  • services/ — Modular service implementations (Chat, Gmail, Calendar)
  • utils/ — Shared OAuth token management and HTTP client

Token Refresh

Tokens are automatically refreshed when:

  • Access token expires (< 60 seconds remaining)
  • A tool request is made

Refresh logic is transparent — no manual intervention needed.

See AGENTS.md for repository conventions, contribution guidance, and security notes.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured