Skip to main content

MCP server for creating Google Docs from Markdown with full formatting

Project description

mcp-gdocs

License: MIT

MCP server for creating Google Docs from Markdown with full formatting support. Designed for AI agents — any MCP-compatible client (Claude Code, Claude Desktop, etc.) can create, update, and search Google Docs.

Tools

Tool Description
markdown_to_gdoc Convert Markdown to a Google Doc, get back a URL
update_google_doc Update existing Google Doc with new Markdown content
list_google_docs Search your Google Docs by name

Supported Markdown

  • Headings (h1-h4)
  • Bold, italic, inline code
  • Bullet lists (nested)
  • Tables with headers
  • Links

Prerequisites

  1. Python 3.10+
  2. Google Cloud project with these APIs enabled:
  3. OAuth 2.0 credentials (Desktop app type) — download from Google Cloud Console

Installation

# Clone the repository
git clone https://github.com/Baho73/mcp-gdocs.git
cd mcp-gdocs

# Create virtual environment and install
python -m venv .venv
.venv/Scripts/activate  # Windows
# source .venv/bin/activate  # Linux/Mac

pip install -e .

Setup

1. Add Google OAuth credentials

mkdir credentials
cp /path/to/your/client_secret.json credentials/client_secret.json

2. Authenticate (first run)

python -m mcp_gdocs.server

This opens a browser for Google OAuth consent. After authorization, the token is cached in credentials/token.json.

3. Add to Claude Code

claude mcp add mcp-gdocs -- /path/to/mcp-gdocs/.venv/Scripts/python -m mcp_gdocs.server

Or add to .claude.json manually:

{
  "mcpServers": {
    "mcp-gdocs": {
      "type": "stdio",
      "command": "/path/to/mcp-gdocs/.venv/Scripts/python",
      "args": ["-m", "mcp_gdocs.server"],
      "env": {
        "GDOCS_CREDENTIALS_PATH": "/path/to/credentials/client_secret.json",
        "GDOCS_TOKEN_PATH": "/path/to/credentials/token.json"
      }
    }
  }
}

4. Add to Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-gdocs": {
      "command": "/path/to/mcp-gdocs/.venv/Scripts/python",
      "args": ["-m", "mcp_gdocs.server"],
      "env": {
        "GDOCS_CREDENTIALS_PATH": "/path/to/credentials/client_secret.json",
        "GDOCS_TOKEN_PATH": "/path/to/credentials/token.json"
      }
    }
  }
}

Usage Examples

Once connected, any MCP client can use these tools:

Create a document:

"Create a Google Doc from this markdown with title 'Meeting Notes'"

Search documents:

"Find my Google Docs about 'project plan'"

Update a document:

"Update the Google Doc with ID xxx with this new content"

Environment Variables

Variable Default Description
GDOCS_CREDENTIALS_PATH credentials/client_secret.json Path to Google OAuth client secret
GDOCS_TOKEN_PATH credentials/token.json Path to cached OAuth token

Architecture

Built with GRACE framework. Four modules:

  • M-AUTH — OAuth2 authentication with token caching
  • M-CONVERTER — Markdown to DOCX conversion (python-docx + mistune)
  • M-GDRIVE — Google Drive API client (upload, update, list)
  • M-SERVER — MCP server (FastMCP, stdio transport)

Tech Stack

  • Python 3.10+
  • MCP SDK — Model Context Protocol
  • python-docx — DOCX generation
  • mistune — Markdown parsing
  • Google Drive API v3

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_gdocs-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_gdocs-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file mcp_gdocs-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_gdocs-0.1.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcp_gdocs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c68aa29e665ca9d4ee95344356e72ec5ca9e66cbc293e87bf2626e43bbc9600
MD5 c5378e76be20b7e014f3ab9401730dd2
BLAKE2b-256 4aa3c4bd08a878c27f7565ccb7fcf87f86c8cc70de2724a95d07fa041eb0035f

See more details on using hashes here.

File details

Details for the file mcp_gdocs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_gdocs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcp_gdocs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75e8bd4822945c19a4c8793be83acbbf88c3e0fdb51b8c335b34c379bfe47255
MD5 07f2da3166d1a9a6f9c015db8e8135be
BLAKE2b-256 02f4bc2e19203230a1df464e40b57dca26d7fd66af8db64d94b204b4730f8f6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page