How to integrate Gleap MCP with Autogen

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.

Gleap logoGleap
Api Key

Gleap is an all-in-one customer feedback tool for apps and websites. It helps you understand user pain points and improve software through direct, actionable insights.

179 Tools

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.

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

Step by step08 STEPS
1

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
2

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.
3

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

4

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
5

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
6

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
7

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
8

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.
TOOLS

Supported Tools

Every Gleap action and event your agent gets out of the box.

Archive All Tickets

Tool to archive all tickets matching specific type and status criteria.

Archive a Ticket

Tool to archive a ticket.

Clone Engagement

Tool to clone an existing engagement.

Create a Collection

Tool to create a help center collection.

Create AI Content

Tool to create or update AI content in Gleap's knowledge base.

Create a new chat message

Creates a new chat message in a Gleap chat session.

Create a new session

Create a new user session in Gleap and associate it with a project.

Create a new team

Tool to create a new team.

Create a new ticket

Create a new support ticket in Gleap with detailed information including title, description, type, priority, status, tags, and attachments.

Create Engagement Banner

Tool to create a new engagement banner in Gleap.

Create Engagement Checklist

Tool to create a new engagement checklist.

Create Engagement Cobrowse

Tool to create a new cobrowse product tour.

Create Engagement Email

Tool to create a new engagement email in Gleap.

Create Engagement Modal

Tool to create a new engagement modal in Gleap.

Create Engagement Product Tour

Tool to create a new product tour in Gleap.

Create Engagement Push Notification

Tool to create a new push notification in Gleap.

Create Engagement Tooltip

Tool to create a new engagement tooltip in Gleap.

Create feedback item

Tool to manually create a feedback item (bug) in a Gleap project.

Create Help Center Redirect

Tool to create a new redirect for help center URLs.

Create Message Template

Tool to create a new message template in Gleap.

Create new conversation with session

Create a new conversation with a session in Gleap.

Create QA Snippet

Tool to create a QA snippet (question-answer pair) in Gleap.

Create Tracker Ticket

Tool to create a tracker ticket in Gleap.

Delete AI Content

Tool to delete AI content by content ID.

Delete AI Content Batch

Tool to delete all AI content by batchId.

Delete a User from a Project

Removes a user (team member) from a Gleap project, revoking their access.

Delete Bugs

Tool to delete a bug/ticket by ID.

Delete Engagement Banner

Tool to delete an engagement banner.

Delete Engagement Chat Message

Deletes an engagement chat message from Gleap by its ID.

Delete Engagement Checklist

Tool to delete an engagement checklist by its ID.

Delete Engagement Cobrowse

Tool to delete a cobrowse product tour by its ID.

Delete Engagement Email

Tool to delete an engagement email by its ID.

Delete Engagement Modal

Tool to delete an engagement modal from a Gleap project.

Delete Engagement News

Tool to delete an engagement news article.

Delete Engagement Product Tour

Tool to delete an engagement product tour by its ID.

Delete Engagement Push Notification

Tool to delete an engagement push notification by its ID.

Delete Engagement Surveys

Tool to delete an engagement survey.

Delete Engagement Tooltips

Tool to delete an engagement tooltip.

Delete Engagement WhatsApp Message

Tool to delete an engagement WhatsApp message by its ID.

Delete Help Center Collection

Tool to delete a help center collection by ID.

Delete Help Center Redirect

Tool to delete a help center redirect.

Delete Message

Tool to delete a message (comment) from a bug or ticket.

Delete Message Template

Tool to delete a message template.

Delete Old AI Content Batches

Delete all AI content batches except the current batch.

Delete QA Answer

Tool to delete a QA answer (snippet) from a Gleap project.

Delete project session

Tool to delete a session from a Gleap project.

Delete session

Tool to delete a session by ID.

Delete Team

Tool to delete a team by ID.

Delete Ticket

Tool to delete a ticket by ID.

Export sessions

Tool to export sessions for the authenticated project in CSV format.

Export Statistics Lists

Tool to export statistics list data as CSV from Gleap.

Generate ticket draft reply

Tool to generate an AI-powered draft reply for a ticket.

Generate tracker ticket data

Tool to generate AI-powered tracker ticket data from an existing ticket.

Get a Checklist

Tool to retrieve a specific engagement checklist by its ID.

Get a Collection

Tool to retrieve a help center collection by ID.

Get AI content

Tool to retrieve AI content by its content ID.

Get all articles

Tool to retrieve articles in a help center collection.

Get all chat messages

Retrieves all engagement chat messages from the current Gleap project.

Get All Collections

Retrieves all help center collections for the authenticated project.

Get All Invitations for a Project

Retrieves all pending invitations for a project.

Get all sessions

Retrieves all user sessions for the authenticated project.

Get All Teams

Tool to retrieve all teams.

Get All Tickets

Retrieve tickets from a Gleap project with optional filtering, sorting, and pagination.

Get All Users for a Project

Tool to retrieve all users for a project.

Get a ticket

Retrieves complete details for a specific ticket by its ID.

Get current user

Retrieves the authenticated user's profile including email, name, user type, availability status, notification preferences, and 2FA settings.

Get engagement activities count

Tool to retrieve the count of activities for a specific engagement.

Get engagement banner

Tool to retrieve an engagement banner by its ID.

Get Engagement Banners

Tool to retrieve all engagement banners from a Gleap project.

Get engagement chat message

Retrieves a specific engagement chat message by its ID.

Get Engagement Checklists

Tool to retrieve all engagement checklists for a project.

Get Engagement Cobrowse

Retrieves all cobrowse product tours for the authenticated project.

Get engagement cobrowse by ID

Tool to retrieve a specific cobrowse product tour by its ID.

Get engagement email

Retrieves a specific engagement email by its ID.

Get Engagement Emails

Tool to retrieve all engagement emails from a Gleap project.

Get engagement modal

Tool to retrieve an engagement modal by its ID.

Get Engagement Modals

Tool to retrieve all engagement modals from a Gleap project.

Get Engagement News

Tool to retrieve all engagement news articles from a Gleap project.

Get engagement news article

Retrieves a specific engagement news article by its ID.

Get a Product Tour

Tool to retrieve a specific engagement product tour by its ID.

Get Engagement Product Tours

Tool to retrieve all engagement product tours for a project.

Get engagement push notification

Retrieves a specific engagement push notification by its ID.

Get Engagement Push Notifications

Tool to retrieve all engagement push notifications from a Gleap project.

Get Engagements Activities

Tool to retrieve all activities for a specific engagement.

Get engagement recipients

Tool to find and retrieve recipients for a specific engagement.

Get engagement statistics

Tool to retrieve statistics for a specific engagement.

Get Engagement Survey

Tool to retrieve a survey by its ID.

Get Engagement Surveys

Tool to retrieve all engagement surveys from a Gleap project.

Get Survey Responses

Tool to retrieve all survey responses for a specific survey.

Get Engagement Survey Response Samples

Tool to retrieve survey response samples for a specific engagement survey.

Summarize Survey Responses

Tool to retrieve an AI-generated summary of survey responses.

Get Engagement Tooltip by ID

Tool to retrieve a specific engagement tooltip by its ID.

Get Engagement Tooltips

Tool to retrieve all engagement tooltips for the authenticated project.

Get engagement WhatsApp message

Retrieves a specific engagement WhatsApp message by its ID.

Get Help Center Sources

Retrieves all configured help center sources (knowledge base content sources) for the project.

Get Invitations

Retrieves all invitations for the authenticated user.

Get message template

Retrieves a specific message template by its ID from a Gleap project.

Get Message Templates

Retrieve all message templates for the authenticated project.

Get notification ticket

Retrieves detailed information about a Gleap ticket using its notification share token.

Get project

Retrieves complete details for a specific project by its ID.

Get Projects

Retrieves all projects accessible to the authenticated user.

Get archived bugs

Tool to retrieve archived bugs for a specific project.

Get Projects Help Center Collections

Tool to get all help center collections for a project.

Get project sessions

Tool to retrieve all sessions for a specific project.

Get Projects Tickets

Tool to retrieve all tickets from a specific Gleap project.

Get project users

Tool to get project users by project ID.

Get a session

Retrieves detailed information for a specific session by its ID.

Get session activities

Retrieves all activities for a specific session by session ID.

Get session Chargebee info

Tool to retrieve Chargebee billing information for a specific session.

Get Session Checklists

Retrieve all engagement checklists associated with a user session in Gleap.

Get session events by ID

Tool to retrieve all streamed events for a specific session by its ID.

Get session LemonSqueezy info

Tool to retrieve LemonSqueezy subscription and payment information for a specific session.

Get Session Shopify Info

Retrieve Shopify information associated with a user session in Gleap.

Get Shared Help Center Answer

Retrieves an answer to a question from the shared help center knowledge base.

Get email client bounce statistics

Tool to retrieve email client bounce statistics from Gleap.

Get Email Client Usage Statistics

Tool to retrieve email client usage statistics from Gleap.

Get email overview statistics

Tool to retrieve email overview statistics from Gleap.

Get statistics facts

Tool to retrieve fact data for various statistics from Gleap.

Get Statistics Heatmap

Retrieve heatmap data for activity patterns in Gleap.

Get Statistics Lists

Tool to retrieve statistics list data from Gleap.

Get Statistics Raw Data

Tool to retrieve raw statistics data from Gleap.

Get Tickets By Session Query

Find tickets by session query parameters such as email, userId, phone, or custom data.

Get Tickets Export

Export tickets from Gleap project with optional filtering and sorting.

Get Tickets Export Fields

Retrieve available fields for ticket export from Gleap.

Search Tickets by Term

Search for tickets using a text search term in Gleap.

Get Tickets Count

Tool to get the total count of tickets in a Gleap project.

Get current user's permissions

Tool to retrieve the current user's role permissions.

Get users unified inbox

Retrieves tickets from the unified inbox for the authenticated user.

Get users unified inbox ticket

Retrieves complete details for a specific ticket from the unified inbox by its ID.

Identify or update user

Identify or update a user's information in Gleap.

Import session

Import user sessions into Gleap for tracking and analytics.

Import sessions from Intercom

Import user sessions from Intercom into Gleap.

Indicate user typing

Tool to indicate that a user is typing in a ticket conversation.

Indicate user viewing

Tool to indicate that a user is viewing a ticket.

Link a Ticket

Tool to link a ticket.

Mark Survey Responses as Read

Tool to mark all survey responses as read for a given survey.

Merge tickets

Tool to merge multiple tickets into a single target ticket in Gleap.

Post a comment on a bug

Tool to post a comment/message on a bug or ticket in Gleap.

Create Engagement News Article

Tool to create a new engagement news article in Gleap.

Create Engagement Survey

Tool to create a new survey in Gleap.

Create WhatsApp Engagement Message

Tool to create a new WhatsApp message in Gleap for user engagement.

Reassign all tickets to user

Tool to reassign all tickets to the authenticated user.

Resubscribe a Session

Tool to resubscribe a session.

Search for sessions

Search for sessions in Gleap using various filter criteria.

Search messages

Search messages in Gleap by search term.

Search sessions by index

Search for sessions in a project using the session search index.

Send Engagement Email Preview

Tool to send a preview of an engagement email to specified email addresses.

Send ticket transcript

Tool to send ticket conversation transcript to multiple email addresses.

Snooze a Ticket

Tool to snooze a ticket for a specified duration.

Suggest FAQ from message

Tool to suggest a FAQ from a message.

Toggle Collection Publish Status

Tool to toggle the publish status of a help center collection.

Track events

Track custom user events in Gleap for analytics and user behavior monitoring.

Unarchive a Ticket

Tool to unarchive a ticket.

Unlink a Ticket

Tool to unlink a ticket.

Unsubscribe sessions

Tool to unsubscribe one or more user sessions from communications.

Update AI Content by Content ID

Tool to update AI content by content ID.

Update a team

Tool to update an existing team.

Update a ticket

Tool to update an existing ticket/bug in Gleap.

Update a User for a Project

Tool to update a user’s role in a project.

Update Chat Message

Updates an existing chat message in Gleap by its ID.

Update a Checklist

Tool to update an engagement checklist by its ID.

Update Engagement Banner

Tool to update an engagement banner.

Update Engagement Cobrowse

Tool to update an existing cobrowse product tour.

Update Engagement Email

Tool to update an existing engagement email.

Update Engagement Modal

Tool to update an existing engagement modal.

Update Engagement News

Tool to update an engagement news article.

Update Engagement Product Tour

Tool to update an existing product tour.

Update Engagement Push Notification

Tool to update an existing push notification.

Update Engagement Survey

Tool to update an existing engagement survey in Gleap.

Update Engagement Tooltips

Tool to update an engagement tooltip.

Update Engagement WhatsApp Message

Tool to update an existing engagement WhatsApp message.

Update Helpcenter Collection

Tool to update a help center collection.

Update help center redirect

Tool to update an existing help center redirect.

Update message template

Tool to update an existing message template in Gleap.

Update project

Tool to update a Gleap project's configuration including name, description, notification settings, and feedback tags.

Update QA Answer

Updates an existing QA answer/snippet in Gleap.

Update a session

Tool to update an existing session in Gleap.

Update user

Tool to update a user's profile information including name, availability, profile image, onboarding status, and notification settings.

Vote for ticket

Tool to vote for a ticket in Gleap.

FAQ

Frequently asked questions

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.

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.

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.

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.

Start with Gleap.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Gleap tool your agent needs.Free to start.

Start building