---
title: "Gmail Integration"
description: "Send, read, and search Gmail messages"
---
The Gmail integration provides access to send, read, and search Gmail messages through the Integrate MCP server.

## Installation

The Gmail integration is included with the SDK:

```typescript
import { gmailIntegration } from "integrate-sdk/server";
```

## Setup

### 1. Create a Gmail OAuth App

1. Go to [Google Cloud Console](https://console.cloud.google.com)
2. Create a new OAuth application
3. Configure your redirect URI
4. Note your Client ID and Client Secret

### 2. Configure the Integration on Your Server

Add the Gmail integration to your server configuration. The integration automatically reads `GMAIL_CLIENT_ID` and `GMAIL_CLIENT_SECRET` from your environment variables:

```typescript
import { createMCPServer, gmailIntegration } from "integrate-sdk/server";

export const { client: serverClient } = createMCPServer({
  apiKey: process.env.INTEGRATE_API_KEY,
  integrations: [
    gmailIntegration({
    }),
  ],
});
```

You can override the environment variables by passing explicit values:

```typescript
gmailIntegration({
  clientId: process.env.CUSTOM_GMAIL_ID,
  clientSecret: process.env.CUSTOM_GMAIL_SECRET,
});
```

### 3. Client-Side Usage

The default client automatically includes all integrations. You can use it directly:

```typescript
import { client } from "integrate-sdk";

await client.authorize("gmail");
const result = await client.gmail.sendMessage({
  to: "value",
});

console.log(result);
```

If you're using a custom client, add the integration to the integrations array:

```typescript
import { createMCPClient, gmailIntegration } from "integrate-sdk";

const customClient = createMCPClient({
  integrations: [gmailIntegration()],
});
```

## Configuration Options

<AutoTypeTable
  path="../src/integrations/gmail.ts"
  name="GmailIntegrationConfig"
/>


## Tools

### `gmail_create_draft`

Create a draft message

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailCreateDraftParams"
/>

### `gmail_get_attachment`

Get a message attachment payload

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailGetAttachmentParams"
/>

### `gmail_get_message`

Get a specific message by ID

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailGetMessageParams"
/>

### `gmail_get_thread`

Get a specific thread by ID

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailGetThreadParams"
/>

### `gmail_list_messages`

List messages in the mailbox

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailListMessagesParams"
/>

### `gmail_list_threads`

List threads in the mailbox

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailListThreadsParams"
/>

### `gmail_modify_message`

Modify labels on a message

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailModifyMessageParams"
/>

### `gmail_reply_message`

Reply to a message in a thread

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailReplyMessageParams"
/>

### `gmail_search_messages`

Search messages with query

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailSearchMessagesParams"
/>

### `gmail_send_message`

Send a message

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailSendMessageParams"
/>

### `gmail_trash_message`

Move a message to trash

<AutoTypeTable
  path="generated/tool-params/gmail.ts"
  name="GmailTrashMessageParams"
/>

## Notes

- Category: Communication
- Authentication mode: OAuth
