Skip to main content
Glama

MCP Gmail Server

A minimal Model Context Protocol (MCP) server that sends emails through Gmail.

Quick Start

  1. Install dependencies:

    npm install
  2. Set up Gmail credentials:

    cp .env.example .env
    # Edit .env with your Gmail credentials
  3. Build and run:

    npm run build
    npm start

Related MCP server: Gmail MCP Server

Configuration

Set these environment variables in .env:

  • GMAIL_USER: Your Gmail address

  • GMAIL_PASS: Gmail App Password (not your regular password)

Usage

The server exposes one tool: send_email

Parameters:

  • to: Recipient email address

  • subject: Email subject line

  • body: Email content (plain text)

Files

  • src/index.ts - Main MCP server implementation

  • .well-known/mcp.json - MCP server manifest

  • .vscode/mcp.json - VS Code MCP configuration

Testing

# Test with MCP Inspector
npx @modelcontextprotocol/inspector node build/index.js

## How It Works

1. Creates MCP server with Gmail transporter
2. Registers `send_email` tool with input validation
3. Connects via STDIO transport for MCP communication
4. Returns structured responses with success/error states

Available Tools

1 tool
send_emailSend EmailB

Send an email using Gmail SMTP

ParametersJSON Schema
NameRequiredDescriptionDefault
toYesRecipient email address
subjectYesEmail subject
bodyYesEmail body content

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNoError message if failed
successYesWhether email was sent successfully
messageIdNoMessage ID from Gmail

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Send an email using Gmail SMTP,' which implies a write operation but doesn't cover critical aspects like authentication requirements, error handling, rate limits, or whether it's idempotent. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action and method, making it easy to scan. Every part of the sentence contributes essential information, earning its place without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation with 3 parameters), no annotations, and an output schema present, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, usage context, and error handling. The output schema might provide return values, but the description doesn't hint at this, leaving gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear parameter definitions (to, subject, body). The description doesn't add any semantic details beyond what the schema provides, such as formatting examples or constraints. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Send an email using Gmail SMTP' clearly states the action (send) and resource (email), specifying the method (Gmail SMTP). It's specific enough to understand what the tool does, though without sibling tools, differentiation isn't needed. However, it could be more precise about the scope (e.g., whether it's for a single recipient or supports multiple).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual constraints. It mentions Gmail SMTP, which implies a specific email service, but doesn't clarify if it's for personal or bulk emails, or if there are rate limits. Without siblings, explicit alternatives aren't required, but usage context is missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.2/5.0
Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap between tools. The tool 'send_email' has a clear and distinct purpose that cannot be mistaken for any other tool in this set.

Naming Consistency5/5

A single tool inherently has perfect naming consistency, as there are no other tools to compare it against. The name 'send_email' follows a clear verb_noun pattern, which would be consistent if more tools were added.

Tool Count2/5

A Gmail server with only one tool is too limited for its apparent scope. Gmail involves operations like reading, listing, deleting, and managing emails, so a single send tool leaves significant functionality uncovered, making it inappropriate for comprehensive use.

Completeness1/5

The tool set is severely incomplete for a Gmail server. It only supports sending emails, missing essential operations such as retrieving, listing, deleting, or managing emails and labels. This gap will cause frequent agent failures when trying to perform common Gmail tasks.

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

Appeared in Searches

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/PranavMishra28/gmail-mcp'

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