How to integrate Dialpad MCP with Autogen

Framework Integration Gradient
Dialpad Logo
AutoGen Logo
divider

Introduction

This guide walks you through connecting Dialpad to AutoGen using the Composio tool router. By the end, you'll have a working Dialpad agent that can block these spam numbers on our phone system, add a new operator to the support call center, include a manager in the ongoing client call, assign a fax line to the sales department through natural language commands.

This guide will help you understand how to give your AutoGen agent real control over a Dialpad account through Composio's Dialpad MCP server.

Before we dive in, let's take a quick look at the key ideas and tools involved.

TL;DR

Here's what you'll learn:
  • Get and set up your OpenAI and Composio API keys
  • Install the required dependencies for Autogen and Composio
  • Initialize Composio and create a Tool Router session for Dialpad
  • Wire that MCP URL into Autogen using McpWorkbench and StreamableHttpServerParams
  • Configure an Autogen AssistantAgent that can call Dialpad tools
  • Run a live chat loop where you ask the agent to perform Dialpad operations

What is AutoGen?

Autogen is a framework for building multi-agent conversational AI systems from Microsoft. It enables you to create agents that can collaborate, use tools, and maintain complex workflows.

Key features include:

  • Multi-Agent Systems: Build collaborative agent workflows
  • MCP Workbench: Native support for Model Context Protocol tools
  • Streaming HTTP: Connect to external services through streamable HTTP
  • AssistantAgent: Pre-built agent class for tool-using assistants

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

The Dialpad MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Dialpad account. It provides structured and secure access to your company’s phone system, giving your agent the ability to manage calls, operators, channels, and communication workflows—all without you lifting a finger.

  • Automated call and participant management: Have your agent add participants to ongoing calls or assign phone numbers to call routers to streamline real-time communications.
  • Channel and team membership control: Let your agent add members to channels or coaching teams, making onboarding and team adjustments effortless.
  • Operator assignment and role management: Easily direct your agent to add or update operators for departments, offices, or call centers, ensuring the right people are always in the right roles.
  • Phone and fax line provisioning: Empower your agent to create and assign fax lines or phone numbers to users, departments, or call routers, keeping your communications infrastructure flexible and up-to-date.
  • Access policy and security oversight: Enable your agent to list and audit access control policies, helping administrators maintain secure and compliant operations within Dialpad.

Supported Tools & Triggers

Tools
Access control policies listingRetrieves a list of access control policies for the authenticated dialpad company.
Add blocked phone numbersAdds specified phone numbers to the blocked list in dialpad.
Add department operator by idAdds a new operator to a specific department in dialpad.
Add member to channelAdds a new member to a specified channel within the dialpad communication platform.
Add member to coaching teamAdds a new member to a specific coaching team in dialpad.
Add operator to call centerThis endpoint adds a new operator to a specified call center in the dialpad system.
Add operator to officeThis endpoint adds a new operator to a specific office within the dialpad system.
Add participant to callAdds a new participant to an existing call in the dialpad system.
Assign fax line to targetCreates and assigns a new fax line to a specified target (user or department) in the dialpad system.
Assign number to call routerThis endpoint assigns a phone number to a specific call router in the dialpad system.
Assign phone number to officeThis endpoint assigns a phone number to a specific office in the dialpad system.
Assign phone number to roomAssigns a phone number to a specified room in dialpad.
Assign phone number to targetAssigns a phone number to a specified target within the dialpad system.
Assign phone number to userThis endpoint assigns a phone number to a specific dialpad user.
Assign policy to user by idAssigns an access control policy to a specific user within the dialpad system.
Attach labels to callCreates or updates labels for a specific call in the dialpad system.
Configure call center settingsThis endpoint creates a new call center within the dialpad system with customizable settings for call handling, routing, operational hours, and advanced features.
Create access control policyCreates a new access control policy in dialpad, defining a set of permissions and their application scope.
Create agent status subscriptionCreates or updates an agent status subscription for real-time monitoring of contact center agent statuses in dialpad.
Create callbackCreates a callback request in a dialpad call center.
Create call review share linkCreates a shareable link for a specific call review in the dialpad platform.
Create call router configurationCreates a new call router in the dialpad system, allowing for custom call routing logic based on a specified url.
Create channel endpointCreates a new communication channel within the dialpad platform.
Create custom ivr with audio fileCreates a new custom interactive voice response (ivr) system within the dialpad platform.
Create new contact entryThe createcontact endpoint adds a new contact to dialpad's system.
Create new department recordCreates a new department within the dialpad system with customizable settings for call handling, operating hours, and advanced features.
Create pin for international room callsCreates a pin for protected international calls from a dialpad room.
Create room in office via postCreates a new room within a specified office in the dialpad system.
Create schedule reports endpointCreates a scheduled report in the dialpad system for various types of communication data.
Create secondary officeCreates a new office within the dialpad system with specified configurations and settings.
Create sms event subscriptionCreates a new sms event subscription in the dialpad api, allowing users to receive notifications for inbound and/or outbound sms messages.
Create user with auto assignCreates a new user account in the dialpad system with the specified details.
Create webhook post endpointCreates a new webhook integration for receiving real-time event notifications from dialpad.
Deauthorize oauth2 sessionDeauthorizes (revokes) an oauth2 access token, effectively terminating the application's access to the dialpad api.
Delete access control policy by idDeletes a specific access control policy from the dialpad system.
Delete agent status by idDeletes a specific agent status subscription identified by its unique id.
Delete call center by idDeletes a specific call center from the dialpad system.
Delete callreviewsharelink by idThis endpoint deletes a specific call review share link in the dialpad system.
Delete callrouter by idDeletes a specific call router from the dialpad system.
Delete call subscription by idDeletes a specific call subscription from the dialpad system.
Delete channel by idDeletes a specific channel from the dialpad communication platform.
Delete channel member by idRemoves a specified member from a dialpad channel.
Delete contact by idDeletes a specific contact from the dialpad system using the provided contact id.
Delete customivr by targettype and ivrtypeDeletes a custom interactive voice response (ivr) configuration from a specified target in the dialpad system.
Delete department resourceDeletes a specific department from the dialpad system.
Delete deskphone by user idDeletes a specific deskphone associated with a user in the dialpad system.
Delete deskphone in roomThis endpoint removes a specific deskphone from a designated room within the dialpad system.
Delete number via apiDeletes a specific phone number from the user's dialpad account.
Delete office operator by idRemoves a specified operator (user or room) from a particular office in the dialpad system.
Delete operator from call centerRemoves a specified operator from a call center in the dialpad system.
Delete operator from departmentRemoves a specified operator from a department in the dialpad system.
Delete recording share link by idDeletes a specific recording share link in the dialpad system.
Delete room by idDeletes a specific room from the dialpad system using its unique identifier.
Delete schedule report by idDeletes a specific scheduled report from the dialpad system.
Delete sms subscription by idDeletes a specific sms subscription from the dialpad system.
Delete subscription changelog by idDeletes a specific changelog entry from a subscription in the dialpad system.
Delete subscription contact by idDeletes a specific subscription contact from the dialpad system.
Delete user by idDeletes a user from the dialpad system based on the provided user id.
Delete webhook by idDeletes a specific webhook subscription from the dialpad platform using its unique identifier.
Delete websocket connection by idCloses and removes a specific websocket connection in the dialpad system.
Fetch call byidRetrieves detailed information about a specific call using its unique identifier.
Fetch call transcript by idRetrieves the transcript for a specific call in the dialpad system.
Fetch custom ivrsRetrieves a list of all custom interactive voice response (ivr) configurations associated with the authenticated dialpad account.
Fetch operators for office idRetrieves a list of operators associated with a specific office in dialpad.
Fetch scheduled reportsRetrieves a list of scheduled reports from the dialpad system.
Fetch transcript url by call idRetrieves the url of a transcript for a specific call in the dialpad system.
Fetch user details by idRetrieves detailed information about a specific user in the dialpad system.
Format phone numbersThe format phone number endpoint is used to standardize and format phone numbers within the dialpad ecosystem.
Get available licenses for an officeRetrieves the number of available (unused) licenses for a specific office within a dialpad organization.
Get call center status by idRetrieves the current operational status of a specific call center in the dialpad system.
Get call labelsRetrieves a list of all available call labels in the dialpad system.
Get call review share link by idRetrieves or generates a share link for a specific call review in the dialpad system.
Get call subscription detailsRetrieves a list of call subscriptions associated with the authenticated user's account in the dialpad platform.
Get channel members by idRetrieves a list of members for a specific channel in dialpad.
Get departments by office idRetrieves a list of all departments associated with a specific office in the dialpad system.
Get deskphone by parent idRetrieves detailed information about a specific deskphone within a designated room or parent entity in the dialpad system.
Get deskphones for user parent idRetrieves a list of deskphones associated with a specific user in the dialpad system.
Get deskphones in roomsRetrieves a list of deskphones associated with a specific room in the dialpad system.
Get office call centersRetrieves a list of call centers associated with a specific office in the dialpad platform.
Get operator skills by call center and userRetrieves the skill information for a specific operator within a designated call center.
Get phone number detailsRetrieves detailed information about a specific phone number associated with the dialpad account.
Get recording share link by idRetrieves detailed information about a specific recording share link in the dialpad system.
Get rooms listRetrieves a list of all available meeting rooms or spaces within the dialpad system.
Get subscription contact by idRetrieves the subscription information for a specific contact in the dialpad system.
Get user caller idRetrieves the caller id information for a specific user in the dialpad system.
Get user deskphonesRetrieves detailed information about a specific deskphone associated with a particular user in the dialpad system.
Get user e911 detailsRetrieves the enhanced 911 (e911) information for a specific user in the dialpad system.
Get webhooks informationRetrieves a list of all webhooks configured for the authenticated user's dialpad account.
Hangup call via idTerminates an active call in the dialpad system.
Initiate ivr call api endpointInitiates an outbound ivr (interactive voice response) call using the dialpad api.
Initiate outbound call via apiThe initiateoutboundcall endpoint allows you to programmatically initiate an outbound call using the dialpad api.
Initiate user call with group optionsInitiates an outbound call for a specified dialpad user.
List channels apiRetrieves a list of all available communication channels in the dialpad platform.
List conference roomsRetrieves a list of conference rooms available in the dialpad system.
List offices endpointRetrieves a list of offices within the dialpad platform.
List usersRetrieves a list of users from the dialpad system.
Modify contact details using idUpdates an existing contact's information in the dialpad system.
Modify custom ivr settingsUpdates a custom interactive voice response (ivr) configuration for a specific target within the dialpad system.
Modify operator skill levelUpdates the skill level of a specific operator in a designated call center.
Modify webhook configurationUpdates an existing webhook configuration in the dialpad api.
Move user to specified officeUpdates a user's office assignment within the dialpad system.
Oauth2 authorize endpointInitiates the oauth 2.
Patch access control policy by idThis endpoint allows you to update an existing access control policy in the dialpad system.
Patch agent status event subscriptionUpdates an existing agent status subscription in the dialpad system.
Patch call router by idUpdates an existing call router in the dialpad system.
Patch department details by idUpdates the settings and configuration of a specific department in the dialpad system.
Patch subscription changelog endpointUpdates an existing change log event subscription in the dialpad system.
Patch user active call recordingUpdates the call recording settings for an active call of a specific dialpad user.
Patch user statusUpdates the status of a specific user in the dialpad system.
Patch websocket signature secretUpdates the signature secret for a specific websocket connection in the dialpad platform.
Post call event subscriptionCreates a new call event subscription in the dialpad system, allowing real-time notifications for various call states and actions.
Post recording share linkCreates a shareable link for a specific recording in dialpad, such as a call recording or voicemail.
Post subscription change log eventCreates or updates a subscription for changelog events in the dialpad system.
Post users screenpop uriTriggers a screen pop for a specific dialpad user, displaying relevant information during a call or communication event.
Post websocket connection secretCreates a websocket connection for real-time communication with the dialpad platform.
Reassign phone number to targetAssigns or reassigns a phone number to a specific target within the dialpad system.
Redeem access or refresh tokenThe oauth 2.
Remove blocked numbersRemoves specified phone numbers from the blocked list in the dialpad system.
Retrieve access control policy assignmentsRetrieves the assignments of a specific access control policy in dialpad.
Retrieve access control policy by idRetrieves detailed information about a specific access control policy in the dialpad system.
Retrieve agent status by idRetrieves detailed information about a specific agent status subscription using its unique identifier.
Retrieve agent status subscriptionRetrieves a list of agent status subscriptions from the dialpad system.
Retrieve app settingsRetrieves the current application settings for the authenticated dialpad account.
Retrieve blocked number detailsRetrieves information about a specific blocked number in the dialpad system.
Retrieve blocked phone numbersRetrieves a comprehensive list of all phone numbers that have been blocked through the dialpad api.
Retrieve call center by idRetrieves detailed information about a specific call center in the dialpad system.
Retrieve callcenter operators by idRetrieves a list of operators associated with a specific call center in dialpad.
Retrieve call centers informationRetrieves a list of call centers and their associated information from the dialpad platform.
Retrieve call informationRetrieves call information from the dialpad system.
Retrieve callrouter by idRetrieves detailed information about a specific call router in the dialpad system.
Retrieve call routers v2 apiRetrieves a list of call routers configured in the dialpad system.
Retrieve call subscription by idRetrieves detailed information about a specific call subscription in the dialpad system.
Retrieve channel by idRetrieves detailed information about a specific communication channel in the dialpad platform using its unique identifier.
Retrieve coaching stats v2The getstatistics endpoint retrieves comprehensive statistics for various aspects of dialpad usage, including calls, customer satisfaction (csat), dispositions, on-duty status, recordings, screen shares, texts, and voicemails.
Retrieve coaching team by idRetrieves detailed information about a specific coaching team in dialpad.
Retrieve coaching teams informationRetrieves information about coaching teams in the dialpad platform.
Retrieve company dataRetrieves detailed information about a specific company within the dialpad platform.
Retrieve conference meetingsRetrieves information about conference meetings in the dialpad platform.
Retrieve contact by idRetrieves detailed information for a specific contact in your dialpad account using the contact's unique identifier.
Retrieve contact listRetrieves a list of contacts from the dialpad platform.
Retrieve department by idRetrieves detailed information about a specific department within the dialpad organization.
Retrieve department operators by idRetrieves a list of operators associated with a specific department in dialpad.
Retrieve e911 office detailsRetrieves the enhanced 911 (e911) settings for a specific office within the dialpad communication platform.
Retrieve list of departmentsRetrieves a list of departments for a specified office within the dialpad organization.
Retrieve members of coaching team by idRetrieves a list of members belonging to a specific coaching team in dialpad.
Retrieve numbers via api v2Retrieves a list of phone numbers associated with the user's dialpad account.
Retrieve off duty status by office idRetrieves the list of custom off-duty statuses for a specific office within the dialpad system.
Retrieve office by idRetrieves detailed information about a specific office within the dialpad system.
Retrieve office plan by idRetrieves the current plan details for a specific office in your dialpad organization.
Retrieve operator duty statusRetrieves the current duty status of a specific call center operator in dialpad.
Retrieve room information by idRetrieves detailed information about a specific room in the dialpad system.
Retrieve schedule report by idRetrieves detailed information about a specific scheduled report in the dialpad system.
Retrieve sms opt out by company idRetrieves the sms opt-out list for a specific company within the dialpad platform.
Retrieve sms subscription by idRetrieves detailed information about a specific sms subscription in dialpad.
Retrieve sms subscriptionsRetrieves a list of sms subscriptions associated with the authenticated user's dialpad account.
Retrieve specific webhook by idRetrieves detailed information about a specific webhook configuration in the dialpad system.
Retrieve stat by idRetrieves detailed statistics and analytics data for a specific entity within the dialpad platform.
Retrieve subscription change logRetrieves the changelog for dialpad api subscriptions.
Retrieve subscription change log by idRetrieves the changelog for a specific subscription in the dialpad system.
Retrieve subscription contactsRetrieves subscription information for contacts in the dialpad system.
Retrieve teams for office idRetrieves a list of teams associated with a specific office in the dialpad organization.
Retrieve user device by idRetrieves detailed information about a specific user device associated with a dialpad account.
Retrieve user devices listRetrieves a list of devices associated with users in the dialpad system.
Retrieve user personas by idRetrieves all personas associated with a specific user in the dialpad system.
Retrieve websocket by idRetrieves detailed information about a specific websocket connection using its unique identifier.
Retrieve websocket connectionRetrieves information about websocket connections or initiates a websocket connection for real-time event subscriptions with dialpad.
Send sms with optional media and group senderThe sendsms endpoint allows you to send sms or mms messages through the dialpad platform to one or multiple recipients.
Set user caller id by idSets or blocks the caller id for a specific dialpad user.
Subscribe contact eventCreates a new contact event subscription in the dialpad platform, allowing you to receive real-time updates about changes to contacts.
Toggle user do not disturb statusThe toggleuserdonotdisturb endpoint allows you to update the do not disturb (dnd) status for a specific user in the dialpad system.
Toggle vi call for user by idToggles the voice intelligence (vi) feature for a specific dialpad user.
Transfer call to destinationTransfers an active call within the dialpad system to a new destination.
Unassign access control policy from userThis endpoint unassigns a user from a specific access control policy in dialpad.
Unassign office numberThis endpoint unassigns a specific phone number from a dialpad office.
Unassign room phone numberThis endpoint unassigns a phone number from a specific room in the dialpad system.
Unassign user phone numberUnassigns a specified phone number from a user's dialpad account.
Unpark call by user idUnparks a previously parked call in the dialpad system.
Update call center settings by idUpdates the configuration of an existing call center in the dialpad platform.
Update call review share link privacyUpdates the privacy settings of an existing call review share link in dialpad.
Update call subscription by idUpdates an existing call event subscription in the dialpad system.
Update contact informationUpdates an existing contact's information in the dialpad system.
Update contact subscription by idUpdates an existing contact event subscription in the dialpad system.
Update e911 address for officeThis endpoint updates the enhanced 911 (e911) address for a specific office in dialpad.
Update e911 address for userUpdates the e911 address for a specified user in the dialpad system.
Update ivr details by idUpdates an existing custom interactive voice response (ivr) workflow in the dialpad system.
Update operator duty statusUpdates the duty status of a specific call center operator in dialpad.
Update recording share link privacyUpdates the privacy settings of a specific recording share link in dialpad.
Update room detailsUpdates the configuration of a specific dialpad room identified by its id.
Update schedule report settingsThe updatescheduledreport endpoint allows you to modify the settings of an existing scheduled report in dialpad.
Update sms subscription settingsUpdates an existing sms event subscription in the dialpad api.
Update user information by idThis endpoint allows you to update various aspects of a user's profile and settings in the dialpad system.
Validate callback requestValidates a callback request for the dialpad system.

What is the Composio tool router, and how does it fit here?

What is Tool Router?

Composio's Tool Router helps agents find the right tools for a task at runtime. You can plug in multiple toolkits (like Gmail, HubSpot, and GitHub), and the agent will identify the relevant app and action to complete multi-step workflows. This can reduce token usage and improve the reliability of tool calls. Read more here: Getting started with Tool Router

The tool router generates a secure MCP URL that your agents can access to perform actions.

How the Tool Router works

The Tool Router follows a three-phase workflow:

  1. Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
  2. Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
  3. Execution: Executes the action using the authenticated connection.

Step-by-step Guide

Prerequisites

You will need:

  • A Composio API key
  • An OpenAI API key (used by Autogen's OpenAIChatCompletionClient)
  • A Dialpad account you can connect to Composio
  • Some basic familiarity with Autogen and Python async

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard 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.
  • Navigate to your API settings and generate a new API key.
  • Store this key securely as you'll need it for authentication.

Install dependencies

bash
pip install composio python-dotenv
pip install autogen-agentchat autogen-ext-openai autogen-ext-tools

Install Composio, Autogen extensions, and dotenv.

What's happening:

  • composio connects your agent to Dialpad via MCP
  • autogen-agentchat provides the AssistantAgent class
  • autogen-ext-openai provides the OpenAI model client
  • autogen-ext-tools provides MCP workbench support

Set up environment variables

bash
COMPOSIO_API_KEY=your-composio-api-key
OPENAI_API_KEY=your-openai-api-key
USER_ID=your-user-identifier@example.com

Create a .env file in your project folder.

What's happening:

  • COMPOSIO_API_KEY is required to talk to Composio
  • OPENAI_API_KEY is used by Autogen's OpenAI client
  • USER_ID is how Composio identifies which user's Dialpad connections to use

Import dependencies and create Tool Router session

python
import asyncio
import os
from dotenv import load_dotenv
from composio import Composio

from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import McpWorkbench, StreamableHttpServerParams

load_dotenv()

async def main():
    # Initialize Composio and create a Dialpad session
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
    session = composio.create(
        user_id=os.getenv("USER_ID"),
        toolkits=["dialpad"]
    )
    url = session.mcp.url
What's happening:
  • load_dotenv() reads your .env file
  • Composio(api_key=...) initializes the SDK
  • create(...) creates a Tool Router session that exposes Dialpad tools
  • session.mcp.url is the MCP endpoint that Autogen will connect to

Configure MCP parameters for Autogen

python
# Configure MCP server parameters for Streamable HTTP
server_params = StreamableHttpServerParams(
    url=url,
    timeout=30.0,
    sse_read_timeout=300.0,
    terminate_on_close=True,
    headers={"x-api-key": os.getenv("COMPOSIO_API_KEY")}
)

Autogen expects parameters describing how to talk to the MCP server. That is what StreamableHttpServerParams is for.

What's happening:

  • url points to the Tool Router MCP endpoint from Composio
  • timeout is the HTTP timeout for requests
  • sse_read_timeout controls how long to wait when streaming responses
  • terminate_on_close=True cleans up the MCP server process when the workbench is closed

Create the model client and agent

python
# Create model client
model_client = OpenAIChatCompletionClient(
    model="gpt-5",
    api_key=os.getenv("OPENAI_API_KEY")
)

# Use McpWorkbench as context manager
async with McpWorkbench(server_params) as workbench:
    # Create Dialpad assistant agent with MCP tools
    agent = AssistantAgent(
        name="dialpad_assistant",
        description="An AI assistant that helps with Dialpad operations.",
        model_client=model_client,
        workbench=workbench,
        model_client_stream=True,
        max_tool_iterations=10
    )

What's happening:

  • OpenAIChatCompletionClient wraps the OpenAI model for Autogen
  • McpWorkbench connects the agent to the MCP tools
  • AssistantAgent is configured with the Dialpad tools from the workbench

Run the interactive chat loop

python
print("Chat started! Type 'exit' or 'quit' to end the conversation.\n")
print("Ask any Dialpad related question or task to the agent.\n")

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

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

    if not user_input:
        continue

    print("\nAgent is thinking...\n")

    # Run the agent with streaming
    try:
        response_text = ""
        async for message in agent.run_stream(task=user_input):
            if hasattr(message, "content") and message.content:
                response_text = message.content

        # Print the final response
        if response_text:
            print(f"Agent: {response_text}\n")
        else:
            print("Agent: I encountered an issue processing your request.\n")

    except Exception as e:
        print(f"Agent: Sorry, I encountered an error: {str(e)}\n")
What's happening:
  • The script prompts you in a loop with You:
  • Autogen passes your input to the model, which decides which Dialpad tools to call via MCP
  • agent.run_stream(...) yields streaming messages as the agent thinks and calls tools
  • Typing exit, quit, or bye ends the loop

Complete Code

Here's the complete code to get you started with Dialpad and AutoGen:

python
import asyncio
import os
from dotenv import load_dotenv
from composio import Composio

from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext.tools.mcp import McpWorkbench, StreamableHttpServerParams

load_dotenv()

async def main():
    # Initialize Composio and create a Dialpad session
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
    session = composio.create(
        user_id=os.getenv("USER_ID"),
        toolkits=["dialpad"]
    )
    url = session.mcp.url

    # Configure MCP server parameters for Streamable HTTP
    server_params = StreamableHttpServerParams(
        url=url,
        timeout=30.0,
        sse_read_timeout=300.0,
        terminate_on_close=True,
        headers={"x-api-key": os.getenv("COMPOSIO_API_KEY")}
    )

    # Create model client
    model_client = OpenAIChatCompletionClient(
        model="gpt-5",
        api_key=os.getenv("OPENAI_API_KEY")
    )

    # Use McpWorkbench as context manager
    async with McpWorkbench(server_params) as workbench:
        # Create Dialpad assistant agent with MCP tools
        agent = AssistantAgent(
            name="dialpad_assistant",
            description="An AI assistant that helps with Dialpad operations.",
            model_client=model_client,
            workbench=workbench,
            model_client_stream=True,
            max_tool_iterations=10
        )

        print("Chat started! Type 'exit' or 'quit' to end the conversation.\n")
        print("Ask any Dialpad related question or task to the agent.\n")

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

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

            if not user_input:
                continue

            print("\nAgent is thinking...\n")

            # Run the agent with streaming
            try:
                response_text = ""
                async for message in agent.run_stream(task=user_input):
                    if hasattr(message, 'content') and message.content:
                        response_text = message.content

                # Print the final response
                if response_text:
                    print(f"Agent: {response_text}\n")
                else:
                    print("Agent: I encountered an issue processing your request.\n")

            except Exception as e:
                print(f"Agent: Sorry, I encountered an error: {str(e)}\n")

if __name__ == "__main__":
    asyncio.run(main())

Conclusion

You now have an Autogen assistant wired into Dialpad through Composio's Tool Router and MCP. From here you can:
  • Add more toolkits to the toolkits list, for example notion or hubspot
  • Refine the agent description to point it at specific workflows
  • Wrap this script behind a UI, Slack bot, or internal tool
Once the pattern is clear for Dialpad, you can reuse the same structure for other MCP-enabled apps with minimal code changes.

How to build Dialpad MCP Agent with another framework

FAQ

What are the differences in Tool Router MCP and Dialpad MCP?

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

Can I use Tool Router MCP with Autogen?

Yes, you can. Autogen 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 Dialpad tools.

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

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

Used by agents from

Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.