Skip to main content
Glama
Flukeshotz

Google Docs & Gmail MCP Server

by Flukeshotz

Google Docs & Gmail MCP Server

A FastAPI-based MCP-style server that provides tools to append content to Google Docs and create email drafts in Gmail.

Project Structure

  • server.py: FastAPI application with endpoints.

  • auth.py: Handles Google OAuth 2.0 flow.

  • docs_tool.py: Contains the logic to append text to Google Docs.

  • gmail_tool.py: Contains the logic to create Gmail drafts.

  • requirements.txt: Python dependencies.

Related MCP server: Google-MCP-Server

Setup Instructions

1. Google Cloud Console Setup

Before running the application, you need to configure an OAuth client in the Google Cloud Console.

  1. Go to the Google Cloud Console.

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

  3. Navigate to APIs & Services > Library and enable the following APIs:

    • Google Docs API

    • Gmail API

  4. Navigate to APIs & Services > OAuth consent screen:

    • Choose External (or Internal if you have a Google Workspace).

    • Fill in the required fields (App name, User support email, Developer contact information).

    • Under Test users, click ADD USERS and enter the email address you will use to test the application.

  5. Navigate to APIs & Services > Credentials:

    • Click CREATE CREDENTIALS > OAuth client ID.

    • Select Desktop app as the Application type.

    • Name it (e.g., "MCP Server Local") and click Create.

    • Download the JSON file, rename it to credentials.json, and place it in the google-mcp-server directory.

2. Install Dependencies

Ensure you have Python 3.7+ installed. Run the following command in the google-mcp-server directory:

pip install -r requirements.txt

3. Initial Authentication

To generate the token.json file, run the auth.py script directly:

python auth.py

This will open a browser window for you to log in with your Google account (ensure you use the email added as a Test User in the consent screen). After granting permission, a token.json file will be created in your directory. You can close the browser window once authenticated.

4. Running the Server

Start the FastAPI server using uvicorn:

uvicorn server:app --reload

Alternatively, run python server.py.

The server will be running at http://127.0.0.1:8000. You can view the API documentation at http://127.0.0.1:8000/docs.

Usage

When you make a request to the server, it will intercept the action and prompt you in the terminal for approval:

--- ACTION REQUIRED ---
Action: Append to Google Doc
Payload: {'doc_id': '...', 'content': '...'}
Approve? (y/n):

You must type y in the terminal where the server is running to proceed.

Example Request: Append to Doc

curl -X 'POST' \
  'http://127.0.0.1:8000/append_to_doc' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "doc_id": "YOUR_DOCUMENT_ID",
  "content": "\nThis is a new appended line!"
}'

Example Request: Create Email Draft

curl -X 'POST' \
  'http://127.0.0.1:8000/create_email_draft' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "to": "example@example.com",
  "subject": "Test Draft",
  "body": "Hello, this is a draft from MCP Server!"
}'
F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Flukeshotz/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server