> For the complete documentation index, see [llms.txt](https://support.mailagent.email/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.mailagent.email/gmail-addon/integrations.md).

# Integrations

MailAgent supports external integrations that give the AI access to additional context and tools when composing responses. This makes responses more accurate and relevant.

## Available Integrations

### GitBook

Connect your GitBook documentation so the AI can reference your product docs when answering emails.

**Setup:**

1. Open the MailAgent sidebar in Gmail.
2. Click **Integrations**.
3. Click **GitBook**.
4. Enter your GitBook space URL.
5. Save.

Once connected, the AI will search your documentation for relevant information before composing a response. This is especially useful for:

* Customer support — AI can reference product guides and FAQs.
* Technical support — AI can link to API docs and troubleshooting guides.
* Sales — AI can reference feature pages and pricing information.

A green checkmark appears next to GitBook in the integrations list when connected.

### MCP Servers (Model Context Protocol)

Connect any MCP-compatible server to extend the AI's capabilities with custom tools and data sources.

**What is MCP?**

The Model Context Protocol is an open standard for connecting AI models to external tools and data. MCP servers expose capabilities that the AI can invoke during email composition.

**Setup:**

1. Open the MailAgent sidebar in Gmail.
2. Click **Integrations**.
3. Click **MCP**.
4. Enter the MCP server URL (must be an HTTP endpoint).
5. Optionally add a Bearer token for authentication.
6. Save.

**Examples of MCP servers:**

* **CRM integration** — Look up customer information before responding.
* **Knowledge base** — Search internal wikis or documentation.
* **Order system** — Check order status to include in responses.
* **Calendar** — Check availability for scheduling emails.

A green checkmark appears next to MCP in the integrations list when at least one server is connected.

### Customer lookup

Recognize who is writing to you. Pick one tool from a connected MCP server that finds a customer by email, and MailAgent calls it for every new ticket.

**Setup:**

1. Connect an MCP server whose tools include a customer lookup by email (see above).
2. Open the MailAgent sidebar in Gmail.
3. Click **Integrations** → **Customer lookup**.
4. Choose the lookup tool from the list.

The tool must take the email address as a text parameter — one named like `email` or `customer_email`, or one whose description says it expects an email address. MailAgent passes the sender's address, reads what the tool returns and works out whether the sender is a paying **active customer**, on a **trial**, a **free user**, **churned**, a **prospect**, or unknown.

Independently of any CRM, MailAgent also recognizes the sender's organization from their email domain — its industry, type and country (for example, an address at `drogasil.com.br` is recognized as a pharmacy in Brazil). Personal mailboxes such as Gmail or Outlook are recognized as such and are not looked up.

The AI agent sees this customer profile when it writes the reply, and it is included in your ticket analytics. Only the status and the organization profile are kept — MailAgent does not store what your CRM returns.

## Managing Integrations

You can add multiple MCP servers and connect multiple knowledge bases. To remove an integration:

1. Open the MailAgent sidebar.
2. Click **Integrations**.
3. Navigate to the integration you want to remove.
4. Click Remove / Disconnect.

## How Integrations Affect Responses

When the AI processes an email:

1. It analyzes the email content and determines what context might be needed.
2. If relevant, it queries connected integrations (GitBook docs, MCP tools).
3. The retrieved information is used as additional context for generating the response.
4. The final email incorporates both the AI's knowledge and the integration data.

This means the AI's responses become more accurate and specific to your business as you add more integrations.
