g-mcp

das-monki/g-mcp

3.1

If you are the rightful owner of g-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

An MCP (Model Context Protocol) server for interacting with Google Workspace, specifically Gmail functionality.

Tools
3
Resources
0
Prompts
0

G-MCP: Google Workspace MCP Server

An MCP (Model Context Protocol) server for interacting with Google Workspace, specifically Gmail functionality.

Features

  • Multi-workspace support: Works with multiple Google Workspace accounts
  • Domain selection: Supports workspaces with primary and secondary domains
  • Email reading: Read emails from specified domains with query support
  • Draft creation: Create email drafts with CC/BCC support

Setup

Prerequisites

  • Nix with flakes enabled
  • Google Cloud Project with Gmail API enabled
  • Service account credentials with domain-wide delegation

Installation

  1. Clone the repository:
git clone git@monki:das-monki/g-mcp.git
cd g-mcp
  1. Enter the development environment:
nix develop
  1. Set up Google credentials:
    • Create a service account in Google Cloud Console
    • Enable Gmail API and Admin SDK API
    • Download the service account key as credentials.json
    • Set up domain-wide delegation for the service account
    • Set environment variable: export GOOGLE_APPLICATION_CREDENTIALS=credentials.json

Building

Build the server:

clojure -T:build uber

Or use Nix:

nix build

Running

Start the MCP server:

clojure -M:run

Or run the built binary:

./result/bin/g-mcp

MCP Tools

list-domains

List all available domains in the authenticated Google Workspace.

Parameters: None

Returns: List of domains with their primary status and verification state.

read-emails

Read emails from a specified domain.

Parameters:

  • domain (string): Domain to read emails from
  • max-results (number, optional): Maximum number of emails to return (default: 10)
  • query (string, optional): Gmail search query to filter emails

Returns: List of emails with metadata and content.

create-draft

Create an email draft in Gmail.

Parameters:

  • domain (string): Domain to create the draft in
  • to (string): Recipient email address
  • subject (string): Email subject
  • body (string): Email body content
  • cc (string, optional): CC recipients
  • bcc (string, optional): BCC recipients

Returns: Draft ID and confirmation message.

Configuration

The server requires Google service account credentials with the following scopes:

  • https://www.googleapis.com/auth/gmail.readonly
  • https://www.googleapis.com/auth/gmail.compose
  • https://www.googleapis.com/auth/gmail.modify
  • https://www.googleapis.com/auth/admin.directory.domain.readonly

Development

Run tests:

clojure -M:test

Start a REPL:

clojure -M:repl