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

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
1
-93.75%
Maintainers
1
Weekly downloads
 
Created
Source

GMCP

MCP (Model Context Protocol) server for Google services. Provides Gmail and Google Calendar integration with 19 tools for email management and calendar operations.

Gmail Tools

Email Operations

ToolDescription
gmcp_gmail_search_emailsSearch emails using Gmail query syntax
gmcp_gmail_get_emailGet single email by message ID
gmcp_gmail_get_threadGet entire conversation thread
gmcp_gmail_list_attachmentsList all attachments on a message
gmcp_gmail_get_attachmentDownload attachment data by ID
gmcp_gmail_send_emailSend email (preview + confirm safety)
gmcp_gmail_replyReply to email in thread (preview + confirm)
gmcp_gmail_create_draftCreate draft message

Label Management

ToolDescription
gmcp_gmail_list_labelsList all Gmail labels (system + custom)
gmcp_gmail_get_labelGet label details and message counts
gmcp_gmail_create_labelCreate custom label with visibility/color settings
gmcp_gmail_update_labelUpdate label name, visibility, or color
gmcp_gmail_delete_labelDelete custom label (system labels protected)
gmcp_gmail_modify_labelsAdd/remove labels on a message
gmcp_gmail_batch_modifyBatch label operations on multiple messages

Calendar Tools

ToolDescription
gmcp_calendar_list_calendarsList all calendars for account
gmcp_calendar_list_eventsList events with filters (time range, query, calendar)
gmcp_calendar_get_eventGet single event by ID
gmcp_calendar_create_eventCreate event (supports recurring events, Google Meet)

Setup

Prerequisites

  • Google Cloud Project with Gmail API and Calendar API enabled
  • OAuth 2.0 Client ID (Desktop Application type)
    • Create at Google Cloud Console
    • Download credentials JSON file

Install & Configure

# Install dependencies
bun install

# Copy environment template
cp .env.example .env

# Edit .env with your paths
# GOOGLE_CREDENTIALS_PATH=/path/to/credentials.json
# GOOGLE_TOKEN_PATH=/path/to/token.json
# GOOGLE_SCOPES=gmail.readonly,calendar.readonly

Authenticate

Run the OAuth flow to obtain tokens:

bun run auth

Follow the prompts:

  • Visit the authorization URL in your browser
  • Authorize the app
  • Copy the authorization code from the redirected URL
  • Paste it in the terminal

The browser will show "connection refused" after authorization - this is expected. Just copy the code= parameter from the URL.

Run the Server

bun run start

The server runs via stdio and is ready to accept MCP requests.

Configuration

Environment Variables

VariableDescription
GOOGLE_CREDENTIALS_PATHPath to OAuth2 credentials JSON from Google Cloud Console
GOOGLE_TOKEN_PATHPath where OAuth2 tokens will be stored
GOOGLE_SCOPESComma-separated Gmail and Calendar API scopes (short names or full URLs)

Gmail Scopes

Short NameDescriptionRequired For
gmail.readonlyRead-only accessSearch, get email, get thread, list/get attachments, list labels, get label
gmail.modifyRead, create, update, deleteModify labels, batch modify
gmail.labelsManage labelsCreate label, update label, delete label, modify labels, batch modify
gmail.sendSend messagesSend email, reply
gmail.composeCreate drafts and sendSend email, reply, create draft

Calendar Scopes

Short NameDescriptionRequired For
calendar.readonlyRead-only calendar accessList calendars, list events, get event
calendar.events.readonlyRead-only events accessList events, get event
calendar.eventsManage eventsCreate event, list events, get event
calendarFull calendar accessAll calendar tools

Scope Examples

# Gmail read-only
GOOGLE_SCOPES=gmail.readonly

# Gmail and Calendar read-only
GOOGLE_SCOPES=gmail.readonly,calendar.readonly

# Gmail read/send + Calendar read/create
GOOGLE_SCOPES=gmail.readonly,gmail.send,calendar.events

# Full access (all tools)
GOOGLE_SCOPES=gmail.readonly,gmail.modify,gmail.send,gmail.labels,calendar

Claude Desktop Integration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

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

Docker

Run with Docker:

docker build -t gmcp-server .
docker run -i \
  -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.labels,gmail.send,calendar.events \
  gmcp-server

Testing

Test with MCP Inspector:

bunx @modelcontextprotocol/inspector bun run start

Future Enhancements

Potential additions include Google Drive, Google Sheets, and other Google Workspace services.

License

MIT

Keywords

mcp

FAQs

Package last updated on 28 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