# How to integrate Helpwise MCP with OpenAI Agents SDK

```json
{
  "title": "How to integrate Helpwise MCP with OpenAI Agents SDK",
  "toolkit": "Helpwise",
  "toolkit_slug": "helpwise",
  "framework": "OpenAI Agents SDK",
  "framework_slug": "open-ai-agents-sdk",
  "url": "https://composio.dev/toolkits/helpwise/framework/open-ai-agents-sdk",
  "markdown_url": "https://composio.dev/toolkits/helpwise/framework/open-ai-agents-sdk.md",
  "updated_at": "2026-05-12T10:14:48.193Z"
}
```

## Introduction

This guide walks you through connecting Helpwise to the OpenAI Agents SDK using the Composio tool router. By the end, you'll have a working Helpwise agent that can add note to open conversation with client, delete outdated contact from contact list, create new team for support agents through natural language commands.
This guide will help you understand how to give your OpenAI Agents SDK agent real control over a Helpwise account through Composio's Helpwise MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Helpwise with

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

## 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 Helpwise
- Configure an AI agent that can use Helpwise as a tool
- Run a live chat session where you can ask the agent to perform Helpwise 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 Helpwise MCP server, and what's possible with it?

The Helpwise MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Helpwise account. It provides structured and secure access to your customer communication tools, so your agent can create conversations, manage notes, upload attachments, delete messages, and organize your Helpwise workspace on your behalf.
- Attachment management and uploads: Easily upload files as attachments to conversations and retrieve attachment metadata for streamlined file sharing.
- Conversation note automation: Let your agent add or remove notes to specific conversations, making it easy to document context or follow up actions.
- Mailbox and conversation cleanup: Direct your agent to delete entire conversations, mailboxes, or individual messages for efficient workspace management.
- Contact and signature management: Seamlessly delete contacts and email signatures, keeping your Helpwise account up to date and clutter-free.
- Webhook and team setup: Have your agent create new webhooks for event notifications or set up Helpwise teams to organize your users for better collaboration.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `HELPWISE_CREATE_ATTACHMENT` | Create attachment | Tool to upload a new attachment. Use when you need to send a file to Helpwise and receive its attachment metadata. |
| `HELPWISE_CREATE_NOTE` | Add note to conversation | Tool to add a note to a conversation. Use after obtaining the conversation_id to provide context. |
| `HELPWISE_CREATE_TEAM` | Create Helpwise Team | Creates a new team in Helpwise to group users for collaboration and assignment purposes. Use this tool when you need to: - Create a new team with a unique name - Optionally add a description for the team - Optionally assign initial members by their user IDs IMPORTANT: Team creation via API is not available in the current Helpwise API. All tested endpoints (/api/v1/teams, /dev-apis/teams, /api/v1/team, /dev-apis/team) return 404. Team management appears to be limited to the Helpwise web interface. If you need to create teams, please: 1. Use the Helpwise web interface at https://app.helpwise.io 2. Contact Helpwise support at dev@helpwise.io to request API endpoint availability This action is implemented speculatively for future API support and follows standard patterns used in other Helpwise actions. |
| `HELPWISE_CREATE_WEBHOOK` | Create Helpwise Webhook | Creates a new webhook subscription in Helpwise to receive real-time event notifications. Use this action to programmatically subscribe to Helpwise events like conversation creation, message replies, conversation assignments, status changes, and tag applications. Webhooks deliver JSON payloads to your specified callback URL when subscribed events occur. IMPORTANT: Helpwise webhook management is primarily done through the UI at: Settings > Automation > Integrations > Webhooks (https://app.helpwise.io/settings/integrations) This action attempts to use programmatic API endpoints, but if they're unavailable in your Helpwise plan or environment, you'll need to create webhooks manually via the UI. |
| `HELPWISE_DELETE_CONTACT` | Delete Contact | Deletes a contact from Helpwise by its unique identifier (ID). Use this action when you need to permanently remove a contact from your Helpwise account. Returns an empty response (HTTP 204 No Content) on successful deletion. Note: This action is idempotent - deleting a non-existent contact will return an appropriate error. |
| `HELPWISE_DELETE_CONVERSATION` | Delete Helpwise Conversation | Attempts to delete a conversation by ID from Helpwise. Note: The Helpwise API may not support conversation deletion via the REST API. If deletion is not supported, this action will return an error indicating that the endpoint was not found or the method is not allowed. Use this action when you need to attempt to permanently remove a conversation by its ID. |
| `HELPWISE_DELETE_MAILBOX` | Delete Mailbox | Tool to delete a mailbox by its unique identifier. NOTE: As of 2026, the Helpwise API may not support mailbox deletion via API. This action attempts deletion but will fail if the endpoint is not available (405 Method Not Allowed). Consider managing mailboxes through the Helpwise web interface if API deletion is unsupported. |
| `HELPWISE_DELETE_MESSAGE` | Delete Helpwise Message | Attempts to delete a message from Helpwise. Note: The Helpwise API may not support message deletion via the REST API. If deletion is not supported, this action will return an error indicating that the DELETE method is not allowed (HTTP 405). Use this action when you need to attempt to permanently remove a message by its ID. |
| `HELPWISE_DELETE_NOTE` | Delete Helpwise Note | Tool to delete a note from a conversation. Use when you need to permanently remove a note by its ID from a specific conversation after confirming the IDs. |
| `HELPWISE_DELETE_SIGNATURE` | Delete Email Signature | Deletes an email signature from Helpwise. Email signatures are text/HTML templates that automatically append to outgoing emails from specific mailboxes or users. This action permanently removes the signature identified by the signature_id. Returns an empty response on successful deletion (204 No Content). |
| `HELPWISE_DELETE_TAG` | Delete Tag | Permanently deletes a tag from Helpwise. This action removes the tag from all conversations where it was applied and cannot be undone. Use this when you need to permanently remove a tag that is no longer needed. Note: Deleting a tag will automatically remove it from all existing conversations that use this tag. |
| `HELPWISE_DELETE_TEAM` | Delete Team | Tool to delete a team. Use when you need to remove an existing team by its unique identifier after confirming the ID and dependencies. |
| `HELPWISE_DELETE_TEMPLATE` | Delete Template | Deletes a Helpwise email template (saved reply) by its ID. Returns empty response on success (HTTP 204). Use this tool when you need to permanently remove a template that is no longer needed. Ensure the template_id is valid before deletion - this operation cannot be undone. Common responses: - Success (204): Template deleted successfully - Not Found (404): Template ID does not exist or was already deleted - Forbidden (403): No permission to delete this template |
| `HELPWISE_DELETE_WEBHOOK` | Delete Helpwise Webhook | Delete a Helpwise webhook by its ID. Use this tool when you need to permanently remove a webhook configuration. Returns an empty response on successful deletion (HTTP 204 No Content). |
| `HELPWISE_GET_ATTACHMENT` | Get Attachment | Retrieves a specific attachment by its unique identifier. Use this after obtaining an attachment ID from conversations, messages, or attachment listings to get detailed attachment metadata including download URL, file name, content type, and timestamps. |
| `HELPWISE_GET_ATTACHMENTS` | Get Conversation Attachments | Retrieves attachments from messages in a specific conversation. **Important**: Helpwise does not provide a dedicated attachments endpoint. This action retrieves attachments by fetching messages from the conversation and extracting attachment information from them. A conversation_id is required to use this action. Use this when you need to: - Get all file attachments from a specific conversation - Access attachment metadata (filename, URL, size, content type) - Download files shared in customer support conversations **Note**: This action retrieves attachments through the messages endpoint, as Helpwise embeds attachment data within message objects rather than providing a standalone attachments resource. |
| `HELPWISE_GET_CONTACT` | Get Helpwise Contact | Retrieves detailed information for a specific contact by ID. Use this when you need to fetch complete contact details including name, email, phone, company, and timestamps for a known contact ID. |
| `HELPWISE_GET_CONVERSATION` | Get Conversation | Retrieves complete details of a specific conversation by ID from Helpwise. Returns the conversation metadata including subject, status, participants, and timestamps. Use this action when you need to view or analyze a specific conversation's details. Example use cases: - Checking the status of a support ticket conversation - Viewing conversation participants and assignees - Retrieving conversation metadata for reporting |
| `HELPWISE_GET_CONVERSATIONS` | Get Conversations | Tool to retrieve a list of conversations. Use when you need to list and paginate support conversations for display or analysis. |
| `HELPWISE_GET_CUSTOM_FIELD` | Get Helpwise Custom Field | Retrieves details of a specific custom field by its ID. Use this when you need to fetch custom field properties such as name, description, value, associated inboxes, and creator information. |
| `HELPWISE_GET_MAILBOX` | Get Helpwise Mailbox | Tool to retrieve details of a specific mailbox by its ID. Use when you know the mailbox ID and need full mailbox information. |
| `HELPWISE_GET_MAILBOXES` | Get Helpwise Mailboxes | Tool to retrieve mailboxes. Use when you need to list and paginate mailboxes after authenticating. |
| `HELPWISE_GET_NOTE` | Get Conversation Note | Tool to retrieve details of a specific note. Use when you know the conversation and note IDs and need full note information. |
| `HELPWISE_GET_NOTES` | Get Conversation Notes | Retrieves all notes associated with a specific conversation. Notes are internal comments or annotations that team members add to conversations for collaboration and context. |
| `HELPWISE_GET_TAG` | Get Helpwise Tag | Retrieves detailed information about a specific tag in Helpwise. Use this action when you need to: - Get the full properties of a tag including its name, color, and timestamps - Verify that a tag exists before performing operations on it - Retrieve tag details for display or processing Tags in Helpwise are labels that can be applied to conversations for organization and filtering. |
| `HELPWISE_GET_TEAM` | Get Helpwise Team | Retrieves details of a specific Helpwise team by its ID. Note: Team endpoints may not be available in all Helpwise API plans. If this action returns a 404 error, teams may need to be managed through the Helpwise web interface. Use this tool when you have a valid team_id and need to fetch team details such as name and timestamps. |
| `HELPWISE_GET_TEAMS` | Get Helpwise Teams | Tool to retrieve Helpwise teams. Use when you need to list and paginate all teams for assignment or management. |
| `HELPWISE_GET_TEMPLATES` | Get Helpwise WhatsApp Templates | Tool to retrieve Helpwise WhatsApp message templates. Use when you need to list WhatsApp templates for a mailbox or account. |
| `HELPWISE_GET_USERS` | Get Helpwise Users | Tool to retrieve Helpwise users list. Use when you need to fetch and paginate agents for assignment. |
| `HELPWISE_GET_WEBHOOK` | Get Helpwise Webhook | Retrieve detailed configuration for a specific Helpwise webhook by its ID. Use this action when you: - Need to inspect the configuration of an existing webhook - Want to verify webhook settings (URL, events, active status) - Need to check webhook creation/update timestamps Prerequisites: You must have a valid webhook ID, which can be obtained from the 'Get Webhooks' action or when creating a webhook. |
| `HELPWISE_GET_WEBHOOKS` | Get Helpwise Webhooks | Tool to retrieve Helpwise webhooks. Use when you need to list and paginate all webhook configurations. |
| `HELPWISE_SEARCH_CONTACTS` | Search Helpwise Contacts | Tool to search contacts by term with pagination. Use when you need to find contacts by name, email, phone, or other contact attributes. |
| `HELPWISE_UPDATE_CONTACT` | Update Helpwise Contact | Tool to update an existing Helpwise contact. Use when you need to modify contact details or custom attributes. |
| `HELPWISE_UPDATE_MAILBOX` | Update Mailbox | Updates an existing Helpwise mailbox. Use this action to modify mailbox settings such as display name, email address, team assignment, email signature, or default status. At least one field must be provided for update. Obtain the mailbox_id from the Get Mailboxes action. |
| `HELPWISE_UPDATE_MESSAGE` | Update Helpwise Message | Tool to update an existing message. Use when you need to modify message content by its ID. |
| `HELPWISE_UPDATE_TAG` | Update Helpwise Tag | Updates an existing tag's name and/or color in Helpwise. Use this action when you need to rename a tag or change its visual appearance. You must have the tag's ID before calling this action - obtain it using HELPWISE_GET_TAG or from the Helpwise UI. |
| `HELPWISE_UPDATE_TEMPLATE` | Update Helpwise Template | Updates an existing Helpwise email template by modifying its name, subject, and/or HTML content. Use this action when you need to: - Change the display name of a template - Update the subject line (including placeholders) - Modify the HTML content/body of the template Prerequisites: - You must have the template_id (obtain via Get Templates action or Helpwise UI) - At least one field (name, subject, or html) must be provided for update Note: This action performs a partial update - only provided fields will be modified. |

## Supported Triggers

None listed.

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

The Helpwise MCP server is an implementation of the Model Context Protocol that connects your AI agent to Helpwise. It provides structured and secure access so your agent can perform Helpwise 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 Helpwise 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 Helpwise.
```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 helpwise.
- The router checks the user's Helpwise connection and prepares the MCP endpoint.
- The returned session.mcp.url is the MCP URL that your agent will use to access Helpwise.
- This approach keeps things lightweight and lets the agent request Helpwise tools only when needed during the conversation.
```python
# Create a Helpwise Tool Router session
session = composio.create(
    user_id=user_id,
    toolkits=["helpwise"]
)

mcp_url = session.mcp.url
```

```typescript
// Create Tool Router session for Helpwise
const session = await composio.create(userId as string, {
  toolkits: ['helpwise'],
});
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 Helpwise. "
        "Help users perform Helpwise 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 Helpwise. Help users perform Helpwise 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=["helpwise"]
)
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 Helpwise. "
        "Help users perform Helpwise 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: ['helpwise'],
  });
  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 Helpwise. Help users perform Helpwise 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 Helpwise MCP with OpenAI Agents SDK to build a functional AI agent that can interact with Helpwise.
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 Helpwise MCP Agent with another framework

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

## Related Toolkits

- [Aeroleads](https://composio.dev/toolkits/aeroleads) - Aeroleads is a B2B lead generation platform for finding business emails and phone numbers. Grow your sales pipeline faster with powerful prospecting tools.
- [Autobound](https://composio.dev/toolkits/autobound) - Autobound is an AI-powered sales engagement platform that crafts hyper-personalized outreach and insights. It helps sales teams boost response rates and close more deals through tailored content and recommendations.
- [Better proposals](https://composio.dev/toolkits/better_proposals) - Better Proposals is a web-based tool for crafting and sending professional proposals. It helps teams impress clients and close deals faster with slick, easy-to-use templates.
- [Bidsketch](https://composio.dev/toolkits/bidsketch) - Bidsketch is a proposal software that helps businesses create professional proposals quickly and efficiently. It streamlines the proposal process, saving time while boosting client win rates.
- [Bolna](https://composio.dev/toolkits/bolna) - Bolna is an AI platform for building conversational voice agents. It helps businesses automate support and streamline interactions through natural, voice-powered conversations.
- [Botsonic](https://composio.dev/toolkits/botsonic) - Botsonic is a no-code AI chatbot builder for easily creating and deploying chatbots to your website. It empowers businesses to offer conversational experiences without writing code.
- [Botstar](https://composio.dev/toolkits/botstar) - BotStar is a comprehensive chatbot platform for designing, developing, and training chatbots visually on Messenger and websites. It helps businesses automate conversations and customer interactions without coding.
- [Callerapi](https://composio.dev/toolkits/callerapi) - CallerAPI is a white-label caller identification platform for branded caller ID and fraud prevention. It helps businesses boost customer trust while stopping spam, fraud, and robocalls.
- [Callingly](https://composio.dev/toolkits/callingly) - Callingly is a lead response management platform that automates immediate call and text follow-ups with new leads. It helps sales teams boost response speed and close more deals by connecting seamlessly with CRMs and lead sources.
- [Callpage](https://composio.dev/toolkits/callpage) - Callpage is a lead capture platform that lets businesses instantly connect with website visitors via callback. It boosts lead generation and increases your sales conversion rates.
- [Clearout](https://composio.dev/toolkits/clearout) - Clearout is an AI-powered service for verifying, finding, and enriching email addresses. It boosts deliverability and helps you discover high-quality leads effortlessly.
- [Clientary](https://composio.dev/toolkits/clientary) - Clientary is a platform for managing clients, invoices, projects, proposals, and more. It streamlines client work and saves you serious admin time.
- [Convolo ai](https://composio.dev/toolkits/convolo_ai) - Convolo ai is an AI-powered communications platform for sales teams. It accelerates lead response and improves conversion rates by automating calls and integrating workflows.
- [Delighted](https://composio.dev/toolkits/delighted) - Delighted is a customer feedback platform based on the Net Promoter System®. It helps you quickly gather, track, and act on customer sentiment.
- [Docsbot ai](https://composio.dev/toolkits/docsbot_ai) - Docsbot ai is a platform that lets you build custom AI chatbots trained on your documentation. It automates customer support and content generation, saving time and improving response quality.
- [Emelia](https://composio.dev/toolkits/emelia) - Emelia is an all-in-one B2B prospecting platform for cold-email, LinkedIn outreach, and prospect research. It streamlines outbound campaigns so you can find, engage, and warm up leads faster.
- [Findymail](https://composio.dev/toolkits/findymail) - Findymail is a B2B data provider offering verified email and phone contacts for sales prospecting. Enhance outreach with automated exports, email verification, and CRM enrichment.
- [Freshdesk](https://composio.dev/toolkits/freshdesk) - Freshdesk is customer support software with ticketing and automation tools. It helps teams streamline helpdesk operations for faster, better customer support.
- [Fullenrich](https://composio.dev/toolkits/fullenrich) - FullEnrich is a B2B contact enrichment platform that aggregates emails and phone numbers from 15+ data vendors. Instantly find and verify lead contact data to boost your outreach.
- [Gatherup](https://composio.dev/toolkits/gatherup) - GatherUp is a customer feedback and online review management platform. It helps businesses boost their reputation by streamlining how they collect and manage customer feedback.

## Frequently Asked Questions

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

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

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

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

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