# How to integrate Resend MCP with CrewAI

```json
{
  "title": "How to integrate Resend MCP with CrewAI",
  "toolkit": "Resend",
  "toolkit_slug": "resend",
  "framework": "CrewAI",
  "framework_slug": "crew-ai",
  "url": "https://composio.dev/toolkits/resend/framework/crew-ai",
  "markdown_url": "https://composio.dev/toolkits/resend/framework/crew-ai.md",
  "updated_at": "2026-11-07T07:12:55.020Z"
}
```

## Introduction

This guide walks you through connecting Resend to CrewAI using the Composio tool router. By the end, you'll have a working Resend agent that can send transactional and batch emails, run broadcasts, manage contacts and segments, verify sending domains, and edit email templates through natural language commands.
This guide will help you understand how to give your CrewAI agent real control over a Resend account through Composio's Resend MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Resend with

- [Claude Code](https://composio.dev/toolkits/resend/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/resend/framework/claude-cowork)
- [OpenAI Agents SDK](https://composio.dev/toolkits/resend/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/resend/framework/claude-agents-sdk)
- [Codex](https://composio.dev/toolkits/resend/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/resend/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/resend/framework/hermes-agent)
- [Atomic Agent](https://composio.dev/toolkits/resend/framework/atomic-agent)
- [Google ADK](https://composio.dev/toolkits/resend/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/resend/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/resend/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/resend/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/resend/framework/llama-index)
- [Pydantic AI](https://composio.dev/toolkits/resend/framework/pydantic-ai)
- [AutoGen](https://composio.dev/toolkits/resend/framework/autogen)

## TL;DR

Here's what you'll learn:
- Get a Composio API key and configure your Resend connection
- Set up CrewAI with an MCP enabled agent
- Create a Tool Router session or standalone MCP server for Resend
- Build a conversational loop where your agent can execute Resend operations

## What is CrewAI?

CrewAI is a powerful framework for building multi-agent AI systems. It provides primitives for defining agents with specific roles, creating tasks, and orchestrating workflows through crews.
Key features include:
- Agent Roles: Define specialized agents with specific goals and backstories
- Task Management: Create tasks with clear descriptions and expected outputs
- Crew Orchestration: Combine agents and tasks into collaborative workflows
- MCP Integration: Connect to external tools through Model Context Protocol

## What is the Resend MCP server, and what's possible with it?

The Resend MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Resend account. It provides structured and secure access to your email sending and contact management capabilities, so your agent can perform actions like sending emails, managing audiences, creating domains, and handling contacts on your behalf.
- Automated email delivery and scheduling: Ask your agent to send emails instantly or schedule them for later, and even cancel scheduled messages if needed.
- Audience and contact management: Let your agent create, list, or delete audiences and individual contacts, keeping your recipient lists organized without manual effort.
- Domain administration: Easily have your agent set up, list, or remove email sending domains, streamlining onboarding or maintenance for your email infrastructure.
- Seamless recipient segmentation: Direct your agent to group contacts into audiences for targeted campaigns or communications, improving personalization and reach.
- Bulk operations and cleanups: Enable your agent to quickly list, update, or delete multiple contacts, audiences, or domains to maintain a tidy and up-to-date email system.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `RESEND_ADD_CONTACT_TO_SEGMENT` | Add Contact To Segment | Add an existing contact to a segment in Resend. Use when you need to organize contacts into specific segments for targeted communication. |
| `RESEND_BATCH_ADD_SUPPRESSIONS` | Batch Add Suppressions | Add between 1 and 100 Resend suppressions to prevent sending to those emails. |
| `RESEND_BATCH_REMOVE_SUPPRESSIONS` | Batch Remove Suppressions | Remove 1–100 Resend suppressions by email addresses or suppression IDs, but not both. |
| `RESEND_CANCEL_BROADCAST` | Cancel Broadcast | Cancel a queued or scheduled broadcast. Canceling a queued broadcast stops it mid-send: emails already sent are not affected, but no further emails will go out. |
| `RESEND_CANCEL_EMAIL` | Cancel Email | Cancel a scheduled email. |
| `RESEND_CREATE_API_KEY` | Create API Key | Create a new API key to authenticate communications with Resend. Use when you need to generate a new authentication token for API access. |
| `RESEND_CREATE_AUDIENCE` | Create Audience | Create a segment using the legacy audience action and response shape. |
| `RESEND_CREATE_AUTOMATION` | Create Automation | Create a Resend automation from workflow steps and connections. Use when defining a new automation with at least one trigger step. The automation is disabled by default; set status to enabled to enable it on creation. |
| `RESEND_CREATE_CONTACT` | Create Contact | Create a global contact and add it to the segment identified by audienceId. |
| `RESEND_CREATE_CONTACT_IMPORT` | Create Contact Import | Create a contact import from a CSV file, optionally mapping columns and applying segments and topic subscriptions. |
| `RESEND_CREATE_CONTACT_PROPERTY` | Create Contact Property | Tool to create a new contact property in Resend. Use when you need to define custom fields for contacts. |
| `RESEND_CREATE_CONTACT_V2` | Create Contact V2 | Tool to create a new contact in Resend. Use when you need to add a contact to Resend without specifying an audience. |
| `RESEND_CREATE_DOMAIN` | Create Domain | Create a domain through the Resend Email API. The domain is created in a pending/unverified state and cannot be used for sending emails until DNS verification is completed. |
| `RESEND_CREATE_DOMAIN_CLAIM` | Create Domain Claim | Start a claim for a domain another Resend account has already verified. Recreates the domain under your account with fresh DKIM keys; the previous account's DNS records cannot be reused. Add the returned TXT record to DNS to prove ownership. An identical pending claim is returned unchanged. |
| `RESEND_CREATE_DRAFT_BROADCAST` | Create Draft Broadcast | Create a broadcast and leave it as an unsent draft. Use when you want to stage a campaign for review; this action never sends or schedules the broadcast, so a separate send step is always required. |
| `RESEND_CREATE_EVENT` | Create Event | Create a Resend event definition, optionally with a typed payload schema. Use when registering a custom event for automations; this does not emit an event. Event names cannot start with the reserved resend: prefix. |
| `RESEND_CREATE_SEGMENT` | Create Segment | Create a new segment for contacts to be added to. Use when you need a fresh list of contacts to target; segments are the modern replacement for audiences. |
| `RESEND_CREATE_SUPPRESSION` | Create Suppression | Create a Resend suppression for an email address to prevent sending to it. |
| `RESEND_CREATE_TEMPLATE` | Create Template | Tool to create a new email template in Resend. Use when you need to define reusable email templates with optional variables. |
| `RESEND_CREATE_TOPIC` | Create Topic | Tool to create a new topic to segment your audience. Use when you need to create a topic for organizing contacts by interests or preferences. |
| `RESEND_CREATE_WEBHOOK` | Create Webhook | Tool to create a webhook to receive real-time notifications about email events. Use when you need to set up automated notifications for email status changes. |
| `RESEND_DELETE_API_KEY` | Delete API Key | Remove an existing API key from Resend. Use when you need to revoke or delete an API key. |
| `RESEND_DELETE_AUDIENCE` | Delete Audience | Remove a segment using the legacy audience action and response shape. |
| `RESEND_DELETE_AUTOMATION` | Delete Automation | Remove an existing automation from Resend using its automation ID. |
| `RESEND_DELETE_BROADCAST` | Delete Broadcast | Remove an existing broadcast that is in draft status. Use this action to delete a draft broadcast from Resend. |
| `RESEND_DELETE_CONTACT` | Delete Contact | Remove a contact from the segment identified by audienceId, preserving the global contact. Uses the replacement segment-membership API so a legacy audience-scoped deletion does not also remove the contact from unrelated segments. |
| `RESEND_DELETE_CONTACT_BY_ID` | Delete Contact By ID | Tool to remove an existing contact by its ID. Use when you need to delete a contact directly without specifying an audience. |
| `RESEND_DELETE_CONTACT_PROPERTY` | Delete Contact Property | Remove an existing contact property from Resend. |
| `RESEND_DELETE_DOMAIN` | Delete Domain | Delete a domain through the Resend Email API. Deletion is irreversible; ensure no active email traffic or DNS configurations depend on the domain before calling. |
| `RESEND_DELETE_EVENT` | Delete Event | Delete an existing Resend event using its event ID (UUID) or event name. |
| `RESEND_DELETE_SEGMENT` | Delete Segment | Remove an existing segment. Use when you need to permanently delete a segment by its ID. |
| `RESEND_DELETE_SUPPRESSION` | Delete Suppression | Remove a Resend suppression using its suppression ID or email address. |
| `RESEND_DELETE_TEMPLATE` | Delete Template | Remove an existing template. Use this action when you need to delete a template from Resend. |
| `RESEND_DELETE_TOPIC` | Delete Topic | Delete an existing Resend topic by its topic ID. OAuth connections require the full_access scope. |
| `RESEND_DELETE_WEBHOOK` | Delete Webhook | Remove an existing webhook by ID. Use this to delete a webhook configuration when you no longer need to receive event notifications at that endpoint. |
| `RESEND_DUPLICATE_AUTOMATION` | Duplicate Automation | Duplicate an existing automation by its ID and return the new automation's ID. |
| `RESEND_DUPLICATE_BROADCAST` | Duplicate Broadcast | Create a new draft broadcast from an existing broadcast. Copies the segment, topic, sender, subject, reply-to, preview text, and content. The copy is named after the source with " (copy)" appended, truncated to 70 characters. |
| `RESEND_DUPLICATE_TEMPLATE` | Duplicate Template | Duplicate an existing template through the Resend Email API. Use when you need to create a copy of an existing template. |
| `RESEND_GET_AUTOMATION` | Get Automation | Retrieve a Resend automation by ID, including its active workflow steps and connections. |
| `RESEND_GET_AUTOMATION_RUN` | Get Automation Run | Retrieve a Resend automation run by automation and run IDs, including its status and step executions in graph order. |
| `RESEND_GET_BROADCAST` | Get Broadcast | Retrieve a single broadcast by its ID. Use when you need to read back a broadcast's content, recipient segment, schedule and status before sending it. |
| `RESEND_GET_CONTACT` | Get Contact | Tool to retrieve a single contact from Resend by ID or email. Use when you need to get details of a specific contact using the global contacts endpoint. |
| `RESEND_GET_CONTACT_IMPORT` | Get Contact Import | Retrieve a contact import by ID to check its status, timestamps, and processed row counts. |
| `RESEND_GET_CONTACT_PROPERTY` | Get Contact Property | Tool to retrieve a single contact property from Resend. Use when you need to get details about a specific contact property by its ID. |
| `RESEND_GET_DOMAIN_CLAIM` | Get Domain Claim | Retrieve the latest claim for a placeholder domain created by a claim. Returns the claim status, ownership-verification TXT record, and blocking or failure reasons. Supply the placeholder domain ID, not the claim ID. |
| `RESEND_GET_EMAIL_ATTACHMENT` | Get Email Attachment | Retrieve a single attachment from a sent email. Use when you need to access attachment metadata and download URL. |
| `RESEND_GET_EMAIL_METRICS` | Get Email Metrics | Retrieve account-level email metrics over a date range, with optional filters and dimension breakdowns. Use to analyze delivery, engagement, and rates; without dimensions the response contains totals only. |
| `RESEND_GET_EVENT` | Get Event | Retrieve a Resend event definition by UUID or event name. Use to inspect an event's payload schema and creation/update timestamps. |
| `RESEND_GET_LOG` | Get Log | Retrieve a single Resend API log by its ID. Use to inspect a request's endpoint, method, status, and request/response bodies. |
| `RESEND_GET_RECEIVED_EMAIL` | Get Received Email | Retrieve a single received email by ID, including its content, headers, recipients, and attachment metadata. Use for an inbound email, not a sent email. |
| `RESEND_GET_RECEIVED_EMAIL_ATTACHMENT` | Get Received Email Attachment | Retrieve a single attachment from a received email, including its metadata and signed download URL. Use for an inbound email's attachment. |
| `RESEND_GET_SEGMENT` | Get Segment | Retrieve a single segment by its ID. Use when you need to get detailed information about a specific segment. |
| `RESEND_GET_SUPPRESSION` | Get Suppression | Retrieve a Resend suppression by ID or email address. Use to inspect a suppressed address, its origin, source event, and creation time. |
| `RESEND_GET_TEMPLATE` | Get Template | Retrieve a single template by ID or alias from Resend. Use when you need to view template details. |
| `RESEND_GET_TOPIC` | Get Topic | Tool to retrieve a single topic by its ID in Resend. Use when you need to fetch details of a specific topic. |
| `RESEND_GET_USAGE` | Get Usage | Retrieve the account's current usage and plan limits for emails, contacts, segments, broadcasts, AI credits, automation runs, domains, and API requests. Use to check quota consumption and reset times. |
| `RESEND_GET_WEBHOOK` | Get Webhook | Retrieve a single webhook for the authenticated user. Use this to get details about a specific webhook configuration including its endpoint, subscribed events, and signing secret. |
| `RESEND_GET_WEBHOOK_EVENT` | Get Webhook Event | Retrieve a single webhook event by webhook ID and event ID. Use to inspect its delivery status, next scheduled attempt, and event payload. |
| `RESEND_LIST_ALL_CONTACTS` | List All Contacts | Tool to retrieve a list of all contacts from Resend. Use when you need to fetch contacts across all audiences with optional pagination, or only the contacts of a single segment by passing segment_id. |
| `RESEND_LIST_API_KEYS` | List API Keys | Tool to retrieve a list of API keys for the authenticated user. Use when you need to view all API keys associated with the account, including pagination support for large result sets. |
| `RESEND_LIST_AUDIENCES` | List Audiences | List segments using the legacy audience action and response shape. |
| `RESEND_LIST_AUTOMATION_RUNS` | List Automation Runs | Retrieve a page of runs for a Resend automation. Use to review run IDs, statuses, and timestamps, optionally filtering by comma-separated statuses. Use limit and cursor parameters to paginate through results. |
| `RESEND_LIST_AUTOMATIONS` | List Automations | Retrieve a page of Resend automations. Use to find automation IDs and review names, statuses, and timestamps, optionally filtering by enabled or disabled status. Use limit and cursor parameters to paginate through results. |
| `RESEND_LIST_BROADCAST_CLICKED_LINKS` | List Broadcast Clicked Links | Retrieve one page of a broadcast's clicked URLs and total and unique click counts. Use to inspect link engagement for a broadcast. Supports cursor pagination; each returned row ID is an opaque pagination cursor, not a Resend entity ID. |
| `RESEND_LIST_BROADCAST_RECIPIENTS` | List Broadcast Recipients | Retrieve a page of broadcast recipients filtered by a required event type. Use to inspect who received, opened, clicked, bounced, or otherwise interacted with a broadcast. Supports email substring filtering and cursor pagination. |
| `RESEND_LIST_BROADCASTS` | List Broadcasts | Tool to retrieve a list of broadcasts. Use when you need to fetch all broadcasts or paginate through them. |
| `RESEND_LIST_CONTACT_IMPORTS` | List Contact Imports | Retrieve a page of Resend contact imports, optionally filtered by status. Use to monitor import jobs and their row counts. Follow has_more with after or before cursors to retrieve additional pages. |
| `RESEND_LIST_CONTACT_PROPERTIES` | List Contact Properties | Tool to retrieve a list of contact properties from Resend. Use when you need to view available contact property definitions. |
| `RESEND_LIST_CONTACTS` | List Contacts | List contacts belonging to the segment identified by the legacy audienceId parameter. |
| `RESEND_LIST_CONTACT_SEGMENTS` | List Contact Segments | Retrieve a list of segments that a contact is part of. Use when you need to determine which segments a specific contact belongs to. |
| `RESEND_LIST_CONTACT_TOPICS` | List Contact Topics | Retrieve a list of topic subscriptions for a contact in Resend. Use when you need to check which topics a specific contact is subscribed to. |
| `RESEND_LIST_DOMAINS` | List Domains | List all domains. Use the returned domain IDs as inputs for tools like RESEND_VERIFY_DOMAIN that require a domain_id. |
| `RESEND_LIST_EMAIL_ATTACHMENTS` | List Email Attachments | Tool to retrieve a list of attachments from a sent email. Use when you need to get information about files attached to an email sent via Resend. |
| `RESEND_LIST_EMAILS` | List Emails | Tool to retrieve a list of emails sent by your team. Use when you need to fetch outbound emails from your account. Supports pagination with limit, after, and before parameters. |
| `RESEND_LIST_EVENTS` | List Events | Retrieve a page of Resend event definitions and their payload schemas. Use when discovering events available for automations, with optional cursor pagination. This lists event definitions, not emitted event occurrences. |
| `RESEND_LIST_LOGS` | List Logs | Retrieve a page of Resend API request logs with optional cursor pagination. Use to inspect called endpoints, HTTP methods, response status codes, and user agents when investigating API activity. |
| `RESEND_LIST_RECEIVED_EMAIL_ATTACHMENTS` | List Received Email Attachments | Retrieve a paginated list of attachments for a received email, including metadata and signed download URLs. Use for an inbound email's attachments. |
| `RESEND_LIST_RECEIVED_EMAILS` | List Received Emails | Tool to retrieve a list of received emails for the authenticated user. Use when you need to fetch incoming emails from the receiving endpoint. |
| `RESEND_LIST_SEGMENTS` | List Segments | Retrieve a page of Resend segments for audience management. Use the after or before cursor to paginate through available segments. |
| `RESEND_LIST_SUPPRESSIONS` | List Suppressions | Retrieve a page of suppressed email addresses from Resend, optionally filtered by bounce, complaint, or manual origin. Use after or before cursors to paginate results. |
| `RESEND_LIST_TEMPLATES` | List Templates | Tool to retrieve a list of templates from Resend. Use when you need to get all available templates with optional pagination support. |
| `RESEND_LIST_TOPICS` | List Topics | Tool to retrieve a list of topics for the authenticated user. Use when you need to fetch available topics with optional pagination support. |
| `RESEND_LIST_WEBHOOK_EVENT_ATTEMPTS` | List Webhook Event Attempts | Retrieve a page of delivery attempts for an event on a Resend webhook, including HTTP status codes, response bodies, and send timestamps. Use when diagnosing webhook delivery failures. Pass the last attempt's cursor as after to retrieve another page when has_more is true. |
| `RESEND_LIST_WEBHOOK_EVENTS` | List Webhook Events | Retrieve a page of events for a Resend webhook, including delivery status. Use when inspecting webhook deliveries. Pass the last event's cursor as after to retrieve another page when has_more is true. |
| `RESEND_LIST_WEBHOOKS` | List Webhooks | Retrieve a list of webhooks for the authenticated user. Use this to view all configured webhooks with their endpoints, event types, and status. |
| `RESEND_PUBLISH_TEMPLATE` | Publish Template | Publish a template through the Resend Email API. Use when you need to make a template publicly available. |
| `RESEND_REMOVE_CONTACT_FROM_SEGMENT` | Remove Contact From Segment | Remove an existing contact from a segment. Use when you need to disassociate a contact from a specific segment. |
| `RESEND_REPLAY_WEBHOOK_EVENT` | Replay Webhook Event | Queue one more delivery of an event to an enabled webhook. The event must be retrievable through Get Webhook Event. A disabled webhook returns a 422 validation_error. A manual replay does not schedule automatic retries; a successful response means delivery was queued, not completed. |
| `RESEND_RETRIEVE_AUDIENCE` | Retrieve Audience | Retrieve a segment using the legacy audience action and response shape. |
| `RESEND_RETRIEVE_CONTACT` | Retrieve Contact | Retrieve a global contact by ID. The legacy audienceId input is retained for compatibility. |
| `RESEND_RETRIEVE_DOMAIN` | Retrieve Domain | Retrieve a single domain. |
| `RESEND_RETRIEVE_EMAIL` | Retrieve Email | Retrieve a single email. |
| `RESEND_SEND_BATCH_EMAILS` | Send Batch Emails | Trigger up to 100 batch emails at once. Use when you need to send multiple emails in a single API request. |
| `RESEND_SEND_BROADCAST` | Send Broadcast | Send an existing Resend broadcast immediately or schedule it for a later ISO 8601 date. Use after creating and preparing the broadcast for delivery to its recipients. |
| `RESEND_SEND_EMAIL` | Send Email | Send an email using Resend. Confirm recipients and content with the user before invoking — sends are irreversible. All recipients must be listed explicitly via `to`, `cc`, or `bcc`; audience-based sending is unsupported. Render HTML or plain text externally before passing via `html` or `text`. |
| `RESEND_SEND_EVENT` | Send Event | Send an event associated with a contact ID or email, with an optional payload. Triggers matching enabled automations, which can send emails or modify contacts according to their configured steps. |
| `RESEND_SHARE_EMAIL` | Share Email | Create a shareable link for a sent or received Resend email. Use its email ID and optionally set a link lifetime of up to 48 hours; omitted expiry defaults to 48 hours. |
| `RESEND_STOP_AUTOMATION` | Stop Automation | Stop an automation by its ID and return its status after stopping. |
| `RESEND_UPDATE_AUTOMATION` | Update Automation | Update a Resend automation's name, status, or workflow graph. Use for an existing automation; supply at least one update. To replace the workflow graph, provide both steps and connections together. |
| `RESEND_UPDATE_BROADCAST` | Update Broadcast | Update an existing broadcast in Resend. Use when you need to modify broadcast details like name, subject, content, or recipients. |
| `RESEND_UPDATE_CONTACT` | Update Contact | Tool to update an existing contact in Resend by ID or email. Use when you need to modify contact details such as name or subscription status. |
| `RESEND_UPDATE_CONTACT_PROPERTY` | Update Contact Property | Update an existing contact property in Resend. Only the fallback_value can be updated; the key and type fields cannot be changed after creation. |
| `RESEND_UPDATE_CONTACT_TOPICS` | Update Contact Topics | Update topic subscriptions for a Resend contact by ID or email address. Use to opt a contact in to or out of specific topics. |
| `RESEND_UPDATE_DOMAIN` | Update Domain | Update an existing domain's click tracking, open tracking, and TLS settings. Omitted settings are sent as disabled tracking and opportunistic TLS. |
| `RESEND_UPDATE_DRAFT_BROADCAST` | Update Draft Broadcast | Update a broadcast that is still an unsent draft. Use when you need to revise a staged campaign; the broadcast is read back first and the update is refused unless its status is 'draft' and it has no scheduled send time. |
| `RESEND_UPDATE_EMAIL` | Update Email | Update the scheduled send time of a scheduled email by ID. |
| `RESEND_UPDATE_EVENT` | Update Event | Update a Resend event definition's payload schema by UUID or event name. Supply a flat key/type map to replace the schema, or null to clear it. This updates the event definition; it does not emit an event. |
| `RESEND_UPDATE_SEGMENT` | Update Segment | Update an existing segment in Resend. Use when you need to rename a segment identified by its Segment ID. |
| `RESEND_UPDATE_TEMPLATE` | Update Template | Tool to update an existing email template in Resend. Use when you need to modify template properties such as name, subject, HTML content, or variables. |
| `RESEND_UPDATE_TOPIC` | Update Topic | Tool to update an existing topic in Resend. Use when you need to modify the name of a topic. |
| `RESEND_UPDATE_WEBHOOK` | Update Webhook | Tool to update an existing webhook configuration. Use when you need to modify the endpoint URL, change event subscriptions, or enable/disable a webhook. |
| `RESEND_VERIFY_DOMAIN` | Verify Domain | Verify a domain through the Resend Email API. DNS records must fully propagate before verification succeeds; avoid immediate retries after DNS setup. |
| `RESEND_VERIFY_DOMAIN_CLAIM` | Verify Domain Claim | Trigger asynchronous DNS verification and ownership transfer for a domain claim. Add the claim's TXT record to DNS first. Supply the placeholder domain ID, not the claim ID. The claim stays pending while verification runs; poll RESEND_GET_DOMAIN_CLAIM for status. Once completed, add the transferred domain's new DKIM records to DNS and verify them with RESEND_VERIFY_DOMAIN. |

## Supported Triggers

None listed.

## Creating MCP Server - Stand-alone vs Composio SDK

The Resend MCP server is an implementation of the Model Context Protocol that connects your AI agent to Resend. It provides structured and secure access so your agent can perform Resend operations on your behalf through a secure, permission-based interface.
With Composio's managed implementation, you don't have to create your own developer app. For production, if you're building an end product, we recommend using your own credentials. The managed server helps you prototype fast and go from 0-1 faster.

## Step-by-step Guide

### 1. Prerequisites

Before starting, make sure you have:
- Python 3.9 or higher
- A Composio account and API key
- A Resend connection authorized in Composio
- An OpenAI API key for the CrewAI LLM
- Basic familiarity with Python

### 1. Getting API Keys for OpenAI and Composio

OpenAI API Key
- Go to the [OpenAI dashboard](https://platform.openai.com/settings/organization/api-keys) and create an API key. You'll need credits to use the models, or you can connect to another model provider.
- Keep the API key safe.
Composio API Key
- Log in to the [Composio dashboard](https://dashboard.composio.dev?utm_source=toolkits&utm_medium=framework_docs).
- Navigate to your API settings and generate a new API key.
- Store this key securely as you'll need it for authentication.

### 2. Install dependencies

**What's happening:**
- composio connects your agent to Resend via MCP
- crewai provides Agent, Task, Crew, and LLM primitives
- crewai-tools[mcp] includes MCP helpers
- python-dotenv loads environment variables from .env
```bash
pip install composio crewai crewai-tools[mcp] python-dotenv
```

### 3. Set up environment variables

Create a .env file in your project root.
What's happening:
- COMPOSIO_API_KEY authenticates with Composio
- USER_ID scopes the session to your account
- OPENAI_API_KEY lets CrewAI use your chosen OpenAI model
```bash
COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_user_id_here
OPENAI_API_KEY=your_openai_api_key_here
```

### 4. Import dependencies

**What's happening:**
- CrewAI classes define agents and tasks, and run the workflow
- MCPServerHTTP connects the agent to an MCP endpoint
- Composio will give you a short lived Resend MCP URL
```python
import os
from composio import Composio
from crewai import Agent, Task, Crew
from crewai_tools import MCPServerAdapter
import dotenv

dotenv.load_dotenv()

COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set")
```

### 5. Create a Composio Tool Router session for Resend

**What's happening:**
- You create a Resend only session through Composio
- Composio returns an MCP HTTP URL that exposes Resend tools
```python
composio_client = Composio(api_key=COMPOSIO_API_KEY)
session = composio_client.create(user_id=COMPOSIO_USER_ID, toolkits=["resend"])

url = session.mcp.url
```

### 6. Initialize the MCP Server

**What's Happening:**
- Server Configuration: The code sets up connection parameters including the MCP server URL, streamable HTTP transport, and Composio API key authentication.
- MCP Adapter Bridge: MCPServerAdapter acts as a context manager that converts Composio MCP tools into a CrewAI-compatible format.
- Agent Setup: Creates a CrewAI Agent with a defined role (Search Assistant), goal (help with internet searches), and access to the MCP tools.
- Configuration Options: The agent includes settings like verbose=False for clean output and max_iter=10 to prevent infinite loops.
- Dynamic Tool Usage: Once created, the agent automatically accesses all Composio Search tools and decides when to use them based on user queries.
```python
server_params = {
    "url": url,
    "transport": "streamable-http",
    "headers": {"x-api-key": COMPOSIO_API_KEY},
}

with MCPServerAdapter(server_params) as tools:
    agent = Agent(
        role="Search Assistant",
        goal="Help users search the internet effectively",
        backstory="You are a helpful assistant with access to search tools.",
        tools=tools,
        verbose=False,
        max_iter=10,
    )
```

### 7. Create a CLI Chatloop and define the Crew

**What's Happening:**
- Interactive CLI Setup: The code creates an infinite loop that continuously prompts for user input and maintains the entire conversation history in a string variable.
- Input Validation: Empty inputs are ignored to prevent processing blank messages and keep the conversation clean.
- Context Building: Each user message is appended to the conversation context, which preserves the full dialogue history for better agent responses.
- Dynamic Task Creation: For every user input, a new Task is created that includes both the full conversation history and the current request as context.
- Crew Execution: A Crew is instantiated with the agent and task, then kicked off to process the request and generate a response.
- Response Management: The agent's response is converted to a string, added to the conversation context, and displayed to the user, maintaining conversational continuity.
```python
print("Chat started! Type 'exit' or 'quit' to end.\n")

conversation_context = ""

while True:
    user_input = input("You: ").strip()

    if user_input.lower() in ["exit", "quit", "bye"]:
        print("\nGoodbye!")
        break

    if not user_input:
        continue

    conversation_context += f"\nUser: {user_input}\n"
    print("\nAgent is thinking...\n")

    task = Task(
        description=(
            f"Conversation history:\n{conversation_context}\n\n"
            f"Current request: {user_input}"
        ),
        expected_output="A helpful response addressing the user's request",
        agent=agent,
    )

    crew = Crew(agents=[agent], tasks=[task], verbose=False)
    result = crew.kickoff()
    response = str(result)

    conversation_context += f"Agent: {response}\n"
    print(f"Agent: {response}\n")
```

## Complete Code

```python
from crewai import Agent, Task, Crew, LLM
from crewai_tools import MCPServerAdapter
from composio import Composio
from dotenv import load_dotenv
import os

load_dotenv()

GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not GOOGLE_API_KEY:
    raise ValueError("GOOGLE_API_KEY is not set in the environment.")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set in the environment.")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set in the environment.")

# Initialize Composio and create a session
composio = Composio(api_key=COMPOSIO_API_KEY)
session = composio.create(
    user_id=COMPOSIO_USER_ID,
    toolkits=["resend"],
)
url = session.mcp.url

# Configure LLM
llm = LLM(
    model="gpt-5",
    api_key=os.getenv("OPENAI_API_KEY"),
)

server_params = {
    "url": url,
    "transport": "streamable-http",
    "headers": {"x-api-key": COMPOSIO_API_KEY},
}

with MCPServerAdapter(server_params) as tools:
    agent = Agent(
        role="Search Assistant",
        goal="Help users with internet searches",
        backstory="You are an expert assistant with access to Composio Search tools.",
        tools=tools,
        llm=llm,
        verbose=False,
        max_iter=10,
    )

    print("Chat started! Type 'exit' or 'quit' to end.\n")

    conversation_context = ""

    while True:
        user_input = input("You: ").strip()

        if user_input.lower() in ["exit", "quit", "bye"]:
            print("\nGoodbye!")
            break

        if not user_input:
            continue

        conversation_context += f"\nUser: {user_input}\n"
        print("\nAgent is thinking...\n")

        task = Task(
            description=(
                f"Conversation history:\n{conversation_context}\n\n"
                f"Current request: {user_input}"
            ),
            expected_output="A helpful response addressing the user's request",
            agent=agent,
        )

        crew = Crew(agents=[agent], tasks=[task], verbose=False)
        result = crew.kickoff()
        response = str(result)

        conversation_context += f"Agent: {response}\n"
        print(f"Agent: {response}\n")
```

## Conclusion

You now have a CrewAI agent connected to Resend through Composio's Tool Router. The agent can perform Resend operations through natural language commands.
Next steps:
- Add role-specific instructions to customize agent behavior
- Plug in more toolkits for multi-app workflows
- Chain tasks for complex multi-step operations

## How to build Resend MCP Agent with another framework

- [Claude Code](https://composio.dev/toolkits/resend/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/resend/framework/claude-cowork)
- [OpenAI Agents SDK](https://composio.dev/toolkits/resend/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/resend/framework/claude-agents-sdk)
- [Codex](https://composio.dev/toolkits/resend/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/resend/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/resend/framework/hermes-agent)
- [Atomic Agent](https://composio.dev/toolkits/resend/framework/atomic-agent)
- [Google ADK](https://composio.dev/toolkits/resend/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/resend/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/resend/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/resend/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/resend/framework/llama-index)
- [Pydantic AI](https://composio.dev/toolkits/resend/framework/pydantic-ai)
- [AutoGen](https://composio.dev/toolkits/resend/framework/autogen)

## Related Toolkits

- [Reddit](https://composio.dev/toolkits/reddit) - Reddit is a social news platform with thriving user-driven communities (subreddits). It's the go-to place for discussion, content sharing, and viral marketing.
- [Facebook](https://composio.dev/toolkits/facebook) - Facebook is a social media and advertising platform for businesses and creators. It helps you connect, share, and manage content across your public Facebook Pages.
- [Linkedin](https://composio.dev/toolkits/linkedin) - LinkedIn is a professional networking platform for connecting, sharing content, and engaging with business opportunities. It's the go-to place for building your professional brand and unlocking new career connections.
- [Active campaign](https://composio.dev/toolkits/active_campaign) - ActiveCampaign is a marketing automation and CRM platform for managing email campaigns, sales pipelines, and customer segmentation. It helps businesses engage customers and drive growth through smart automation and targeted outreach.
- [ActiveTrail](https://composio.dev/toolkits/active_trail) - ActiveTrail is a user-friendly email marketing and automation platform. It helps you reach subscribers and automate campaigns with ease.
- [Adobe Marketing Agent MCP](https://composio.dev/toolkits/adobe_marketing_agent_mcp) - Adobe Marketing Agent MCP is Adobe's hosted MCP service that exposes marketing context, preferences, and agent capabilities. Use it to provide agents with campaign, audience, and analytics context via a managed integration.
- [Ahrefs](https://composio.dev/toolkits/ahrefs) - Ahrefs is an SEO and marketing platform for site audits, keyword research, and competitor insights. It helps you improve search rankings and drive organic traffic.
- [AimTell](https://composio.dev/toolkits/aimtell) - AimTell is a web push notification platform for managing websites, subscribers, campaigns, segments, and delivery analytics. Use it to send targeted browser notifications and measure engagement across your web push campaigns.
- [Amcards](https://composio.dev/toolkits/amcards) - AMCards lets you create and mail personalized greeting cards online. Build stronger customer relationships with easy, automated card campaigns.
- [AWeber](https://composio.dev/toolkits/aweber) - AWeber is an email marketing platform for creating campaigns, lists, and landing pages. It helps businesses automate email outreach and measure subscriber engagement.
- [Beamer](https://composio.dev/toolkits/beamer) - Beamer is a news and changelog platform for in-app announcements and feature updates. It helps companies boost user engagement by sharing news where users are most active.
- [Beehiiv](https://composio.dev/toolkits/beehiiv) - Beehiiv is a newsletter platform for creating and managing publications and subscribers. It helps grow audience engagement and monetize your mailing list.
- [Benchmark email](https://composio.dev/toolkits/benchmark_email) - Benchmark Email is a platform for creating, sending, and tracking email campaigns. It's built to help you engage audiences and analyze results—all in one place.
- [Bigmailer](https://composio.dev/toolkits/bigmailer) - BigMailer is an email marketing platform for managing multiple brands with white-labeling and automation. It helps teams streamline campaigns and simplify integration with Amazon SES.
- [Bitly](https://composio.dev/toolkits/bitly) - Bitly is a link management platform for shortening, customizing, sharing, and tracking links and QR codes. It helps teams create branded links and measure engagement across campaigns.
- [BlueFox Email](https://composio.dev/toolkits/bluefox_email) - BlueFox Email is an email API for managing contacts, subscriber lists, and sending transactional and triggered messages. Use it to reliably send transactional and triggered emails and manage subscribers at scale.
- [Brandfetch](https://composio.dev/toolkits/brandfetch) - Brandfetch is an API that delivers company logos, colors, and visual branding assets. It helps marketers and developers keep brand visuals consistent everywhere.
- [Braze](https://composio.dev/toolkits/braze) - Braze is a customer engagement platform for managing user data, messaging, campaigns, and analytics. Use it to deliver targeted, multi-channel messaging and analyze campaign performance.
- [Brevo](https://composio.dev/toolkits/brevo) - Brevo is an all-in-one email and SMS marketing platform for transactional messaging, automation, and CRM. It helps businesses engage customers and streamline communications through powerful campaign tools.
- [Buffer](https://composio.dev/toolkits/buffer) - Buffer is a social media management platform for planning, creating, scheduling, and publishing posts across connected channels. It helps teams keep content organized and publish consistently without jumping between social apps.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Resend MCP?

With a standalone Resend MCP server, the agents and LLMs can only access a fixed set of Resend tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Resend and many other apps based on the task at hand, all through a single MCP endpoint.

### Can I use Tool Router MCP with CrewAI?

Yes, you can. CrewAI fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Resend tools.

### Can I manage the permissions and scopes for Resend while using Tool Router?

Yes, absolutely. You can configure which Resend scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

### How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Resend data and credentials are handled as safely as possible.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
