# How to integrate Etermin MCP with CrewAI

```json
{
  "title": "How to integrate Etermin MCP with CrewAI",
  "toolkit": "Etermin",
  "toolkit_slug": "etermin",
  "framework": "CrewAI",
  "framework_slug": "crew-ai",
  "url": "https://composio.dev/toolkits/etermin/framework/crew-ai",
  "markdown_url": "https://composio.dev/toolkits/etermin/framework/crew-ai.md",
  "updated_at": "2026-05-12T10:10:41.242Z"
}
```

## Introduction

This guide walks you through connecting Etermin to CrewAI using the Composio tool router. By the end, you'll have a working Etermin agent that can add new client contact for booking, remove canceled appointment from calendar, create voucher for returning customer through natural language commands.
This guide will help you understand how to give your CrewAI agent real control over a Etermin account through Composio's Etermin MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Etermin with

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

## TL;DR

Here's what you'll learn:
- Get a Composio API key and configure your Etermin connection
- Set up CrewAI with an MCP enabled agent
- Create a Tool Router session or standalone MCP server for Etermin
- Build a conversational loop where your agent can execute Etermin 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 Etermin MCP server, and what's possible with it?

The Etermin MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Etermin account. It provides structured and secure access to your appointment scheduling system, so your agent can perform actions like creating contacts, managing bookings, updating resources, and handling calendar events on your behalf.
- Automated contact and user creation: Instantly add new clients or team members to your Etermin account, streamlining onboarding and customer management.
- Effortless appointment and calendar management: Let your agent delete existing appointments or calendars, freeing up schedules and reducing manual work.
- Resource and service administration: Automatically create or remove resources and services, ensuring your booking system stays current as your business evolves.
- Voucher and webhook setup: Quickly generate new vouchers for promotions or set up webhooks for real-time event notifications and integrations.
- Contact and service deletion: Easily remove outdated contacts or services, keeping your scheduling platform organized and clutter-free.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `ETERMIN_ASSIGN_CALENDAR_SERVICE` | Assign Calendar Service | Tool to assign a service to a calendar in eTermin. Use when you need to link a specific service to a calendar/employee resource, making the service available for that calendar. |
| `ETERMIN_CREATE_ABSENCE` | Create Absence | Tool to create an absence (non-working time) for a specific calendar. Use when you need to block time on a calendar for unavailability such as vacations, sick leave, or other non-working periods. |
| `ETERMIN_CREATE_ANCHORTIME` | Create Anchortime | Tool to create anchortimes (recurring time slots) in a calendar. Use when you need to define regular appointment availability. |
| `ETERMIN_CREATE_ANCHORTIME_BY_DATE` | Create Anchortime by Date | Tool to create anchortimes by date. Use when you need to block specific time slots on a calendar. Anchortimes define blocked periods for calendar scheduling where appointments cannot be booked. |
| `ETERMIN_CREATE_APPOINTMENT` | Create Appointment | Tool to create a new appointment in eTermin. Use when you need to schedule an appointment with specific start/end times and calendar. Requires at minimum the start time, end time, and calendar ID. Optionally accepts customer details, service information, pricing, and notification settings. |
| `ETERMIN_CREATE_APPOINTMENT_SYNC` | Create Appointment via Sync | Tool to create an appointment via sync in eTermin. Use when you need to synchronize an appointment from an external calendar system. Requires date/time in both local and UTC formats along with calendar ID, summary, and description. |
| `ETERMIN_CREATE_CALENDAR_RETURN_TIME` | Create Calendar Return Time | Tool to create a return time for a calendar. Use when scheduling recurring return times or availability windows for a specific weekday. Return times define when a calendar resource becomes available after being occupied. |
| `ETERMIN_CREATE_CONTACT` | Create Contact | Tool to create a new contact in eTermin. Use when you need to add a contact before scheduling appointments. |
| `ETERMIN_CREATE_SERVICE` | Create Service | Tool to create a new service in eTermin. Use when you need to add a service to a service group with specified duration and settings. |
| `ETERMIN_CREATE_SERVICE_GROUP` | Create Service Group | Tool to create a new service group in eTermin. Use when you need to organize services into groups for better booking page structure. Service groups help categorize services and control how they are displayed to customers during booking. |
| `ETERMIN_CREATE_USER` | Create User | Tool to create a new user. Use when you need to add users to eTermin after collecting their details. |
| `ETERMIN_CREATE_USERMAPPING` | Create Usermapping | Tool to create a new usermapping in eTermin. Use when you need to map phone numbers or other values to specific calendars and service groups. |
| `ETERMIN_CREATE_VOUCHER` | Create Voucher | Creates a new discount voucher in eTermin. Use this to set up promotional codes that customers can apply during booking. Supports both percentage and fixed amount discounts. |
| `ETERMIN_CREATE_WEBHOOK` | Create Webhook | Creates a webhook (web push notification) in eTermin to receive real-time updates about appointments. IMPORTANT: eTermin webhook configuration is typically managed through the web UI at API > API & Web Push. This action attempts API-based creation but will return a helpful message with UI instructions if the API endpoint is not available for your tenant. Webhooks can notify your application when appointments are created, modified, or deleted. Configure the webhook URL, optional authentication headers, and secret key for signature verification. |
| `ETERMIN_CREATE_WORKING_TIME` | Create Working Time | Tool to create a new working time slot in eTermin. Use when defining available time slots for appointments on a calendar. |
| `ETERMIN_CREATE_WORKING_TIMES_DATE` | Create Working Times Date | Tool to create a working times date slot for a calendar. Use when you need to define available time slots for appointments. |
| `ETERMIN_DELETE_ABSENCE` | Delete Absence | Tool to delete an absence (non-working time) from a calendar. Use when you need to remove a blocked time period from a calendar's availability. |
| `ETERMIN_DELETE_ANCHORTIME` | Delete Anchortime | Delete an anchortime from eTermin by its ID. Use this when you need to permanently remove an anchortime entry from the system. Note: This action is irreversible. |
| `ETERMIN_DELETE_ANCHORTIME_BY_DATE` | Delete Anchortime By Date | Delete an anchortime by date using its ID. Use when you need to remove a specific anchortime entry by date. Returns a success indicator along with any error messages if the deletion fails. |
| `ETERMIN_DELETE_APPOINTMENT` | Delete Appointment | Delete an existing appointment by its ID. Use the GET appointments action first to retrieve valid appointment IDs. Returns a success indicator along with any error messages if the deletion fails. |
| `ETERMIN_DELETE_APPOINTMENT_SYNC` | Delete Appointment via Sync | Tool to delete appointments via the sync endpoint. Use when you need to delete one or more appointments by ID or date range. Provide either an appointmentid for single deletion, or start/end dates for bulk deletion within a time range. |
| `ETERMIN_DELETE_CALENDAR` | Delete Calendar | Delete a calendar from your eTermin account. Use this tool to permanently remove a calendar by its ID. The calendar and all associated data will be deleted. This operation is idempotent - deleting a non-existent calendar will still return success. To find calendar IDs, first use ETERMIN_GET_CALENDARS to list all calendars. |
| `ETERMIN_DELETE_CALENDAR_RETURN_TIME` | Delete Calendar Return Time | Delete a return time from a calendar. Use when you need to remove a specific return time entry. |
| `ETERMIN_DELETE_CALENDAR_SERVICE` | Delete Calendar Service | Delete an assigned service from a calendar in eTermin. Use this action to remove a service assignment from a specific calendar by providing both the service assignment ID and the calendar ID. The deletion is permanent. |
| `ETERMIN_DELETE_CONTACT` | Delete Contact | Delete a contact from your eTermin account by its contact ID. Use this action when you need to permanently remove a contact from the system. The contact ID can be obtained using the Get Contacts action. Note: This action is irreversible. The contact will be permanently deleted. |
| `ETERMIN_DELETE_RESOURCE` | Delete Resource | Delete an eTermin resource by type and ID. Supports deleting contacts, services, users, calendars, vouchers, and working times. The resource ID can be obtained from listing or creating resources. |
| `ETERMIN_DELETE_SERVICE` | Delete Service | Permanently deletes a service from your eTermin account by its ID. Use this action to remove services that are no longer needed. The deletion is permanent and cannot be undone. Services with associated appointments may not be deletable. Before deleting, use the Get Services action to retrieve service IDs and verify which service you want to delete. |
| `ETERMIN_DELETE_SERVICEGROUP` | Delete Service Group | Delete a service group from your eTermin account by its ID. Use this action when you need to permanently remove a service group from the system. The deletion is permanent and cannot be undone. |
| `ETERMIN_DELETE_USER` | Delete User | Deletes an existing user from the eTermin account. Use the get_users action first to retrieve the user ID. The deletion is idempotent - deleting a non-existent user will not cause an error. |
| `ETERMIN_DELETE_USERMAPPING` | Delete Usermapping | Delete a usermapping by its ID. Use this action when you need to remove a usermapping from the eTermin system. |
| `ETERMIN_DELETE_VOUCHER` | Delete Voucher | Permanently deletes a voucher from eTermin by its voucher code. The operation is idempotent - deleting a non-existent voucher will still return success. Use the List Vouchers action first to get valid voucher codes if needed. |
| `ETERMIN_DELETE_WEBHOOK` | Delete Webhook | Delete an existing webhook by its unique identifier. Note: eTermin's webhook deletion endpoint is undocumented. This action attempts multiple candidate endpoints and returns a graceful message if webhook deletion is not supported via API for the tenant. In that case, users should manage webhooks through the eTermin web UI. |
| `ETERMIN_DELETE_WORKING_TIMES` | Delete Working Times | Tool to delete working times from a calendar. Use when removing time slots or clearing all working times from a calendar. If no specific working time ID is provided, all working slots for the calendar will be deleted. |
| `ETERMIN_DELETE_WORKING_TIMES_DATE` | Delete Working Times Date | Tool to delete working times date entries from eTermin. Use when removing working time slots by calendar or specific ID. Provide either calendarid to delete all working slots for a calendar, or id to delete a specific working time entry. |
| `ETERMIN_GET_ABSENCES` | Get Absences | Tool to retrieve absences (non-working times) for a specific calendar. Use when you need to check when a calendar is unavailable for appointments. |
| `ETERMIN_GET_ANCHORTIME_DATE` | Get Anchortime by Date | Tool to retrieve anchortimes by date. Use when you need to get existing anchortimes for calendars. Anchortimes define specific time slots or blocked periods for calendar scheduling. |
| `ETERMIN_GET_ANCHORTIMES` | Get Anchortimes | Tool to retrieve anchortime details. Use when you need to get anchortimes for calendars in your eTermin account. |
| `ETERMIN_GET_APPOINTMENT_SYNC` | Get Appointment Sync | Tool to synchronize appointments incrementally from eTermin. Use when you need to sync appointments using a sync token. For first sync, use synctoken=1. The API returns a new sync token in the response header for subsequent syncs. |
| `ETERMIN_GET_BOOKINGPAGE_LOGS` | Get Bookingpage Logs | Tool to retrieve bookingpage request logs from eTermin. Use when you need to analyze bookingpage access patterns and requests. |
| `ETERMIN_GET_CALENDAR_RETURN_TIME` | Get Calendar Return Time | Tool to retrieve return times for a specific calendar. Use when you need to get the configured return time periods for a calendar. |
| `ETERMIN_GET_CALENDARS` | Get Calendars | Tool to retrieve calendars. Use when listing all calendars in your eTermin account. |
| `ETERMIN_GET_CALENDARSERVICE` | Get Calendar Service Assignments | Tool to retrieve calendar service assignments. Use when you need to get services assigned to calendars in your eTermin account. |
| `ETERMIN_GET_COMPANY` | Get Company | Tool to retrieve company account details. Use when you need to get all company information from your eTermin account. |
| `ETERMIN_GET_CONTACT_BY_ID` | Get Contact By ID | Tool to retrieve a specific contact by ID, external ID, or email. Use when you need to get details of a single contact from eTermin. Provide at least one of: cid (internal ID), id (external UUID), or email. |
| `ETERMIN_GET_CONTACTS` | Get Contacts | Tool to retrieve a list of contacts. Use when you need to list all contacts in your eTermin account. |
| `ETERMIN_GET_DELETED_APPOINTMENTS` | Get Deleted Appointments | Tool to retrieve a list of deleted appointments from eTermin. Use when you need to track or audit deleted appointments, optionally filtered by deletion date range. Returns details including who deleted the appointment, when it was deleted, and the original appointment information. |
| `ETERMIN_GET_MESSAGE_LOGS` | Get Message Logs | Tool to retrieve message logs from eTermin. Use when you need to view emails and SMS that have been sent through the system. Returns details about sent messages including receiver, subject, date sent, and message type. |
| `ETERMIN_GET_RATING` | Get Customer Ratings | Tool to retrieve a list of customer ratings from eTermin. Use when you need to get feedback and ratings from customers for appointments. Returns rating details including customer feedback, rating score, and reply status. |
| `ETERMIN_GET_SERVICE_BY_ID` | Get Service By ID | Tool to retrieve a specific service from eTermin. Use when you need to get service details by service ID. |
| `ETERMIN_GET_SERVICE_CALENDAR` | Get Service Calendar | Tool to retrieve calendars for a specific service ID. Use when you need to find which calendars are associated with a particular service. |
| `ETERMIN_GET_SERVICEGROUP` | Get Service Group | Tool to retrieve service group details from eTermin. Use when you need to list service groups or get specific service group information by ID or language. |
| `ETERMIN_GET_SERVICES` | Get Services | Tool to retrieve a list of services. Use when you need to list available services in your eTermin account. |
| `ETERMIN_GET_SURVEY_RESULTS` | Get Survey Results | Tool to retrieve survey results from eTermin. Use when you need to get customer feedback and survey responses. Returns survey questions, answers, timestamps, and associated calendar/employee information. |
| `ETERMIN_GET_TIMESLOTS` | Get Timeslots | Tool to retrieve available timeslots for a specific calendar on a given date. Use when you need to check booking availability for a particular calendar. |
| `ETERMIN_GET_USERMAPPING` | Get Usermapping | Tool to retrieve usermapping information. Use when you need to get usermapping details or validate number search values. |
| `ETERMIN_GET_USERS` | Get Users | Tool to retrieve a list of users. Use when you need to list all users in your eTermin account. |
| `ETERMIN_GET_WORKING_TIMES` | Get Working Times | Tool to retrieve working times for a specific calendar. Use when confirming available time slots before booking appointments. |
| `ETERMIN_GET_WORKING_TIMES_DATE` | Get Working Times Date | Tool to retrieve working times for a specific calendar on a specific date. Use when checking available time slots for a particular date before booking appointments. |
| `ETERMIN_LIST_APPOINTMENTS` | List Appointments | Tool to retrieve a filtered list of appointments from eTermin in a specified date range. Use when you need to search for appointments by date range, calendar, customer, or other criteria. Returns appointment details including date/time, customer info, and service information. |
| `ETERMIN_LIST_VOUCHERS` | List Vouchers | Retrieve all vouchers (discount codes) from your eTermin account. Use this tool when you need to: - View all active and expired vouchers - Check voucher usage statistics (ContingentCounter vs ContingentMax) - Find voucher codes to share with customers - Monitor voucher validity periods Returns a list of vouchers with their discount values, validity dates, and usage restrictions. |
| `ETERMIN_LIST_WEBHOOKS` | List Webhooks | Tool to retrieve webhooks. Use when listing all webhooks in your eTermin account. |
| `ETERMIN_PUT_SERVICE` | Update Service via PUT | Tool to update a service in eTermin. Use when you need to modify service settings or configuration. |
| `ETERMIN_UPDATE_ABSENCE` | Update Absence | Tool to update an absence (non-working time) for a calendar in eTermin. Use when you need to modify an existing absence's dates, reason, or settings. |
| `ETERMIN_UPDATE_ANCHORTIME` | Update Anchortime | Update an existing anchortime in eTermin. Use this to modify anchortime settings such as start time, weekday, calendar assignment, or booking ignore behavior. The anchortime ID must be provided to identify which anchortime to update. |
| `ETERMIN_UPDATE_ANCHORTIME_BY_DATE` | Update Anchortime By Date | Tool to update anchortimes by date in eTermin. Use when you need to modify an existing anchortime's schedule. Anchortimes define recurring time slots for appointments on specific dates. |
| `ETERMIN_UPDATE_APPOINTMENT` | Update Appointment | Tool to update an existing appointment in eTermin. Use when you need to modify appointment details such as date/time, customer information, or service details. Only the appointment ID is required; provide only the fields you want to update. |
| `ETERMIN_UPDATE_CALENDAR` | Update Calendar | Update an existing calendar in eTermin. Use this tool to modify calendar settings such as name, description, capacity settings, and other configuration options. You must provide the calendar_id obtained from the get_calendars action. The eTermin API uses PUT /api/calendar with form-urlencoded data, where the calendar to update is specified by the 'id' parameter. |
| `ETERMIN_UPDATE_CALENDAR_RETURN_TIME` | Update Calendar Return Time | Tool to update a return time for a calendar in eTermin. Use when modifying existing return time settings such as start time, end time, weekday, or overnight settings. |
| `ETERMIN_UPDATE_CONTACT` | Update Contact | Tool to update an existing contact in eTermin. Use when you need to modify contact details by ID after confirming it exists. |
| `ETERMIN_UPDATE_RESOURCE` | Update Resource | Update an existing eTermin resource (contact, service, calendar, user, or voucher). The eTermin API requires PUT requests to the collection endpoint with form-urlencoded data including the resource ID in the body. ID field names by resource type: - contact: 'cid' - service: 'id' - calendar: 'id' - user: 'id' - voucher: 'id' |
| `ETERMIN_UPDATE_SERVICE` | Update Service | Tool to update an existing service. Use when you need to modify service details after confirming the service ID. |
| `ETERMIN_UPDATE_SERVICE_GROUP` | Update Service Group | Tool to update an existing service group in eTermin. Use when you need to modify service group properties such as name, display settings, or selection behavior. |
| `ETERMIN_UPDATE_SYNC_APPOINTMENT` | Update Synchronised Appointment | Tool to update a synchronised appointment in eTermin. Use when you need to modify an existing synced appointment with updated date/time, location, or other details. Requires the appointment ID (ExternalID) and updated date/time in both local and UTC formats. |
| `ETERMIN_UPDATE_USERMAPPING` | Update Usermapping | Update an existing usermapping in eTermin. Use this when you need to modify usermapping search criteria, calendar assignments, or service group mappings. |
| `ETERMIN_UPDATE_VOUCHER` | Update Voucher | Updates an existing voucher in eTermin. Use this to modify voucher properties such as description, discount amount, validity dates, or usage limits. The voucher must already exist - use ETERMIN_CREATE_VOUCHER to create new vouchers. |
| `ETERMIN_UPDATE_WEBHOOK` | Update Webhook | Update an existing webhook configuration in eTermin. Use this action to modify webhook settings such as the notification email, enable/disable web push notifications, or update the webhook endpoint URL. Note: eTermin webhook management is often only available through the web UI (Configuration -> Integration - API -> API tab). If the API does not support updates for your tenant, this action will return success=False with an informative message. Prerequisites: Use 'List Webhooks' to obtain a valid webhook_id. |
| `ETERMIN_UPDATE_WORKING_TIMES` | Update Working Times | Tool to update working times for a calendar in eTermin. Use when you need to modify existing working time slots, including their start/end times, weekdays, capacity limits, and other scheduling configurations. |
| `ETERMIN_UPDATE_WORKING_TIMES_DATE` | Update Working Times Date | Tool to update working times date for a calendar. Use when modifying existing working time slots for appointments. |

## Supported Triggers

None listed.

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

The Etermin MCP server is an implementation of the Model Context Protocol that connects your AI agent to Etermin. It provides structured and secure access so your agent can perform Etermin 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 Etermin 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 Etermin 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 Etermin 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 Etermin

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

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=["etermin"],
)
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 Etermin through Composio's Tool Router. The agent can perform Etermin 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 Etermin MCP Agent with another framework

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

## Related Toolkits

- [Google Calendar](https://composio.dev/toolkits/googlecalendar) - Google Calendar is a time management service for scheduling meetings, events, and reminders. It streamlines personal and team organization with integrated notifications and sharing options.
- [Apaleo](https://composio.dev/toolkits/apaleo) - Apaleo is a cloud-based property management platform for hospitality businesses. It centralizes reservations, billing, and daily operations for smoother hotel management.
- [Appointo](https://composio.dev/toolkits/appointo) - Appointo is an appointment booking platform for Shopify stores. It lets businesses add online scheduling to their websites with zero coding.
- [Bart](https://composio.dev/toolkits/bart) - Bart is the Bay Area Rapid Transit system, providing fast public transportation across the San Francisco Bay Area. It helps commuters and travelers get real-time schedule info, plan routes, and stay updated on service changes.
- [Bookingmood](https://composio.dev/toolkits/bookingmood) - Bookingmood is commission-free booking software for rental businesses. It lets you manage reservations and sync bookings directly on your website.
- [Booqable](https://composio.dev/toolkits/booqable) - Booqable is a rental software platform for managing inventory, bookings, and reservations. It helps businesses streamline rentals and keep track of every item with ease.
- [Cal](https://composio.dev/toolkits/cal) - Cal is a meeting scheduling platform that offers shareable booking links and real-time calendar syncing. It streamlines the process of finding mutual availability to make scheduling effortless.
- [Calendarhero](https://composio.dev/toolkits/calendarhero) - Calendarhero is a powerful scheduling platform that streamlines your calendar management across multiple services. It helps you efficiently schedule, reschedule, and organize meetings without the back-and-forth.
- [Calendly](https://composio.dev/toolkits/calendly) - Calendly is an appointment scheduling tool that automates meeting invitations, availability checks, and reminders. It helps individuals and teams avoid endless email back-and-forth when booking meetings.
- [Evenium](https://composio.dev/toolkits/evenium) - Evenium is an all-in-one platform for managing professional events, from planning to analysis. It helps teams simplify event logistics, boost engagement, and track every detail in one place.
- [Eventee](https://composio.dev/toolkits/eventee) - Eventee is a user-friendly event management platform for mobile and web. It boosts attendee engagement for in-person, virtual, and hybrid events.
- [Eventzilla](https://composio.dev/toolkits/eventzilla) - Eventzilla is an event management platform for creating, promoting, and running events. It streamlines ticketing, registration, and attendee coordination for organizers.
- [Humanitix](https://composio.dev/toolkits/humanitix) - Humanitix is a not-for-profit ticketing platform that donates 100% of profits to charity. It empowers event organizers to make social impact with every ticket sold.
- [Lodgify](https://composio.dev/toolkits/lodgify) - Lodgify is an all-in-one vacation rental software for property managers and owners. It centralizes bookings, guest messaging, and channel synchronization in one dashboard.
- [Planyo Online Booking](https://composio.dev/toolkits/planyo_online_booking) - Planyo Online Booking is a flexible reservation system for managing bookings by day, hour, or event. It streamlines scheduling for any business needing reservations.
- [Scheduleonce](https://composio.dev/toolkits/scheduleonce) - Scheduleonce is a scheduling platform for capturing, qualifying, and engaging with inbound leads. It streamlines appointment booking and follow-ups for faster lead conversion.
- [Supersaas](https://composio.dev/toolkits/supersaas) - Supersaas is a flexible appointment scheduling platform for businesses and individuals. It streamlines bookings, reminders, and calendar management in one place.
- [Sympla](https://composio.dev/toolkits/sympla) - Sympla is a platform for managing in-person and online events, ticket sales, and registrations. It streamlines event setup, attendee tracking, and digital content delivery.
- [Gmail](https://composio.dev/toolkits/gmail) - Gmail is Google's email service with powerful spam protection, search, and G Suite integration. It keeps your inbox organized and makes communication fast and reliable.
- [Google Drive](https://composio.dev/toolkits/googledrive) - Google Drive is a cloud storage platform for uploading, sharing, and collaborating on files. It's perfect for keeping your documents accessible and organized across devices.

## Frequently Asked Questions

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

With a standalone Etermin MCP server, the agents and LLMs can only access a fixed set of Etermin tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Etermin 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 Etermin tools.

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

Yes, absolutely. You can configure which Etermin 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 Etermin data and credentials are handled as safely as possible.

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