# How to integrate Docsbot ai MCP with OpenAI Agents SDK

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

## Introduction

This guide walks you through connecting Docsbot ai to the OpenAI Agents SDK using the Composio tool router. By the end, you'll have a working Docsbot ai agent that can list all bots for your team, generate support ticket from recent chat, update bot description to new branding through natural language commands.
This guide will help you understand how to give your OpenAI Agents SDK agent real control over a Docsbot ai account through Composio's Docsbot ai MCP server.
Before we dive in, let's take a quick look at the key ideas and tools involved.

## Also integrate Docsbot ai with

- [Claude Agent SDK](https://composio.dev/toolkits/docsbot_ai/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/docsbot_ai/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/docsbot_ai/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/docsbot_ai/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/docsbot_ai/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/docsbot_ai/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/docsbot_ai/framework/cli)
- [Google ADK](https://composio.dev/toolkits/docsbot_ai/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/docsbot_ai/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/docsbot_ai/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/docsbot_ai/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/docsbot_ai/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/docsbot_ai/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 Docsbot ai
- Configure an AI agent that can use Docsbot ai as a tool
- Run a live chat session where you can ask the agent to perform Docsbot ai 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 Docsbot ai MCP server, and what's possible with it?

The Docsbot ai MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Docsbot ai account. It provides structured and secure access to your Docsbot ai bots, teams, and conversation data, so your agent can perform actions like creating bots, managing teams, generating support tickets, and analyzing user questions on your behalf.
- Custom bot creation and management: Instantly create new Docsbot ai bots or update existing ones, letting your agent provision and configure bots for different documentation needs.
- Team administration and overview: Allow your agent to fetch details about your teams or list all teams associated with your account, making it easier to manage collaboration and bot access.
- Automated support ticket generation: Easily convert chatbot conversations into structured support tickets, so your agent can help streamline customer support and issue tracking.
- Bot question and source analytics: Retrieve lists of questions asked to your bots or review all data sources connected to a given bot, empowering your agent to surface insights or monitor bot effectiveness.
- Seamless bot and data cleanup: Direct your agent to delete bots or manage bot sources, helping you keep your Docsbot ai environment tidy and up to date.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `DOCSBOT_AI_CAPTURE_CONVERSATION_LEAD` | Capture Conversation Lead | Tool to capture lead information by updating conversation metadata and saving the lead. Works whether or not the conversation has been created yet. |
| `DOCSBOT_AI_CREATE_BOT` | Create Bot | Tool to create a new bot within a team. Use when you have a valid team ID and want to provision a new bot. |
| `DOCSBOT_AI_CREATE_SOURCE` | Create Bot Source | Tool to create a new source for a bot. Sources can be URLs, files, sitemaps, and other types. Use when you have content to add to a bot's knowledge base. For file-based sources, first upload the file using the Upload File to Cloud Storage action. |
| `DOCSBOT_AI_CREATE_WEBHOOK` | Create Webhook | Tool to create a new webhook subscription for a bot. Use when you want to receive real-time notifications for specific events (lead.created, deep_research.done, conversation.escalated, conversation.rated). The target URL must be publicly accessible and support HTTPS. |
| `DOCSBOT_AI_DELETE_BOT` | Delete Bot | Tool to delete a specific bot by its ID. Use after confirming the bot ID is correct to permanently remove a bot from the system. |
| `DOCSBOT_AI_DELETE_CONVERSATION` | Delete Conversation | Tool to delete a specific conversation by its ID. Use after confirming the conversation ID is correct to permanently remove a conversation. Requires edit permission. |
| `DOCSBOT_AI_DELETE_LEAD` | Delete Lead | Tool to delete a specific lead by ID. Use after confirming the lead ID to permanently remove a lead record from the system. |
| `DOCSBOT_AI_DELETE_QUESTION` | Delete Question | Tool to delete a specific question from history. Use after confirming the question ID to permanently remove a question log entry from the system. |
| `DOCSBOT_AI_DELETE_SOURCE` | Delete Source | Tool to delete a specific source from a bot by its ID. Use after confirming the source ID is correct to permanently remove a source from the bot's knowledge base. |
| `DOCSBOT_AI_DELETE_WEBHOOK` | Delete Webhook | Tool to delete a webhook (unsubscribe) by its ID. Use after confirming the webhook ID is correct to permanently remove a webhook subscription. |
| `DOCSBOT_AI_DOCSBOT_CONVERSATION_TICKET_CREATION` | Generate Conversation Ticket | Generates a structured support ticket from a Chat Agent conversation. Use this tool to convert an existing bot conversation into a formatted helpdesk ticket containing a subject line and message body written from the user's perspective. Prerequisites: - Requires a conversation created via the Chat Agent API (not the legacy Chat API) - Requires Standard plan or higher - The conversation must exist and be accessible with the provided credentials |
| `DOCSBOT_AI_GET_BOT` | Get Bot Details | Tool to fetch details of a specific bot by ID within a team. Use after confirming valid team and bot IDs. |
| `DOCSBOT_AI_GET_BOT_REPORTS` | Get Bot Monthly Reports | Tool to retrieve monthly statistical reports for a bot. Returns question resolution metrics for a selected month. Use this to analyze bot performance and track question resolution trends over time. |
| `DOCSBOT_AI_GET_BOT_STATS` | Get Bot Statistics | Tool to retrieve comprehensive statistics and analytics for a bot over a time period or date range. Returns key metrics (resolution rate, deflection rate, time saved), time series data for questions and ratings, distribution data for feedback and escalations, and agent mode conversation analytics. Use after confirming valid team and bot IDs from List Teams and List Bots actions. |
| `DOCSBOT_AI_GET_SOURCE` | Get Source Details | Tool to retrieve detailed information about a specific source by its ID. Use when you need complete metadata about a source including indexed URLs, FAQs, and processing status. |
| `DOCSBOT_AI_GET_TEAM` | Get Team Details | Tool to fetch details of a specific team by its ID. Use when you need full team info including members and settings after confirming the team ID. |
| `DOCSBOT_AI_GET_UPLOAD_URL` | Get Upload URL | Get a presigned upload URL for uploading files as sources. Use this before uploading large files to DocsBot. The workflow is: 1) Get upload URL, 2) Upload file to the URL, 3) Create source with the file path. |
| `DOCSBOT_AI_GET_WEBHOOK` | Get Webhook Details | Tool to retrieve details of a specific webhook by ID. Use when you need webhook configuration, delivery status, or subscription details. |
| `DOCSBOT_AI_LIST_BOTS` | List Team Bots | List all bots for a given team. Returns detailed information about each bot including configuration, statistics, and status. Use this action to discover available bots before performing operations like getting bot details or listing sources. |
| `DOCSBOT_AI_LIST_CONVERSATIONS` | List Bot Conversations | Tool to list conversation history for a bot with pagination. Returns a limited subset of conversation properties including titles, timestamps, sentiment, and status. Use this to discover conversations before retrieving full details. |
| `DOCSBOT_AI_LIST_LEADS` | List Bot Leads | Tool to list captured leads for a bot with pagination and date filtering. Use after confirming valid team and bot IDs. Example: "List leads for bot abc123 starting from 2024-01-01." |
| `DOCSBOT_AI_LIST_QUESTIONS` | List Questions | Tool to list all questions asked of a specific bot. Use after confirming the bot's identifier. Example: "List questions for bot abc123 with status 'unanswered'." |
| `DOCSBOT_AI_LIST_RESEARCH_JOBS` | List Research Jobs | Tool to list all deep research jobs for a bot with pagination support. Use after confirming valid team and bot IDs. Returns details about each research job including status, question, and timestamps. |
| `DOCSBOT_AI_LIST_SOURCES` | List Bot Sources | Retrieves a paginated list of all sources for a specific bot within a team. Sources are the content (URLs, files, sitemaps, etc.) that have been indexed for the bot's knowledge base. Use this to see what data sources a bot has been trained on. |
| `DOCSBOT_AI_LIST_TEAM_MEMBERS` | List Team Members | Tool to list all members of a team including their roles. Use when you need to see who has access to a team and their permission levels. |
| `DOCSBOT_AI_LIST_TEAMS` | List Teams | Tool to list all teams. Use when you need to retrieve every team associated with the authenticated user. |
| `DOCSBOT_AI_LIST_WEBHOOKS` | List Bot Webhooks | List all registered webhooks for a bot. Returns webhook configurations including target URLs, subscribed events, and status. Use this action to discover configured webhooks before creating, updating, or deleting them. |
| `DOCSBOT_AI_RATE_ANSWER` | Rate Answer | Tool to rate an answer from chat APIs as positive (1), neutral (0), or negative (-1). Use when recording user feedback on bot responses for statistics shown in chat logs. |
| `DOCSBOT_AI_REFRESH_SOURCE` | Refresh Source | Tool to refresh a source to re-index its content. Use when a source needs to be updated with the latest content from its origin. Only works with failed sources for retry purposes. |
| `DOCSBOT_AI_SEARCH_SEMANTIC` | Semantic Search Bot Content | Tool to perform semantic search on a bot's indexed content. Returns the most relevant source chunks for a query. Use when you need to search the bot's knowledge base without triggering a full conversation. |
| `DOCSBOT_AI_TEST_ESCALATED_WEBHOOK` | Test Escalated Webhook | Tool to trigger a test delivery of the conversation.escalated webhook. Use to verify webhook configuration is working correctly. |
| `DOCSBOT_AI_TEST_LEAD_WEBHOOK` | Test Lead Webhook | Tool to trigger a test lead webhook delivery. Use when you need to test webhook integration for lead capture events. Requires owner or admin permissions. |
| `DOCSBOT_AI_TEST_RESEARCH_WEBHOOK` | Test Research Webhook | Tool to trigger a deep research webhook delivery test. Use to verify webhook configurations are working correctly. |
| `DOCSBOT_AI_TRIGGER_RATED_WEBHOOK_TEST` | Trigger Rated Webhook Test | Tool to trigger a conversation.rated webhook delivery test for a specific bot. Use when you need to test webhook integration for conversation rating events. |
| `DOCSBOT_AI_UPDATE_BOT` | Update Bot | Update a bot's configuration settings such as name, description, model, temperature, and appearance. Only fields provided in the request will be modified; omitted fields remain unchanged. Requires valid team_id and bot_id. Use LIST_BOTS to find available bot IDs first. |
| `DOCSBOT_AI_UPDATE_TEAM` | Update Team | Tool to update specific fields for a team. Use after confirming the team ID when you need to change the team's name or OpenAI API key. Returns the updated team record. |
| `DOCSBOT_AI_UPDATE_WEBHOOK` | Update Webhook | Tool to update a webhook's status, target URL, label, or expiration date. Use when you need to modify webhook configuration. Requires valid team_id, bot_id, and webhook_id. Only provided fields will be updated. |
| `DOCSBOT_AI_UPLOAD_FILE_TO_CLOUD_STORAGE` | Upload File to Cloud Storage | Upload a file to cloud storage via a presigned URL. Use this tool after obtaining a presigned upload URL from the DocsBot API (GET /teams/:teamId/bots/:botId/upload-url?fileName=FILENAME). The workflow is: 1. Get presigned URL from DocsBot upload-url endpoint 2. Use this tool to upload the file to the presigned URL 3. Create a source using the 'file' path returned from step 1 |

## Supported Triggers

None listed.

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

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

mcp_url = session.mcp.url
```

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

- [Claude Agent SDK](https://composio.dev/toolkits/docsbot_ai/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/docsbot_ai/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/docsbot_ai/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/docsbot_ai/framework/codex)
- [OpenClaw](https://composio.dev/toolkits/docsbot_ai/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/docsbot_ai/framework/hermes-agent)
- [CLI](https://composio.dev/toolkits/docsbot_ai/framework/cli)
- [Google ADK](https://composio.dev/toolkits/docsbot_ai/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/docsbot_ai/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/docsbot_ai/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/docsbot_ai/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/docsbot_ai/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/docsbot_ai/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.
- [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.
- [Getprospect](https://composio.dev/toolkits/getprospect) - Getprospect is a business email discovery tool with LinkedIn integration. Use it to quickly find and verify professional email addresses.

## Frequently Asked Questions

### What are the differences in Tool Router MCP and Docsbot ai MCP?

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

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

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

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