Skip to main content
Glama
sahildhurat

Google Workspace MCP Server

by sahildhurat

Google Workspace MCP Server (Gmail + Google Docs)

A Model Context Protocol (MCP) server that exposes Google Workspace capabilities — specifically Gmail and Google Docs — as standardized MCP tools.

Features

  • send_email: Send an email immediately via the authenticated Gmail account.

  • draft_email: Create a draft in the authenticated Gmail account without sending.

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

Related MCP server: Generic MCP Server for Google Workspace

Setup Instructions

1. Google Cloud Project Setup

  1. Go to the Google Cloud Console.

  2. Create a new project or select an existing one.

  3. Navigate to APIs & Services > Library.

  4. Search for and enable the Gmail API and Google Docs API.

  5. Navigate to APIs & Services > OAuth consent screen.

    • Configure the consent screen (External or Internal).

    • Add the following scopes:

      • https://www.googleapis.com/auth/gmail.send

      • https://www.googleapis.com/auth/gmail.compose

      • https://www.googleapis.com/auth/documents

    • Add your email address as a Test User if your app is in testing mode.

  6. Navigate to APIs & Services > Credentials.

    • Click Create Credentials > OAuth client ID.

    • Choose Desktop app as the application type.

    • Click Create.

    • Download the JSON file and rename it to credentials.json. Place it in the root of this project.

2. Environment Setup

  1. Copy .env.example to .env (optional, as defaults are used if not provided).

  2. Install the project dependencies:

    pip install -e .

3. First Run (Authentication)

Before an MCP client can use the server, you must authenticate it manually to generate the token.json file.

Run the server directly:

gmail-docs-mcp

This will open a browser window asking you to log in with your Google account and grant the requested permissions. Once completed, a token.json file will be created. You can then stop the server (Ctrl+C).

4. MCP Client Configuration

Configure your MCP client (e.g., Claude Desktop) to run this server. Add the following to your MCP client's configuration file:

{
  "mcpServers": {
    "google-workspace": {
      "command": "gmail-docs-mcp",
      "env": {
        "GOOGLE_CREDENTIALS_PATH": "/absolute/path/to/credentials.json",
        "GOOGLE_TOKEN_PATH": "/absolute/path/to/token.json"
      }
    }
  }
}

Note: Make sure to use absolute paths for the credentials and token files.

Testing

Run unit tests with pytest:

pip install -e ".[dev]"
pytest

Manual Smoke-Test Checklist

  1. Send test email: Invoke send_email with your own email address to verify receipt.

  2. Create draft: Invoke draft_email and check your Gmail Drafts folder.

  3. Append to a doc: Create a test Google Doc, copy its URL or ID, and invoke append_to_google_doc. Check the document to verify the text was appended at the end.

Available Tools

3 tools
append_to_google_docB

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

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes
document_idYes
leading_newlineNo
add_timestamp_headingNo

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description only indicates a write operation but omits details like authentication, error cases, and parameter effects (e.g., leading_newline, add_timestamp_heading). Insufficient for full transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but fails to convey essential usage details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters and no annotations, the description is severely incomplete, missing parameter semantics, return values, and behavioral notes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description adds no explanation of parameters (content, document_id, leading_newline, add_timestamp_heading) beyond their names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific verb 'Append' and the resource 'Google Doc', and it distinguishes from sibling email tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies using this tool when needing to add text to a document. Siblings are unrelated (email tools), so no confusion, but no explicit when-not-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

draft_emailB

Create a draft in the authenticated Gmail account without sending.

ParametersJSON Schema
NameRequiredDescriptionDefault
ccNo
toYes
bccNo
bodyYes
subjectYes
body_typeNoplain

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description only states it creates a draft without sending, but omits important behavioral details such as permission requirements, draft storage, or conflict handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with the action and outcome, no redundant words. Efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters and no output schema or annotations, the description is too brief. It does not cover how drafts are stored, how to send later, or what the return value is, leaving significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds no information about the parameters (to, cc, bcc, etc.), leaving the agent to rely solely on parameter names which may not convey format or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Create a draft' with the specific resource 'in the authenticated Gmail account', and distinguishes from sibling tools like 'send_email' by adding 'without sending'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'without sending' implies not to use this tool when sending is intended, but lacks explicit when-to-use, prerequisites, or alternatives compared to siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

send_emailB

Send an email immediately via the authenticated Gmail account.

ParametersJSON Schema
NameRequiredDescriptionDefault
ccNo
toYes
bccNo
bodyYes
subjectYes
body_typeNoplain

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only states 'send an email immediately', which is minimal. It lacks details on authentication requirements, rate limits, error handling, or confirmation of sending. The description is insufficient for full behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that front-loads the key action ('Send an email immediately'). Every word is meaningful with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 6 parameters (3 required) and no output schema, the description is too brief. It does not explain return values, error states, or how to properly structure inputs like 'to' or 'body'. This incomplete context makes it harder for an agent to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage for its 6 parameters, and the tool description provides no additional explanation for any parameter. The meaning of fields like 'body_type' or the format of email addresses is not clarified. This severely hampers correct parameter usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool sends an email immediately via the authenticated Gmail account. The verb 'send' and resource 'email' are precise, and the mention of Gmail distinguishes it from siblings like 'append_to_google_doc' and 'draft_email'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for sending versus drafting (via 'immediately'), but does not explicitly state when to use this tool over 'draft_email' or when not to use it. No prerequisites or alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedappend_to_google_doc
    • First observeddraft_email
    • First observedsend_email

TDQS

B3.2/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: append_to_google_doc targets Google Docs, while draft_email and send_email target Gmail with different actions (create draft vs send). No overlap exists between the three tools.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern using snake_case: append_to_google_doc, draft_email, send_email. The pattern is predictable and uniform across the set.

Tool Count2/5

At 3 tools for a 'Google Workspace MCP Server,' the count feels too low. The server name suggests broader coverage of multiple Google Workspace services, but only Docs (append) and Gmail (draft/send) are represented, making the scope overly narrow.

Completeness1/5

The toolset is severely incomplete for Google Workspace. Key operations like creating or reading Google Docs, listing emails, managing labels, or handling attachments are missing. Agents cannot perform basic CRUD workflows for either Docs or Gmail.

Related MCP Connectors

  • Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.

  • Permissioned access to Gmail, Drive and Calendar via the user's own Google account

  • Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.

  • Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.

Related MCP Servers