How to integrate Gleap MCP with Autogen

Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Gleap logo
AutoGen logo
divider

Introduction

This guide walks you through connecting Gleap to AutoGen using the Composio tool router. By the end, you'll have a working Gleap agent that can archive resolved support tickets from last week, send a chat message to follow up on feedback, list all articles in the onboarding collection through natural language commands.

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

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

Also integrate Gleap with

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 Gleap
  • Wire that MCP URL into Autogen using McpWorkbench and StreamableHttpServerParams
  • Configure an Autogen AssistantAgent that can call Gleap tools
  • Run a live chat loop where you ask the agent to perform Gleap 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 Gleap MCP server, and what's possible with it?

The Gleap MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Gleap account. It provides structured and secure access to your customer feedback data, so your agent can perform actions like managing support tickets, communicating with users, organizing help center content, and handling team workflows on your behalf.

  • Ticket creation and management: Instantly create new support tickets, archive resolved issues, or retrieve existing tickets to streamline customer support workflows.
  • Chat and user communication: Allow your agent to send new chat messages or fetch entire chat histories, making it easy to keep conversations going with users.
  • Help center organization: Create collections or retrieve articles in your help center, enabling your agent to help manage and organize your knowledge base content efficiently.
  • Team and user administration: Add new teams for ticket assignment or remove users from projects, so you can stay on top of team management tasks without lifting a finger.
  • Checklist and engagement tracking: Fetch detailed checklists to monitor user engagement or onboarding progress, giving your agent context to provide personalized support.

Supported Tools & Triggers

Tools
Archive All TicketsTool to archive all tickets matching specific type and status criteria.
Archive a TicketTool to archive a ticket.
Clone EngagementTool to clone an existing engagement.
Create a CollectionTool to create a help center collection.
Create AI ContentTool to create or update AI content in Gleap's knowledge base.
Create a new chat messageCreates a new chat message in a Gleap chat session.
Create a new sessionCreate a new user session in Gleap and associate it with a project.
Create a new teamTool to create a new team.
Create a new ticketCreate a new support ticket in Gleap with detailed information including title, description, type, priority, status, tags, and attachments.
Create Engagement BannerTool to create a new engagement banner in Gleap.
Create Engagement ChecklistTool to create a new engagement checklist.
Create Engagement CobrowseTool to create a new cobrowse product tour.
Create Engagement EmailTool to create a new engagement email in Gleap.
Create Engagement ModalTool to create a new engagement modal in Gleap.
Create Engagement Product TourTool to create a new product tour in Gleap.
Create Engagement Push NotificationTool to create a new push notification in Gleap.
Create Engagement TooltipTool to create a new engagement tooltip in Gleap.
Create feedback itemTool to manually create a feedback item (bug) in a Gleap project.
Create Help Center RedirectTool to create a new redirect for help center URLs.
Create Message TemplateTool to create a new message template in Gleap.
Create new conversation with sessionCreate a new conversation with a session in Gleap.
Create QA SnippetTool to create a QA snippet (question-answer pair) in Gleap.
Create Tracker TicketTool to create a tracker ticket in Gleap.
Delete AI ContentTool to delete AI content by content ID.
Delete AI Content BatchTool to delete all AI content by batchId.
Delete a User from a ProjectRemoves a user (team member) from a Gleap project, revoking their access.
Delete BugsTool to delete a bug/ticket by ID.
Delete Engagement BannerTool to delete an engagement banner.
Delete Engagement Chat MessageDeletes an engagement chat message from Gleap by its ID.
Delete Engagement ChecklistTool to delete an engagement checklist by its ID.
Delete Engagement CobrowseTool to delete a cobrowse product tour by its ID.
Delete Engagement EmailTool to delete an engagement email by its ID.
Delete Engagement ModalTool to delete an engagement modal from a Gleap project.
Delete Engagement NewsTool to delete an engagement news article.
Delete Engagement Product TourTool to delete an engagement product tour by its ID.
Delete Engagement Push NotificationTool to delete an engagement push notification by its ID.
Delete Engagement SurveysTool to delete an engagement survey.
Delete Engagement TooltipsTool to delete an engagement tooltip.
Delete Engagement WhatsApp MessageTool to delete an engagement WhatsApp message by its ID.
Delete Help Center CollectionTool to delete a help center collection by ID.
Delete Help Center RedirectTool to delete a help center redirect.
Delete MessageTool to delete a message (comment) from a bug or ticket.
Delete Message TemplateTool to delete a message template.
Delete Old AI Content BatchesDelete all AI content batches except the current batch.
Delete QA AnswerTool to delete a QA answer (snippet) from a Gleap project.
Delete project sessionTool to delete a session from a Gleap project.
Delete sessionTool to delete a session by ID.
Delete TeamTool to delete a team by ID.
Delete TicketTool to delete a ticket by ID.
Export sessionsTool to export sessions for the authenticated project in CSV format.
Export Statistics ListsTool to export statistics list data as CSV from Gleap.
Generate ticket draft replyTool to generate an AI-powered draft reply for a ticket.
Generate tracker ticket dataTool to generate AI-powered tracker ticket data from an existing ticket.
Get a ChecklistTool to retrieve a specific engagement checklist by its ID.
Get a CollectionTool to retrieve a help center collection by ID.
Get AI contentTool to retrieve AI content by its content ID.
Get all articlesTool to retrieve articles in a help center collection.
Get all chat messagesRetrieves all engagement chat messages from the current Gleap project.
Get All CollectionsRetrieves all help center collections for the authenticated project.
Get All Invitations for a ProjectRetrieves all pending invitations for a project.
Get all sessionsRetrieves all user sessions for the authenticated project.
Get All TeamsTool to retrieve all teams.
Get All TicketsRetrieve tickets from a Gleap project with optional filtering, sorting, and pagination.
Get All Users for a ProjectTool to retrieve all users for a project.
Get a ticketRetrieves complete details for a specific ticket by its ID.
Get current userRetrieves the authenticated user's profile including email, name, user type, availability status, notification preferences, and 2FA settings.
Get engagement activities countTool to retrieve the count of activities for a specific engagement.
Get engagement bannerTool to retrieve an engagement banner by its ID.
Get Engagement BannersTool to retrieve all engagement banners from a Gleap project.
Get engagement chat messageRetrieves a specific engagement chat message by its ID.
Get Engagement ChecklistsTool to retrieve all engagement checklists for a project.
Get Engagement CobrowseRetrieves all cobrowse product tours for the authenticated project.
Get engagement cobrowse by IDTool to retrieve a specific cobrowse product tour by its ID.
Get engagement emailRetrieves a specific engagement email by its ID.
Get Engagement EmailsTool to retrieve all engagement emails from a Gleap project.
Get engagement modalTool to retrieve an engagement modal by its ID.
Get Engagement ModalsTool to retrieve all engagement modals from a Gleap project.
Get Engagement NewsTool to retrieve all engagement news articles from a Gleap project.
Get engagement news articleRetrieves a specific engagement news article by its ID.
Get a Product TourTool to retrieve a specific engagement product tour by its ID.
Get Engagement Product ToursTool to retrieve all engagement product tours for a project.
Get engagement push notificationRetrieves a specific engagement push notification by its ID.
Get Engagement Push NotificationsTool to retrieve all engagement push notifications from a Gleap project.
Get Engagements ActivitiesTool to retrieve all activities for a specific engagement.
Get engagement recipientsTool to find and retrieve recipients for a specific engagement.
Get engagement statisticsTool to retrieve statistics for a specific engagement.
Get Engagement SurveyTool to retrieve a survey by its ID.
Get Engagement SurveysTool to retrieve all engagement surveys from a Gleap project.
Get Survey ResponsesTool to retrieve all survey responses for a specific survey.
Get Engagement Survey Response SamplesTool to retrieve survey response samples for a specific engagement survey.
Summarize Survey ResponsesTool to retrieve an AI-generated summary of survey responses.
Get Engagement Tooltip by IDTool to retrieve a specific engagement tooltip by its ID.
Get Engagement TooltipsTool to retrieve all engagement tooltips for the authenticated project.
Get engagement WhatsApp messageRetrieves a specific engagement WhatsApp message by its ID.
Get Help Center SourcesRetrieves all configured help center sources (knowledge base content sources) for the project.
Get InvitationsRetrieves all invitations for the authenticated user.
Get message templateRetrieves a specific message template by its ID from a Gleap project.
Get Message TemplatesRetrieve all message templates for the authenticated project.
Get notification ticketRetrieves detailed information about a Gleap ticket using its notification share token.
Get projectRetrieves complete details for a specific project by its ID.
Get ProjectsRetrieves all projects accessible to the authenticated user.
Get archived bugsTool to retrieve archived bugs for a specific project.
Get Projects Help Center CollectionsTool to get all help center collections for a project.
Get project sessionsTool to retrieve all sessions for a specific project.
Get Projects TicketsTool to retrieve all tickets from a specific Gleap project.
Get project usersTool to get project users by project ID.
Get a sessionRetrieves detailed information for a specific session by its ID.
Get session activitiesRetrieves all activities for a specific session by session ID.
Get session Chargebee infoTool to retrieve Chargebee billing information for a specific session.
Get Session ChecklistsRetrieve all engagement checklists associated with a user session in Gleap.
Get session events by IDTool to retrieve all streamed events for a specific session by its ID.
Get session LemonSqueezy infoTool to retrieve LemonSqueezy subscription and payment information for a specific session.
Get Session Shopify InfoRetrieve Shopify information associated with a user session in Gleap.
Get Shared Help Center AnswerRetrieves an answer to a question from the shared help center knowledge base.
Get email client bounce statisticsTool to retrieve email client bounce statistics from Gleap.
Get Email Client Usage StatisticsTool to retrieve email client usage statistics from Gleap.
Get email overview statisticsTool to retrieve email overview statistics from Gleap.
Get statistics factsTool to retrieve fact data for various statistics from Gleap.
Get Statistics HeatmapRetrieve heatmap data for activity patterns in Gleap.
Get Statistics ListsTool to retrieve statistics list data from Gleap.
Get Statistics Raw DataTool to retrieve raw statistics data from Gleap.
Get Tickets By Session QueryFind tickets by session query parameters such as email, userId, phone, or custom data.
Get Tickets ExportExport tickets from Gleap project with optional filtering and sorting.
Get Tickets Export FieldsRetrieve available fields for ticket export from Gleap.
Search Tickets by TermSearch for tickets using a text search term in Gleap.
Get Tickets CountTool to get the total count of tickets in a Gleap project.
Get current user's permissionsTool to retrieve the current user's role permissions.
Get users unified inboxRetrieves tickets from the unified inbox for the authenticated user.
Get users unified inbox ticketRetrieves complete details for a specific ticket from the unified inbox by its ID.
Identify or update userIdentify or update a user's information in Gleap.
Import sessionImport user sessions into Gleap for tracking and analytics.
Import sessions from IntercomImport user sessions from Intercom into Gleap.
Indicate user typingTool to indicate that a user is typing in a ticket conversation.
Indicate user viewingTool to indicate that a user is viewing a ticket.
Link a TicketTool to link a ticket.
Mark Survey Responses as ReadTool to mark all survey responses as read for a given survey.
Merge ticketsTool to merge multiple tickets into a single target ticket in Gleap.
Post a comment on a bugTool to post a comment/message on a bug or ticket in Gleap.
Create Engagement News ArticleTool to create a new engagement news article in Gleap.
Create Engagement SurveyTool to create a new survey in Gleap.
Create WhatsApp Engagement MessageTool to create a new WhatsApp message in Gleap for user engagement.
Reassign all tickets to userTool to reassign all tickets to the authenticated user.
Resubscribe a SessionTool to resubscribe a session.
Search for sessionsSearch for sessions in Gleap using various filter criteria.
Search messagesSearch messages in Gleap by search term.
Search sessions by indexSearch for sessions in a project using the session search index.
Send Engagement Email PreviewTool to send a preview of an engagement email to specified email addresses.
Send ticket transcriptTool to send ticket conversation transcript to multiple email addresses.
Snooze a TicketTool to snooze a ticket for a specified duration.
Suggest FAQ from messageTool to suggest a FAQ from a message.
Toggle Collection Publish StatusTool to toggle the publish status of a help center collection.
Track eventsTrack custom user events in Gleap for analytics and user behavior monitoring.
Unarchive a TicketTool to unarchive a ticket.
Unlink a TicketTool to unlink a ticket.
Unsubscribe sessionsTool to unsubscribe one or more user sessions from communications.
Update AI Content by Content IDTool to update AI content by content ID.
Update a teamTool to update an existing team.
Update a ticketTool to update an existing ticket/bug in Gleap.
Update a User for a ProjectTool to update a user’s role in a project.
Update Chat MessageUpdates an existing chat message in Gleap by its ID.
Update a ChecklistTool to update an engagement checklist by its ID.
Update Engagement BannerTool to update an engagement banner.
Update Engagement CobrowseTool to update an existing cobrowse product tour.
Update Engagement EmailTool to update an existing engagement email.
Update Engagement ModalTool to update an existing engagement modal.
Update Engagement NewsTool to update an engagement news article.
Update Engagement Product TourTool to update an existing product tour.
Update Engagement Push NotificationTool to update an existing push notification.
Update Engagement SurveyTool to update an existing engagement survey in Gleap.
Update Engagement TooltipsTool to update an engagement tooltip.
Update Engagement WhatsApp MessageTool to update an existing engagement WhatsApp message.
Update Helpcenter CollectionTool to update a help center collection.
Update help center redirectTool to update an existing help center redirect.
Update message templateTool to update an existing message template in Gleap.
Update projectTool to update a Gleap project's configuration including name, description, notification settings, and feedback tags.
Update QA AnswerUpdates an existing QA answer/snippet in Gleap.
Update a sessionTool to update an existing session in Gleap.
Update userTool to update a user's profile information including name, availability, profile image, onboarding status, and notification settings.
Vote for ticketTool to vote for a ticket in Gleap.

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

What is Composio SDK?

Composio's Composio SDK 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 Composio SDK

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

How the Composio SDK works

The Composio SDK 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 Gleap 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 Gleap 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 Gleap 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 Gleap session
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
    session = composio.create(
        user_id=os.getenv("USER_ID"),
        toolkits=["gleap"]
    )
    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 Gleap 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 Gleap assistant agent with MCP tools
    agent = AssistantAgent(
        name="gleap_assistant",
        description="An AI assistant that helps with Gleap 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 Gleap 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 Gleap 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 Gleap 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 Gleap 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 Gleap session
    composio = Composio(api_key=os.getenv("COMPOSIO_API_KEY"))
    session = composio.create(
        user_id=os.getenv("USER_ID"),
        toolkits=["gleap"]
    )
    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 Gleap assistant agent with MCP tools
        agent = AssistantAgent(
            name="gleap_assistant",
            description="An AI assistant that helps with Gleap 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 Gleap 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 Gleap 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 Gleap, you can reuse the same structure for other MCP-enabled apps with minimal code changes.

How to build Gleap MCP Agent with another framework

FAQ

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

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

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

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

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
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.