# Gmail Mcp

> Gmail MCP Server

- **Type:** MCP server
- **Install:** `agentstack add mcp-annyzhou-gmail-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [annyzhou](https://agentstack.voostack.com/s/annyzhou)
- **Installs:** 0
- **Category:** [Communication](https://agentstack.voostack.com/c/communication)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [annyzhou](https://github.com/annyzhou)
- **Source:** https://github.com/annyzhou/gmail-mcp

## Install

```sh
agentstack add mcp-annyzhou-gmail-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# gmail-mcp

A Gmail MCP server using OAuth2 bearer token auth via the Dedalus MCP framework.

## Tools

### Messages
- `gmail_list_messages` - List messages with search queries
- `gmail_get_message` - Get a specific message by ID
- `gmail_send_message` - Send an email
- `gmail_trash_message` - Move message to trash
- `gmail_untrash_message` - Remove message from trash
- `gmail_modify_message` - Add/remove labels on a message

### Threads
- `gmail_list_threads` - List email threads (conversations)
- `gmail_get_thread` - Get a thread with all messages
- `gmail_trash_thread` - Move thread to trash

### Labels
- `gmail_list_labels` - List all labels
- `gmail_get_label` - Get label details
- `gmail_create_label` - Create a new label
- `gmail_delete_label` - Delete a user label

### Drafts
- `gmail_list_drafts` - List draft emails
- `gmail_get_draft` - Get a draft by ID
- `gmail_create_draft` - Create a draft
- `gmail_send_draft` - Send a draft
- `gmail_delete_draft` - Delete a draft

### Profile
- `gmail_get_profile` - Get user's Gmail profile

## Authentication

Gmail API requires OAuth2. The access token is provided at runtime via Dedalus credential exchange.

Required OAuth scopes (depending on operations):
- `https://www.googleapis.com/auth/gmail.readonly` - Read-only access
- `https://www.googleapis.com/auth/gmail.send` - Send emails
- `https://www.googleapis.com/auth/gmail.modify` - Modify messages/labels
- `https://www.googleapis.com/auth/gmail.compose` - Create drafts

## Usage

### Prerequisites

1. A Dedalus API key (`dsk-live-*` or `dsk-test-*`)
2. The `dedalus-labs` Python SDK installed

### Environment Variables

```bash
DEDALUS_API_KEY=dsk-live-your-key-here
DEDALUS_API_URL=https://api.dedaluslabs.ai
DEDALUS_AS_URL=https://as.dedaluslabs.ai
```

### Example Client

See [`src/_client.py`](src/_client.py) for a complete example client that handles the OAuth browser flow.

The first time you use the MCP server, you'll be prompted to authorize Gmail access via OAuth.

### OAuth Flow

1. On first request, you'll receive an `AuthenticationError` with a `connect_url`
2. Open the URL in a browser to authorize Gmail access
3. After authorization, retry the request - credentials are now stored
4. Subsequent requests will work without re-authorization

## Local Development

```bash
cd gmail-mcp
uv sync
uv run python src/main.py
```

## API Reference

- [Gmail API Overview](https://developers.google.com/workspace/gmail/api/guides)
- [Gmail API Reference](https://developers.google.com/workspace/gmail/api/reference/rest)

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [annyzhou](https://github.com/annyzhou)
- **Source:** [annyzhou/gmail-mcp](https://github.com/annyzhou/gmail-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-annyzhou-gmail-mcp
- Seller: https://agentstack.voostack.com/s/annyzhou
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
