Gmail & Google Docs MCP Server

Gmail & Google Docs MCP Server

Enables AI assistants to send emails via Gmail and append text to Google Docs or local files.

Category
Visit Server

README

Gmail & Google Docs MCP Server

This Model Context Protocol (MCP) server allows AI assistants to:

  1. Send emails via your Gmail account.
  2. Append text to your Google Docs or local files.

Setup Instructions

1. Install Dependencies

In this directory, install the required Python packages:

pip3 install -r requirements.txt

2. Get Google OAuth Credentials

To use the Google APIs, you need to create a project in Google Cloud Console and download an OAuth client ID:

  1. Go to the Google Cloud Console.
  2. Create a new project.
  3. Enable the following APIs for your project:
    • Gmail API
    • Google Docs API
  4. Go to APIs & Services > OAuth consent screen. Configure the consent screen (choose "External" if you are a regular Gmail user, or "Internal" if you are on Google Workspace). You must add your email as a test user if the app is in Testing mode.
  5. Go to APIs & Services > Credentials.
  6. Click Create Credentials > OAuth client ID.
  7. Choose Desktop app as the application type.
  8. Click Create and then download the JSON file.
  9. Rename the downloaded file to credentials.json and place it in this directory (/Users/aparanaraghuvanshi/Mcp server/gmail-docs-mcp).

3. Generate the Token

Before the MCP server can run headless, you need to authenticate once:

python3 auth_setup.py

This will open a browser window asking you to log into your Google account and grant permissions. Once completed, a token.json file will be created in this directory.

4. Configuring your AI Client (Claude Desktop / Cursor)

For Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "gmail-docs": {
      "command": "python3",
      "args": ["/Users/aparanaraghuvanshi/Mcp server/gmail-docs-mcp/server.py"]
    }
  }
}

(Make sure to replace python with the absolute path to your python executable if you are using a virtual environment).

For Cursor

Go to Cursor Settings > Features > MCP, and add a new MCP server:

  • Type: command
  • Name: gmail-docs-mcp
  • Command: python3 "/Users/aparanaraghuvanshi/Mcp server/gmail-docs-mcp/server.py"

Deployment (Railway)

To host this MCP Server in the cloud 24/7, you can deploy it to Railway.

  1. Push to GitHub: Commit this entire folder to a private GitHub repository.
  2. Deploy on Railway:
    • Go to Railway, click New Project -> Deploy from GitHub repo.
    • Select your repository.
  3. Configure Persistent Volume:
    • In your Railway project, go to Settings -> Volumes.
    • Click Add Volume and set the Mount Path to /app/data.
  4. Authenticate in Production:
    • Your initial deploy will fail because credentials.json is missing.
    • Go to the Terminal tab of your service in the Railway dashboard.
    • Run cd /app/data.
    • Upload or create your credentials.json here (e.g. cat > credentials.json and paste your JSON, then press Ctrl+D).
    • Run python3 /app/auth_setup.py. Follow the link to authenticate.
    • A token.json will be saved to /app/data.
  5. Connect Client to Cloud: Instead of using a local command, configure your AI Client (Cursor/Claude) to connect via Server-Sent Events (SSE) using the URL provided by Railway (e.g., https://your-app.up.railway.app/sse).

Usage

Once connected, your AI assistant will have access to:

  • send_gmail(to, subject, body)
  • append_to_doc(document_id_or_path, content_to_append)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured