Skip to content

feat: add MCP server for Google Workspace#365

Open
howardpen9 wants to merge 1 commit intogoogleworkspace:mainfrom
howardpen9:feat/mcp-server
Open

feat: add MCP server for Google Workspace#365
howardpen9 wants to merge 1 commit intogoogleworkspace:mainfrom
howardpen9:feat/mcp-server

Conversation

@howardpen9
Copy link

Summary

Adds a TypeScript MCP (Model Context Protocol) server that wraps the gws CLI, enabling any MCP-compatible client (Claude Desktop, Cursor, Zed, Windsurf, etc.) to interact with Google Workspace APIs as tools.

Motivation

The gws CLI already has structured JSON output and 100+ commands — a perfect fit for MCP tools. Currently there's no good Google Workspace MCP server in the ecosystem. This bridges that gap by wrapping gws rather than reimplementing API calls, so all existing features (auth, pagination, dry-run, Model Armor) work automatically.

What's included

Tools (17 total)

Per-service tools — one for each Workspace service:

  • gws_drive, gws_gmail, gws_calendar, gws_sheets, gws_docs, gws_slides, gws_tasks, gws_people, gws_chat, gws_classroom, gws_forms, gws_keep, gws_meet, gws_admin_reports

Utility tools:

  • gws_run — run any arbitrary gws command (escape hatch)
  • gws_schema — introspect API method schemas for discovery
  • gws_auth_status — check authentication state

Resources

  • gws://services — list all available services

Architecture

MCP Client (Claude Desktop, etc.) ←→ MCP Server (stdio) → gws CLI → Google APIs

The server shells out to gws rather than calling Google APIs directly. Benefits:

  • Auth is fully handled by gws (no extra credential management)
  • All gws features work: pagination, dry-run, Model Armor sanitization
  • Stays in sync — when gws adds APIs, gws_run covers them immediately

Usage

{
  "mcpServers": {
    "google-workspace": {
      "command": "npx",
      "args": ["-y", "@googleworkspace/mcp-server"]
    }
  }
}

Checklist

  • Changeset included
  • TypeScript compiles cleanly
  • Server starts and runs on stdio
  • README with setup instructions
  • No external dependencies beyond @modelcontextprotocol/sdk

Adds a TypeScript MCP (Model Context Protocol) server that wraps the
gws CLI, enabling any MCP client (Claude Desktop, Cursor, Zed, etc.)
to interact with Google Workspace APIs as tools.

Features:
- Per-service tools (gws_drive, gws_gmail, gws_calendar, etc.)
- Schema introspection tool for API discovery
- Generic gws_run tool for advanced commands
- Auth status check tool
- Services resource listing

The server delegates to the gws binary via exec, so all existing
features (auth, pagination, dry-run, Model Armor) work out of the box.
@google-cla
Copy link

google-cla bot commented Mar 10, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2026

🦋 Changeset detected

Latest commit: a70cc3f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant