google-docs-mcp-server

Crates.iogoogle-docs-mcp-server
lib.rsgoogle-docs-mcp-server
version0.1.1
created_at2026-01-04 12:28:02.547379+00
updated_at2026-01-04 21:34:03.319211+00
descriptionMCP server for Google Docs API integration with service account authentication
homepage
repository
max_upload_size
id2021834
size110,980
Katsuhiro Honda (katsuhirohonda)

documentation

README

Google Docs MCP Server

A Rust-based Model Context Protocol (MCP) server for Google Docs API integration using Service Account authentication.

Features

  • Read Documents: Retrieve document content and metadata
  • Update Documents: Modify documents with insert, delete, and replace operations
  • Service Account Auth: Secure authentication using Google Service Account credentials

Prerequisites

  1. A Google Cloud Project
  2. Google Docs API enabled
  3. A Service Account with appropriate permissions
  4. Service Account JSON key file

Setup

1. Create a Service Account

  1. Go to Google Cloud Console
  2. Create or select a project
  3. Enable the Google Docs API:
    • Go to APIs & Services > Library
    • Search for and enable Google Docs API
  4. Go to IAM & Admin > Service Accounts
  5. Create a new service account
  6. Download the JSON key file

2. Grant Document Access

For the service account to access documents:

  • Share documents with the service account email (found in the JSON key file as client_email)
  • Or use Google Workspace domain-wide delegation for organization-wide access

3. Build the Server

cargo build --release

Usage

Environment Variables

Set the path to your service account JSON key file:

export GOOGLE_SERVICE_ACCOUNT_KEY=/path/to/service-account.json

Running the Server

./target/release/google-docs-mcp-server

Claude Code Configuration

Add to your Claude Code MCP settings:

{
  "mcpServers": {
    "google-docs": {
      "command": "/path/to/google-docs-mcp-server",
      "env": {
        "GOOGLE_SERVICE_ACCOUNT_KEY": "/path/to/service-account.json"
      }
    }
  }
}

Tools

google_docs_get_document

Retrieve a Google Document by ID.

Parameters:

  • document_id (required): The document ID
  • response_format (optional): "markdown" (default) or "json"

google_docs_update_document

Update a Google Document with various operations.

Parameters:

  • document_id (required): The document ID
  • requests (required): Array of update operations
  • response_format (optional): "markdown" (default) or "json"

Update Operations:

{
  "insert_text": {
    "text": "Hello World",
    "index": 1
  }
}
{
  "delete_content_range": {
    "start_index": 1,
    "end_index": 10
  }
}
{
  "replace_all_text": {
    "find_text": "old text",
    "replace_text": "new text",
    "match_case": true
  }
}

License

MIT

Commit count: 0

cargo fmt