# How to integrate Calendarhero MCP with OpenAI Agents SDK

```json
{
  "title": "How to integrate Calendarhero MCP with OpenAI Agents SDK",
  "toolkit": "Calendarhero",
  "toolkit_slug": "calendarhero",
  "framework": "OpenAI Agents SDK",
  "framework_slug": "open-ai-agents-sdk",
  "url": "https://composio.dev/toolkits/calendarhero/framework/open-ai-agents-sdk",
  "markdown_url": "https://composio.dev/toolkits/calendarhero/framework/open-ai-agents-sdk.md",
  "updated_at": "2026-11-06T08:58:29.998Z"
}
```

## Introduction

This guide walks you through connecting Calendarhero to the OpenAI Agents SDK using the Composio tool router. By the end, you'll have a working Calendarhero agent that can create meeting requests, manage contacts, list meeting types and calendars, send reminders, and message the scheduling assistant through natural language commands.
This guide will help you understand how to give your OpenAI Agents SDK agent real control over a Calendarhero account through Composio's Calendarhero MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Calendarhero with

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

## TL;DR

Here's what you'll learn:
- Get and set up your OpenAI and Composio API keys
- Install the necessary dependencies
- Initialize Composio and create a Tool Router session for Calendarhero
- Configure an AI agent that can use Calendarhero as a tool
- Run a live chat session where you can ask the agent to perform Calendarhero operations

## What is OpenAI Agents SDK?

The OpenAI Agents SDK is a lightweight framework for building AI agents that can use tools and maintain conversation state. It provides a simple interface for creating agents with hosted MCP tool support.
Key features include:
- Hosted MCP Tools: Connect to external services through hosted MCP endpoints
- SQLite Sessions: Persist conversation history across interactions
- Simple API: Clean interface with Agent, Runner, and tool configuration
- Streaming Support: Real-time response streaming for interactive applications

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

The Calendarhero MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Calendarhero account. It provides structured and secure access to your calendar management tools, so your agent can schedule meetings, manage contacts, fetch meeting details, and access your calendar integrations on your behalf.
- Automated meeting scheduling and requests: Easily have your agent schedule new meetings, select participants, set time ranges, and include extra meeting details in just a few steps.
- Contact creation and management: Let the agent create new contacts or fetch existing ones, so scheduling is always quick and accurate.
- Meeting details retrieval: Ask your agent to fetch specific meeting details or get a list of all meetings within a defined timeframe, keeping you up-to-date.
- Access and manage calendar integrations: Direct your agent to list all connected calendars, add new integrations, or access available calendars for streamlined scheduling.
- Template and meeting type discovery: Quickly retrieve available meeting templates and types, letting your agent optimize scheduling based on your preferences and routines.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `CALENDARHERO_ADD_CALENDAR_CONNECTION` | Add Calendar Connection | Add a new calendar directory/connection to the user's CalendarHero account. A directory is a calendar connection configuration that groups meeting types together. Use this to organize different types of meetings (e.g., sales calls, team meetings) under separate calendar connections. Returns the unique ID of the created directory. |
| `CALENDARHERO_CREATE_CONTACT` | Create Contact | Creates a new contact in CalendarHero with the provided contact information. Returns the unique identifier of the created contact. |
| `CALENDARHERO_CREATE_MEETING_REQUEST_V2` | Create Meeting Request V2 | Tool to create a new meeting request in CalendarHero. Use when scheduling a meeting with participants, time range, and additional details. |
| `CALENDARHERO_CREATE_WEBHOOK` | Create Webhook | Creates or updates a webhook for a specific event type in CalendarHero. Use this to register a URL endpoint that will receive notifications when events occur (e.g., when a meeting request succeeds or a new contact is added). |
| `CALENDARHERO_DELETE_CONTACT` | Delete Contact | Tool to delete a contact from CalendarHero by its unique identifier. Use when you need to permanently remove a contact from the system. |
| `CALENDARHERO_DELETE_MEETING_TASK` | Delete Meeting Task | Tool to delete a meeting task/request from CalendarHero. Use when you need to remove a meeting task by its ID. |
| `CALENDARHERO_DELETE_MEETING_TYPE` | Delete Meeting Type | Tool to delete a meeting type from the authenticated user's CalendarHero account. Use when you need to remove a meeting type configuration. Note: Cannot delete meeting types that have active or upcoming meetings scheduled. |
| `CALENDARHERO_DELETE_USER_DIRECTORY` | Delete User Directory | Tool to delete a user directory by its UUID. Use when you need to remove a directory from the user's account. |
| `CALENDARHERO_DELETE_WEBHOOK` | Delete Webhook | Tool to delete a webhook subscription for a specific event type. Use when you need to remove a webhook listener that was previously registered for CalendarHero events. |
| `CALENDARHERO_FETCH_CONTACT` | Fetch Contact | Fetch Contact |
| `CALENDARHERO_FETCH_MEETING_DETAILS` | Fetch Meeting Details | Fetches meeting details for a specified time range. Provide the start and end datetimes in ISO 8601 format. |
| `CALENDARHERO_FETCH_USER_PROFILE` | Fetch User Profile | Tool to fetch the profile details of the authenticated user. Use after obtaining a valid access token. |
| `CALENDARHERO_GET_ASSISTANT_MESSAGE` | Get Assistant Message | Tool to retrieve a reply message from the CalendarHero assistant. Use when you need to get an automated response or greeting from the assistant for the user. |
| `CALENDARHERO_GET_CONTACT_COUNT` | Get Contact Count | Tool to get the total count of contacts in CalendarHero. Use when you need to know how many contacts exist. |
| `CALENDARHERO_GET_MEETING_CATEGORIES` | Get Meeting Categories | Retrieves the user's meeting categories' stats for a specified time period. Use to analyze meeting distribution across different categories or types within a given month. |
| `CALENDARHERO_GET_MEETING_TASKS` | Get Meeting Tasks | Retrieves the user's meeting requests/tasks from CalendarHero. Use when you need to check pending meeting requests, view scheduling tasks, or track meeting coordination progress. Supports filtering by state (active/upcoming/closed), pagination, and meeting type. |
| `CALENDARHERO_GET_SEARCH_RESULT` | Get Search Result | Tool to get a search result by ID. Use when you have a search result ID from a previous /search request. |
| `CALENDARHERO_GET_USER_DIRECTORY` | Get User Directory | Tool to retrieve a user's directory by its unique identifier. Use when you need to fetch configuration details for a specific directory including meeting types and tracking settings. |
| `CALENDARHERO_GET_USER_ORGANIZATION` | Get User Organization | Tool to retrieve the authenticated user's organization details. Use when needing organization-level information. |
| `CALENDARHERO_GET_USER_SAVINGS` | Get User Savings | Tool to retrieve the authenticated user's savings information from CalendarHero. Use to view time saved, efficiency metrics, or other savings data tracked by the platform. |
| `CALENDARHERO_GET_WEBHOOK` | Get Webhook Configuration | Retrieves webhook configuration for a specific meeting or contact event type. The returned URL can be null for some response shapes, so a null result does not necessarily establish that no webhook is configured. |
| `CALENDARHERO_GET_WEBHOOK_SAMPLE` | Get Webhook Sample | Tool to retrieve a sample webhook payload for a specific event type. Use when testing webhook integrations or understanding the structure of webhook data for different CalendarHero events. |
| `CALENDARHERO_LIST_MEETING_TEMPLATES` | List Meeting Templates | Lists the authenticated user's meeting templates, which are reusable scheduling configurations. Use this to discover meeting type options before creating meetings; templates can include settings such as duration, availability and video conferencing preferences. |
| `CALENDARHERO_LIST_MEETING_TYPES` | List Meeting Types | Retrieves all meeting types configured for the authenticated CalendarHero user. Meeting types are templates that define availability windows, durations, and booking URLs for different kinds of meetings (e.g., 'coffee', 'call', 'meeting'). Each meeting type has: - A unique identifier (e.g., 'coffee', 'call', 'meeting') - Availability windows (days and hours when meetings can be scheduled) - Booking URL for on-demand scheduling - Configuration for duration, timezone, notice period, etc. Use onlyTypes=true to get just the list of meeting type identifiers. Use onlyTypes=false (or omit) to get full configurations including all settings. This is a read-only operation that doesn't modify any data. |
| `CALENDARHERO_LIST_USER_CALENDARS` | List User Calendars | Tool to list all calendar integrations connected to a user's CalendarHero account. Use after authenticating when you need to retrieve available calendars for scheduling. |
| `CALENDARHERO_LIST_USER_DIRECTORIES` | List User Directories | Tool to retrieve all directories configured for a user. Use when you need to list available directories for scheduling or configuration purposes. |
| `CALENDARHERO_SEARCH_CONTACT` | Search Contact | Tool to search for existing contacts. Use after confirming a need to find contacts by email or name. |
| `CALENDARHERO_SEARCH_INTEGRATIONS` | Search Integrations | Tool to search across all user integrations for a query term. Use when you need to find events, meetings, or other data matching specific keywords across the user's connected calendar and productivity integrations. |
| `CALENDARHERO_SEND_ASSISTANT_MESSAGE` | Send Assistant Message | Tool to send a user's message into the CalendarHero assistant. Use this to interact with the assistant using natural language for scheduling meetings, managing calendar events, or other calendar-related tasks. |
| `CALENDARHERO_SEND_REMINDER` | Send Reminder | Sends an email reminder to all contacts/participants about a scheduled meeting request. Use this to notify attendees who need a reminder about an upcoming meeting. Requires the meeting task ID from a previously created meeting request. |
| `CALENDARHERO_UPDATE_CONTACT` | Update Contact | Updates an existing CalendarHero contact by ID, including details such as name, title, organization, and phone numbers. A nonempty email list is required and replaces existing emails, so include every address to keep; the primary email can also be set. |
| `CALENDARHERO_UPDATE_MEETING_TYPES` | Update Meeting Types | Tool to update meeting type configurations for the authenticated CalendarHero user. Use when you need to modify existing meeting types' availability, durations, or settings. IMPORTANT: The meeting type name must already exist in the user's profile. To get existing meeting types, first use LIST_MEETING_TYPES action. This action updates properties like availability windows, notice periods, on-demand URLs, and other meeting-specific settings. Example: Update the 'coffee' meeting type to change the notice period from 4 hours to 5 hours, or modify the availability windows to only allow Monday-Wednesday bookings. |
| `CALENDARHERO_UPDATE_RESTRICTED_APPS` | Update Restricted Apps | Updates the authenticated user's restricted apps settings using a list of app identifiers. If the list is omitted, the request sends an empty list. |
| `CALENDARHERO_UPDATE_USER` | Update User | Tool to update the authenticated user's profile information. Use when you need to modify user details such as name, email, timezone, or preferences. |
| `CALENDARHERO_UPDATE_USER_ADDRESS` | Update User Address | Tool to update the authenticated user's address settings by providing latitude and longitude coordinates. Use when the user needs to update their location for meeting scheduling or time zone detection. |
| `CALENDARHERO_UPDATE_USER_DIRECTORY` | Update User Directory | Tool to update a user's directory in CalendarHero. Use when modifying directory settings such as title, meeting types, or configuration options. The directory UUID can be obtained from the user profile or directory listing endpoints. Ensure the directoryId in the request body matches the UUID path parameter. |
| `CALENDARHERO_UPDATE_USER_INFO` | Update User Info | Updates the authenticated user's info settings in CalendarHero. Use this action when you need to modify user profile details such as name, language, timezone, contact information, or display preferences. Only the fields provided in the request will be updated; all other fields remain unchanged. This allows for partial updates without affecting other user settings. |
| `CALENDARHERO_UPDATE_WORK_LOCATION` | Update Work Location | Tool to update the user's work location settings in CalendarHero. Use when the user needs to change their work location (e.g., 'Office', 'Home', 'Remote'). |

## Supported Triggers

None listed.

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

The Calendarhero MCP server is an implementation of the Model Context Protocol that connects your AI agent to Calendarhero. It provides structured and secure access so your agent can perform Calendarhero 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:
- Composio API Key and OpenAI API Key
- Primary know-how of OpenAI Agents SDK
- A live Calendarhero project
- Some knowledge of Python or Typescript

### 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).
- Go to Settings and copy your API key.

### 2. Install dependencies

Install the Composio SDK and the OpenAI Agents SDK.
```python
pip install composio_openai_agents openai-agents python-dotenv
```

```typescript
npm install @composio/openai-agents @openai/agents dotenv
```

### 3. Set up environment variables

Create a .env file and add your OpenAI and Composio API keys.
```bash
OPENAI_API_KEY=sk-...your-api-key
COMPOSIO_API_KEY=your-api-key
USER_ID=composio_user@gmail.com
```

### 4. Import dependencies

What's happening:
- You're importing all necessary libraries.
- The Composio and OpenAIAgentsProvider classes are imported to connect your OpenAI agent to Composio tools like Calendarhero.
```python
import asyncio
import os
from dotenv import load_dotenv

from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner, HostedMCPTool, SQLiteSession
```

```typescript
import 'dotenv/config';
import { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, hostedMcpTool, run, OpenAIConversationsSession } from '@openai/agents';
import * as readline from 'readline';
```

### 5. Set up the Composio instance

No description provided.
```python
load_dotenv()

api_key = os.getenv("COMPOSIO_API_KEY")
user_id = os.getenv("USER_ID")

if not api_key:
    raise RuntimeError("COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key")

# Initialize Composio
composio = Composio(api_key=api_key, provider=OpenAIAgentsProvider())
```

```typescript
dotenv.config();

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.USER_ID;

if (!composioApiKey) {
  throw new Error('COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key');
}
if (!userId) {
  throw new Error('USER_ID is not set');
}

// Initialize Composio
const composio = new Composio({
  apiKey: composioApiKey,
  provider: new OpenAIAgentsProvider(),
});
```

### 6. Create a Tool Router session

What is happening:
- You give the Tool Router the user id and the toolkits you want available. Here, it is only calendarhero.
- The router checks the user's Calendarhero connection and prepares the MCP endpoint.
- The returned session.mcp.url is the MCP URL that your agent will use to access Calendarhero.
- This approach keeps things lightweight and lets the agent request Calendarhero tools only when needed during the conversation.
```python
# Create a Calendarhero Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["calendarhero"]
)

mcp_url = session.mcp.url
```

```typescript
// Create Tool Router session for Calendarhero
const session = await composio.create(userId as string, {
  toolkits: ['calendarhero'],
});
const mcpUrl = session.mcp.url;
```

### 7. Configure the agent

No description provided.
```python
# Configure agent with MCP tool
agent = Agent(
    name="Assistant",
    model="gpt-5",
    instructions=(
        "You are a helpful assistant that can access Calendarhero. "
        "Help users perform Calendarhero operations through natural language."
    ),
    tools=[
        HostedMCPTool(
            tool_config={
                "type": "mcp",
                "server_label": "tool_router",
                "server_url": mcp_url,
                "headers": {"x-api-key": api_key},
                "require_approval": "never",
            }
        )
    ],
)
```

```typescript
// Configure agent with MCP tool
const agent = new Agent({
  name: 'Assistant',
  model: 'gpt-5',
  instructions:
    'You are a helpful assistant that can access Calendarhero. Help users perform Calendarhero operations through natural language.',
  tools: [
    hostedMcpTool({
      serverLabel: 'tool_router',
      serverUrl: mcpUrl,
      headers: { 'x-api-key': composioApiKey },
      requireApproval: 'never',
    }),
  ],
});
```

### 8. Start chat loop and handle conversation

No description provided.
```python
print("\nComposio Tool Router session created.")

chat_session = SQLiteSession("conversation_openai_toolrouter")

print("\nChat started. Type your requests below.")
print("Commands: 'exit', 'quit', or 'q' to end\n")

async def main():
    try:
        result = await Runner.run(
            agent,
            "What can you help me with?",
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")
    except Exception as e:
        print(f"Error: {e}\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "q"}:
            print("Goodbye!")
            break

        result = await Runner.run(
            agent,
            user_input,
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")

asyncio.run(main())
```

```typescript
// Keep conversation state across turns
const conversationSession = new OpenAIConversationsSession();

// Simple CLI
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: 'You: ',
});

console.log('\nComposio Tool Router session created.');
console.log('\nChat started. Type your requests below.');
console.log("Commands: 'exit', 'quit', or 'q' to end\n");

try {
  const first = await run(agent, 'What can you help me with?', { session: conversationSession });
  console.log(`Assistant: ${first.finalOutput}\n`);
} catch (e) {
  console.error('Error:', e instanceof Error ? e.message : e, '\n');
}

rl.prompt();

rl.on('line', async (userInput) => {
  const text = userInput.trim();

  if (['exit', 'quit', 'q'].includes(text.toLowerCase())) {
    console.log('Goodbye!');
    rl.close();
    process.exit(0);
  }

  if (!text) {
    rl.prompt();
    return;
  }

  try {
    const result = await run(agent, text, { session: conversationSession });
    console.log(`\nAssistant: ${result.finalOutput}\n`);
  } catch (e) {
    console.error('Error:', e instanceof Error ? e.message : e, '\n');
  }

  rl.prompt();
});

rl.on('close', () => {
  console.log('\n👋 Session ended.');
  process.exit(0);
});
```

## Complete Code

```python
import asyncio
import os
from dotenv import load_dotenv

from composio import Composio
from composio_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner, HostedMCPTool, SQLiteSession

load_dotenv()

api_key = os.getenv("COMPOSIO_API_KEY")
user_id = os.getenv("USER_ID")

if not api_key:
    raise RuntimeError("COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key")

# Initialize Composio
composio = Composio(api_key=api_key, provider=OpenAIAgentsProvider())

# Create Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["calendarhero"]
)
mcp_url = session.mcp.url

# Configure agent with MCP tool
agent = Agent(
    name="Assistant",
    model="gpt-5",
    instructions=(
        "You are a helpful assistant that can access Calendarhero. "
        "Help users perform Calendarhero operations through natural language."
    ),
    tools=[
        HostedMCPTool(
            tool_config={
                "type": "mcp",
                "server_label": "tool_router",
                "server_url": mcp_url,
                "headers": {"x-api-key": api_key},
                "require_approval": "never",
            }
        )
    ],
)

print("\nComposio Tool Router session created.")

chat_session = SQLiteSession("conversation_openai_toolrouter")

print("\nChat started. Type your requests below.")
print("Commands: 'exit', 'quit', or 'q' to end\n")

async def main():
    try:
        result = await Runner.run(
            agent,
            "What can you help me with?",
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")
    except Exception as e:
        print(f"Error: {e}\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "q"}:
            print("Goodbye!")
            break

        result = await Runner.run(
            agent,
            user_input,
            session=chat_session
        )
        print(f"Assistant: {result.final_output}\n")

asyncio.run(main())
```

```typescript
import 'dotenv/config';
import { Composio } from '@composio/core';
import { OpenAIAgentsProvider } from '@composio/openai-agents';
import { Agent, hostedMcpTool, run, OpenAIConversationsSession } from '@openai/agents';
import * as readline from 'readline';

const composioApiKey = process.env.COMPOSIO_API_KEY;
const userId = process.env.USER_ID;

if (!composioApiKey) {
  throw new Error('COMPOSIO_API_KEY is not set. Create a .env file with COMPOSIO_API_KEY=your_key');
}
if (!userId) {
  throw new Error('USER_ID is not set');
}

// Initialize Composio
const composio = new Composio({
  apiKey: composioApiKey,
  provider: new OpenAIAgentsProvider(),
});

async function main() {
  // Create Tool Router session
  const session = await composio.create(userId as string, {
    toolkits: ['calendarhero'],
  });
  const mcpUrl = session.mcp.url;

  // Configure agent with MCP tool
  const agent = new Agent({
    name: 'Assistant',
    model: 'gpt-5',
    instructions:
      'You are a helpful assistant that can access Calendarhero. Help users perform Calendarhero operations through natural language.',
    tools: [
      hostedMcpTool({
        serverLabel: 'tool_router',
        serverUrl: mcpUrl,
        headers: { 'x-api-key': composioApiKey },
        requireApproval: 'never',
      }),
    ],
  });

  // Keep conversation state across turns
  const conversationSession = new OpenAIConversationsSession();

  // Simple CLI
  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: ',
  });

  console.log('\nComposio Tool Router session created.');
  console.log('\nChat started. Type your requests below.');
  console.log("Commands: 'exit', 'quit', or 'q' to end\n");

  try {
    const first = await run(agent, 'What can you help me with?', { session: conversationSession });
    console.log(`Assistant: ${first.finalOutput}\n`);
  } catch (e) {
    console.error('Error:', e instanceof Error ? e.message : e, '\n');
  }

  rl.prompt();

  rl.on('line', async (userInput) => {
    const text = userInput.trim();

    if (['exit', 'quit', 'q'].includes(text.toLowerCase())) {
      console.log('Goodbye!');
      rl.close();
      process.exit(0);
    }

    if (!text) {
      rl.prompt();
      return;
    }

    try {
      const result = await run(agent, text, { session: conversationSession });
      console.log(`\nAssistant: ${result.finalOutput}\n`);
    } catch (e) {
      console.error('Error:', e instanceof Error ? e.message : e, '\n');
    }

    rl.prompt();
  });

  rl.on('close', () => {
    console.log('\nSession ended.');
    process.exit(0);
  });
}

main().catch((err) => {
  console.error('Fatal error:', err);
  process.exit(1);
});
```

## Conclusion

This was a starter code for integrating Calendarhero MCP with OpenAI Agents SDK to build a functional AI agent that can interact with Calendarhero.
Key features:
- Hosted MCP tool integration through Composio's Tool Router
- SQLite session persistence for conversation history
- Simple async chat loop for interactive testing
You can extend this by adding more toolkits, implementing custom business logic, or building a web interface around the agent.

## How to build Calendarhero MCP Agent with another framework

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

## 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.
- [Blue Pillow Hotels & Stays](https://composio.dev/toolkits/bluepillow) - Blue Pillow Hotels & Stays is a hotel and stay discovery platform offering live offers, recommendations, and booking handoff. It helps surface and compare real-time deals and validate bookings for smoother reservations.
- [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.
- [Calendly MCP](https://composio.dev/toolkits/calendly_mcp) - Calendly is an appointment scheduling platform that manages event types, availability, and invites. Use it to automate booking, reduce back-and-forth, and surface open times quickly.
- [Check Cherry](https://composio.dev/toolkits/check_cherry) - Check Cherry is a business management platform for photography and event service companies. It helps teams manage leads, bookings, appointments, offerings, payments, and workflows in one place.
- [Cronfree Time Scheduler](https://composio.dev/toolkits/cronfree_time_scheduler) - Cronfree Time Scheduler is an API-based scheduler for recurring webhook calls. Use it to create and remove timezone-aware schedules without running cron.
- [Etermin](https://composio.dev/toolkits/etermin) - eTermin is an online appointment scheduling platform for businesses to manage bookings. It streamlines client appointments, saving time and reducing scheduling conflicts.
- [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.
- [GoTable](https://composio.dev/toolkits/go_table) - GoTable is a restaurant management REST API for reservations, tables, guests, offers, availability, and webhooks. Use it to programmatically manage bookings, guest data, offers, and table availability.
- [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.
- [Ignav Flights](https://composio.dev/toolkits/ignav_flights) - Ignav Flights is a flight search API for airports, fares, itineraries, and booking links. It helps apps compare routes and prices fast, so travelers can find practical options sooner.
- [Ignav Flights MCP](https://composio.dev/toolkits/ignav_flights_mcp) - Ignav Flights MCP is a flight search service for airport codes and live one-way or round-trip fares. It provides current booking links so travelers can compare options and continue with the airline or provider.
- [Jinko](https://composio.dev/toolkits/jinko) - Jinko is a travel API platform offering flight and hotel discovery, trip management, ancillaries, and hosted checkout. Use it to unify search, reservations, ancillaries, and hosted checkout into a single travel API.

## Frequently Asked Questions

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

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

### Can I use Tool Router MCP with OpenAI Agents SDK?

Yes, you can. OpenAI Agents SDK 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 Calendarhero tools.

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

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

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