Skip to main content
Glama
n21jindal-maker

MCP Google Workspace Server

MCP Google Workspace Server

A generic Model Context Protocol (MCP) server that enables AI agents to interact with Gmail and Google Docs through well-defined MCP tools.

The primary goal of this project is to provide a reusable integration layer so that any MCP-compatible AI agent can perform email and Google Docs operations without implementing Gmail or Google Docs APIs themselves.

Features

The server currently supports the following capabilities exposed as MCP tools:

Gmail

  • gmail_draft_email: Draft an email in the authenticated user's Gmail account.

  • gmail_send_email: Send an email directly using the authenticated user's Gmail account.

Google Docs

  • google_docs_append: Append text content to the end of an existing Google Doc.

Related MCP server: Google Services MCP Server

Prerequisites

  • Node.js (v18 or higher recommended)

  • Google Cloud Platform account

  • Gmail API and Google Docs API enabled in your GCP project

  • OAuth 2.0 Client credentials (Desktop application type)

Installation

  1. Clone the repository:

    git clone https://github.com/n21jindal-maker/MCP-Server.git
    cd MCP-Server
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build

Configuration & Authentication

The server uses Google OAuth 2.0 for authentication. You need to set up your credentials before running the server.

  1. Obtain your OAuth 2.0 Client ID and Secret from the Google Cloud Console.

  2. Save your credentials as Credentials.json in the root directory, or configure the environment variables as shown in .env.example.

  3. Generate the OAuth token:

    npx tsx generate-token.ts

    Follow the prompts to authorize the application. This will generate a token.json file.

Running the Server

Start the server using:

npm start

Or for development (with automatic TypeScript compilation):

npm run dev

Using with an MCP Client

Configure your MCP client to start this server. The server communicates over stdio.

Example configuration for Claude Desktop or similar MCP clients:

{
  "mcpServers": {
    "google-workspace": {
      "command": "node",
      "args": ["/absolute/path/to/MCP-Server/dist/index.js"]
    }
  }
}

Available Tools

gmail_draft_email

Drafts an email but does not send it.

  • Parameters:

    • to (string[]): One or more recipient email addresses.

    • subject (string): Email subject.

    • body (string): Email body.

gmail_send_email

Sends an email immediately.

  • Parameters:

    • to (string[]): One or more recipient email addresses.

    • subject (string): Email subject.

    • body (string): Email body.

google_docs_append

Appends content to a Google Doc.

  • Parameters:

    • documentId (string): The ID of the Google Doc (found in the URL).

    • content (string): Text content to append.

License

MIT

Related MCP Connectors

Related MCP Servers