New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

gmcp

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gmcp

GMCP Server for Google Workspace with OAuth2 authentication

latest
Source
npmnpm
Version
0.7.0
Version published
Maintainers
1
Created
Source

🔗
gmcp

MCP server for Gmail and Google Calendar integration.
by @johnie


npm Docker Pulls stars



Overview

GMCP is a Model Context Protocol server that enables LLMs to interact with Gmail and Google Calendar. It provides tools for searching emails, managing labels, sending messages, and working with calendar events—all through secure OAuth2 authentication.

Installation

# Install globally
npm install -g gmcp

# Or run directly
npx gmcp
bunx gmcp

Docker

docker pull johnie/gmcp:latest

From Source

git clone https://github.com/johnie/gmcp.git
cd gmcp
bun install

Quick Start

1. Google Cloud Setup

  • Create a project in Google Cloud Console
  • Enable Gmail API and Calendar API
  • Create OAuth 2.0 Client ID (Desktop Application type)
  • Download the credentials JSON file

2. Authenticate

# If installed globally
gmcp auth

# Or with npx
npx gmcp auth

# Or from source
bun run auth

Follow the prompts to authorize. The browser will show "connection refused" after authorization - this is expected. Copy the code= parameter from the URL.

3. Run

# Globally installed
gmcp start
# or just: gmcp

# With npx
npx gmcp start

# From source
bun run start

Claude Desktop Integration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "gmcp": {
      "command": "npx",
      "args": ["-y", "gmcp"],
      "env": {
        "GOOGLE_CREDENTIALS_PATH": "/path/to/credentials.json",
        "GOOGLE_TOKEN_PATH": "/path/to/token.json",
        "GOOGLE_SCOPES": "gmail.readonly,gmail.send,calendar.events"
      }
    }
  }
}

Using Docker

{
  "mcpServers": {
    "gmcp": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "/path/to/credentials.json:/app/data/credentials.json:ro",
        "-v", "/path/to/token.json:/app/data/token.json",
        "-e", "GOOGLE_CREDENTIALS_PATH=/app/data/credentials.json",
        "-e", "GOOGLE_TOKEN_PATH=/app/data/token.json",
        "-e", "GOOGLE_SCOPES=gmail.readonly,gmail.send,calendar.events",
        "johnie/gmcp:latest"
      ]
    }
  }
}

Using Bun (From Source)

{
  "mcpServers": {
    "gmcp": {
      "command": "bun",
      "args": ["run", "/path/to/gmcp/src/cli.ts"],
      "env": {
        "GOOGLE_CREDENTIALS_PATH": "/path/to/credentials.json",
        "GOOGLE_TOKEN_PATH": "/path/to/token.json",
        "GOOGLE_SCOPES": "gmail.readonly,gmail.send,calendar.events"
      }
    }
  }
}

Tools

Gmail (17 tools)

ToolDescription
gmcp_gmail_search_emailsSearch with Gmail query syntax
gmcp_gmail_get_emailGet message by ID
gmcp_gmail_get_threadGet conversation thread
gmcp_gmail_list_attachmentsList attachments on message
gmcp_gmail_get_attachmentDownload attachment data
gmcp_gmail_send_emailSend new email
gmcp_gmail_replyReply to email in thread
gmcp_gmail_create_draftCreate draft message
gmcp_gmail_delete_emailPermanently delete email (bypasses trash)
gmcp_gmail_archive_emailArchive email (remove from inbox)
gmcp_gmail_list_labelsList all labels
gmcp_gmail_get_labelGet label details
gmcp_gmail_create_labelCreate custom label
gmcp_gmail_update_labelUpdate label settings
gmcp_gmail_delete_labelDelete custom label
gmcp_gmail_modify_labelsAdd/remove labels on message
gmcp_gmail_batch_modifyBatch label operations

Calendar (4 tools)

ToolDescription
gmcp_calendar_list_calendarsList all calendars
gmcp_calendar_list_eventsList events with filters
gmcp_calendar_get_eventGet event by ID
gmcp_calendar_create_eventCreate event (supports recurring, Google Meet)

Configuration

Environment Variables

VariableDescription
GOOGLE_CREDENTIALS_PATHPath to OAuth2 credentials JSON
GOOGLE_TOKEN_PATHPath to store OAuth2 tokens
GOOGLE_SCOPESComma-separated API scopes

Scopes

ScopeAccess
gmail.readonlyRead emails and labels
gmail.sendSend emails
gmail.modifyRead, modify labels, delete emails
gmail.labelsManage labels
gmail.composeCreate drafts and send
calendar.readonlyRead calendars and events
calendar.eventsManage events
calendarFull calendar access

Examples:

# Read-only
GOOGLE_SCOPES=gmail.readonly,calendar.readonly

# Full access
GOOGLE_SCOPES=gmail.readonly,gmail.modify,gmail.send,calendar.events

CLI Reference

gmcp [command]

Commands:
  start    Start MCP server (default)
  auth     Run OAuth2 authentication flow

Options:
  --help, -h       Show usage
  --version, -v    Show version

Testing

bunx @modelcontextprotocol/inspector bun run start

License

MIT

Keywords

mcp

FAQs

Package last updated on 30 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts