How to integrate Chatbotkit MCP with Google ADK

Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Chatbotkit logo
Google ADK logo
divider

Introduction

This guide walks you through connecting Chatbotkit to Google ADK using the Composio tool router. By the end, you'll have a working Chatbotkit agent that can list all bots i’ve deployed, show recent messages in a conversation, create a new skillset for support through natural language commands.

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

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

Also integrate Chatbotkit with

TL;DR

Here's what you'll learn:
  • Get a Chatbotkit account set up and connected to Composio
  • Install the Google ADK and Composio packages
  • Create a Composio Tool Router session for Chatbotkit
  • Build an agent that connects to Chatbotkit through MCP
  • Interact with Chatbotkit using natural language

What is Google ADK?

Google ADK (Agents Development Kit) is Google's framework for building AI agents powered by Gemini models. It provides tools for creating agents that can use external services through the Model Context Protocol.

Key features include:

  • Gemini Integration: Native support for Google's Gemini models
  • MCP Toolset: Built-in support for Model Context Protocol tools
  • Streamable HTTP: Connect to external services through streamable HTTP
  • CLI and Web UI: Run agents via command line or web interface

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

The Chatbotkit MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Chatbotkit account. It provides structured and secure access to your chatbot platform, so your agent can perform actions like managing bots, handling conversations, integrating support channels, and organizing skillsets on your behalf.

  • Manage and list bots: Effortlessly retrieve and manage all of your chatbots, making it simple to keep tabs on each one in your workspace.
  • Conversation tracking and messaging: Browse conversation history, fetch conversation messages, and send new messages for dynamic real-time interactions with users.
  • Integration setup and management: Create and list integrations to connect your bots with external channels or support systems without manual configuration.
  • Skillset and dataset organization: Create, list, and manage skillsets and datasets to extend your bots’ capabilities and tailor responses to your business needs.
  • Partner and sub-account management: View and organize all partner accounts or sub-accounts associated with your main Chatbotkit account for streamlined administration.

Supported Tools & Triggers

Tools
Attach Dataset FileTool to attach a file to a dataset as a source.
Authenticate SecretTool to authenticate a secret by its ID.
Clone BlueprintTool to clone an existing blueprint.
Clone BotTool to clone an existing bot.
Clone Platform ExampleTool to clone a platform example.
Clone Widget IntegrationTool to clone an existing widget integration.
Complete ConversationSend a message to a ChatBotKit conversation and receive the bot's AI-generated reply.
Create BlueprintTool to create a new blueprint in ChatBotKit.
Create Blueprint (GraphQL)Tool to create a new blueprint template via GraphQL mutation.
Create BotTool to create a new AI bot with configurable settings.
Create Bot (GraphQL)Tool to create a new bot using GraphQL mutation.
Create Bot SessionCreates a new bot session with an associated conversation and authentication token.
Create ContactTool to create a new contact.
Create ConversationTool to create a new conversation.
Create conversation messageTool to create a new message in an existing conversation.
Create conversation message batchTool to create multiple messages in a conversation in a single batch operation.
Create Conversation SessionTool to create a new conversation session with an authentication token.
Create Dataset (GraphQL)Tool to create a new dataset using GraphQL mutation.
Create Dataset RecordTool to create a new record in a dataset.
Create Discord IntegrationTool to create a Discord integration for a ChatBotKit bot.
Create Email IntegrationTool to create a new email integration for a ChatBotKit bot.
Create Extract IntegrationTool to create a new Extract integration for a ChatBotKit bot.
Create FileTool to create a new file resource in ChatBotKit.
Create Instagram IntegrationTool to create an Instagram integration for a ChatBotKit bot.
Create Support IntegrationCreates a new support integration for a ChatBotKit bot.
Create MCP Server IntegrationTool to create a new MCP Server integration for ChatBotKit.
Create MemoryTool to create a new memory entry.
Create Messenger IntegrationTool to create a Facebook Messenger integration for a ChatBotKit bot.
Create Notion IntegrationTool to create a Notion integration for a ChatBotKit dataset.
Create RatingTool to create a rating in ChatBotKit.
Create SecretTool to create a new secret in ChatBotKit.
Create Secret (GraphQL)Tool to create a new secret via GraphQL mutation.
Create Sitemap IntegrationTool to create a sitemap integration for a ChatBotKit dataset.
Create SkillsetTool to create a new skillset.
Create Slack IntegrationTool to create a Slack integration for a ChatBotKit bot.
Create SpaceTool to create a new space in ChatBotKit.
Create TaskTool to create a new background task that can be triggered to perform automated operations.
Create Telegram IntegrationTool to create a Telegram integration for a ChatBotKit bot.
Create Trigger IntegrationTool to create a Trigger integration for a ChatBotKit bot.
Create Twilio IntegrationTool to create a Twilio integration for a ChatBotKit bot.
Create WhatsApp IntegrationCreates a new WhatsApp integration for a ChatBotKit bot.
Create Widget IntegrationTool to create a Widget integration for a ChatBotKit bot.
Create Widget Integration SessionCreates a new widget integration session for interactive chat.
Delete BlueprintTool to permanently delete a blueprint from ChatBotKit.
Delete Blueprint (GraphQL)Tool to permanently delete a blueprint template via GraphQL mutation.
Delete BotTool to delete a bot.
Delete Bot (GraphQL)Tool to delete a bot via GraphQL mutation.
Delete ContactTool to permanently delete a contact from ChatBotKit.
Delete ConversationTool to permanently delete a conversation from ChatBotKit.
Delete Conversation MessageTool to permanently delete a message from a conversation in ChatBotKit.
Delete DatasetTool to permanently delete a dataset from ChatBotKit.
Delete Dataset (GraphQL)Tool to delete a dataset via GraphQL mutation.
Delete Dataset RecordTool to permanently delete a record from a dataset.
Delete Discord IntegrationTool to delete a Discord integration.
Delete Email IntegrationTool to permanently delete an Email integration from ChatBotKit.
Delete Extract IntegrationTool to delete an Extract integration.
Delete FileTool to permanently delete a file from ChatBotKit.
Delete Instagram IntegrationTool to permanently delete an Instagram integration from ChatBotKit.
Delete Integration (GraphQL)Tool to delete an integration via GraphQL mutation.
Delete MCP Server IntegrationTool to delete an MCP Server integration.
Delete MemoryTool to permanently delete a memory from ChatBotKit.
Delete Messenger IntegrationTool to permanently delete a Messenger integration from ChatBotKit.
Delete Notion IntegrationTool to permanently delete a Notion integration from ChatBotKit.
Delete Partner UserTool to permanently delete a partner user account.
Delete RatingTool to permanently delete a rating from ChatBotKit.
Delete SecretTool to permanently delete a secret from ChatBotKit.
Delete Sitemap IntegrationTool to permanently delete a Sitemap integration from ChatBotKit.
Delete SkillsetTool to delete a skillset.
Delete Skillset AbilityTool to delete an ability from a skillset.
Delete Slack IntegrationTool to delete a Slack integration.
Delete SpaceTool to permanently delete a space from ChatBotKit.
Delete Support IntegrationTool to delete a Support integration.
Delete TaskTool to permanently delete a task from ChatBotKit.
Delete Telegram IntegrationTool to permanently delete a Telegram integration from ChatBotKit.
Delete Trigger IntegrationTool to permanently delete a Trigger integration from ChatBotKit.
Delete Twilio IntegrationTool to delete a Twilio integration.
Delete WhatsApp IntegrationTool to permanently delete a WhatsApp integration from ChatBotKit.
Delete Widget IntegrationTool to delete a Widget integration.
Detach Dataset FileTool to detach a file from a dataset.
Download FileTool to download a file by its ID.
Downvote BotTool to downvote a bot in ChatBotKit.
Downvote ConversationTool to downvote a conversation in ChatBotKit.
Downvote Conversation MessageTool to downvote a conversation message in ChatBotKit.
Ensure ContactTool to ensure a contact exists or create a new one.
Execute GraphQL QueryTool to execute a GraphQL query or mutation against the ChatBotKit API.
Export ContactsTool to export contacts with pagination support.
Export ConversationsTool to export conversations with pagination support.
Export Dataset RecordsTool to export dataset records with pagination support.
Export Event LogsTool to export event logs with pagination support.
Export MemoriesTool to export memories with pagination support.
Export Skillset AbilitiesTool to export all abilities from a specific skillset with pagination support.
Export SpacesTool to export spaces with pagination support.
Export TasksTool to export tasks with pagination support.
Fetch BlueprintTool to fetch a blueprint by ID.
Fetch Blueprint (GraphQL)Tool to fetch a single blueprint by ID using GraphQL.
Fetch BotTool to fetch a specific bot by its ID.
Fetch Bot (GraphQL)Tool to fetch a single bot by ID using GraphQL query.
Fetch Bot UsageTool to fetch bot usage statistics for a specific bot.
Fetch ContactTool to retrieve detailed information about a specific contact by ID.
Fetch ConversationTool to retrieve full details of a specific conversation by its ID.
Fetch Conversation MessageTool to retrieve full details of a specific message within a conversation.
Fetch Conversation UsageTool to fetch usage statistics for a specific conversation.
Fetch Conversation With Messages (GraphQL)Tool to fetch a single conversation by ID with messages and metadata using GraphQL.
Fetch DatasetTool to fetch a specific dataset by its ID.
Fetch Dataset via GraphQLTool to fetch a single dataset by ID using GraphQL.
Fetch Dataset RecordTool to fetch a specific record from a dataset by its ID.
Fetch Discord IntegrationTool to fetch a specific Discord integration by its ID.
Fetch Email IntegrationTool to fetch a specific Email integration by its ID.
Fetch Extract IntegrationTool to fetch a specific Extract integration by its ID.
Fetch FileTool to retrieve detailed metadata about a specific file by its ID.
Fetch File (GraphQL)Tool to fetch a single file by ID using GraphQL.
Fetch Instagram IntegrationTool to fetch a specific Instagram integration by its ID.
Fetch MCP Server IntegrationTool to fetch a specific MCP Server integration by its ID.
Fetch MemoryTool to retrieve detailed information about a specific memory by ID.
Fetch Messenger IntegrationTool to fetch a specific Messenger integration by its ID.
Fetch Notion IntegrationTool to fetch a specific Notion integration by its ID.
Fetch Platform DocTool to fetch a specific platform documentation by its ID.
Fetch Platform ExampleTool to fetch a specific platform example with full configuration details by its ID.
Fetch Platform ManualTool to fetch a specific platform manual by its ID.
Fetch Platform Manuals (GraphQL)Tool to fetch platform manuals using GraphQL query by search query or specific IDs.
Fetch Platform TutorialTool to fetch a specific platform tutorial by its ID.
Fetch Platform TutorialsTool to fetch platform tutorials by search query or IDs.
Fetch RatingTool to retrieve detailed information about a specific rating by ID.
Fetch SecretTool to fetch a secret by ID.
Fetch Sitemap IntegrationTool to fetch a specific Sitemap integration by its ID.
Fetch SkillsetTool to fetch a specific skillset by its ID.
Fetch Skillset AbilityTool to fetch detailed information about a specific ability from a skillset.
Fetch Skillset (GraphQL)Tool to fetch a single skillset by ID using GraphQL.
Fetch Slack IntegrationTool to fetch a specific Slack integration by its ID.
Fetch SpaceTool to retrieve detailed information about a specific space by ID.
Fetch Support IntegrationTool to fetch a specific Support integration by its ID.
Fetch TaskTool to retrieve details of a specific task by its ID.
Fetch Telegram IntegrationTool to fetch a specific Telegram integration by its ID.
Fetch Trigger IntegrationTool to fetch a specific trigger integration by its ID.
Fetch Twilio IntegrationTool to fetch a specific Twilio integration by its ID.
Fetch UsageTool to fetch account-wide usage statistics including tokens, conversations, messages, and database resources.
Fetch Usage SeriesTool to fetch usage series data for the last 90 days.
Fetch WhatsApp IntegrationTool to fetch a specific WhatsApp integration by its ID.
Fetch Widget IntegrationTool to fetch a specific Widget integration by its ID.
Generate ReportTool to generate a specific report with time-series breakdowns.
Generate ReportsTool to generate multiple reports simultaneously.
Get Audit Log ExportTool to export audit log entries showing user actions and system events.
Get Event Metric SeriesTool to fetch event metric time series data for a specific metric type.
Get Rating ExportTool to export ratings with pagination support.
Get Rating ListTool to retrieve a paginated list of ratings.
Invoke Trigger IntegrationTool to invoke a trigger integration in ChatBotKit.
List Audit LogsTool to retrieve a paginated list of audit logs.
List Blueprint ResourcesTool to list the resources of a blueprint.
List BlueprintsTool to retrieve a list of blueprints.
List Blueprints via GraphQLTool to list all blueprints using GraphQL with cursor-based pagination.
List BotsTool to retrieve a paginated list of all bots.
List Bots (GraphQL)Tool to query bots via GraphQL with pagination support.
List Contact ConversationsTool to retrieve a paginated list of conversations for a specific contact.
List Contact MemoriesTool to retrieve a paginated list of memories for a specific contact.
List Contact RatingsTool to retrieve ratings submitted by a specific contact.
List ContactsTool to retrieve a paginated list of contacts.
List Contact SecretsTool to retrieve a paginated list of secrets for a specific contact.
List Contact SpacesTool to retrieve a paginated list of spaces for a specific contact.
List Contacts with PaginationTool to list contacts with full pagination support using GraphQL.
List Contact TasksTool to retrieve a paginated list of tasks for a specific contact.
List conversation messagesTool to list messages in a conversation with pagination.
List ConversationsTool to retrieve a paginated list of conversations.
List Conversations (GraphQL)Tool to retrieve conversations using GraphQL with cursor-based pagination.
List Dataset FilesTool to retrieve a list of files in a dataset.
List Dataset RecordsTool to list records in a dataset with pagination.
List DatasetsTool to list datasets.
List Datasets via GraphQLTool to list all datasets using GraphQL with cursor-based pagination.
List Discord IntegrationsTool to retrieve a list of Discord integrations.
List Email IntegrationsTool to retrieve a list of email integrations.
List Event LogsTool to retrieve a paginated list of event logs.
List Event MetricsTool to list event metrics for the authenticated account.
List Extract IntegrationsTool to retrieve a list of Extract integrations.
List FilesTool to retrieve a list of files.
List Files (GraphQL)Tool to list files using GraphQL query with connection-based pagination.
List Instagram IntegrationsTool to retrieve a list of Instagram integrations.
List Integrations (GraphQL)Tool to list integrations with pagination using GraphQL query.
List Magic PromptsTool to retrieve a list of magic prompts.
List MCP Server IntegrationsTool to retrieve a list of MCP Server integrations.
List MemoriesTool to retrieve a paginated list of memories.
List messages (GraphQL)Tool to list messages for one or more conversations using GraphQL.
List Messenger IntegrationsTool to retrieve a list of Messenger integrations.
List Notion IntegrationsTool to retrieve a list of Notion integrations.
List PartnersTool to retrieve a list of all partner accounts associated with the main account.
List Platform AbilitiesTool to retrieve a list of platform abilities.
List Platform ActionsTool to retrieve a paginated list of platform actions.
List Platform DocsTool to retrieve a list of platform documentation items.
List Platform ExamplesTool to retrieve a list of platform examples from ChatBotKit.
List Platform GuidesTool to retrieve a list of platform guides.
List Platform ManualsTool to retrieve a list of platform manuals.
List Platform ModelsTool to retrieve a list of available platform models.
List Platform ReportsTool to retrieve a list of available platform reports.
List Platform SecretsTool to retrieve a paginated list of platform secrets.
List Platform TutorialsTool to retrieve a list of platform tutorials.
List PoliciesTool to retrieve a list of policies.
List PortalsTool to retrieve a list of portals.
List Portals (GraphQL)Tool to retrieve a paginated list of portals using GraphQL.
List SecretsTool to retrieve a list of secrets.
List Secrets via GraphQLTool to list all secrets using GraphQL with cursor-based pagination.
List Sitemap IntegrationsTool to retrieve a list of Sitemap integrations.
List Skillset AbilitiesTool to retrieve a list of abilities within a specific skillset.
List SkillsetsTool to retrieve a list of all skillsets available in the system.
List Skillsets (GraphQL)Tool to list skillsets using GraphQL query with connection-based pagination.
List Slack IntegrationsTool to retrieve a list of Slack integrations.
List SpacesTool to retrieve a paginated list of spaces.
List Support IntegrationsTool to retrieve a list of support integrations.
List TasksTool to retrieve a paginated list of tasks.
List TeamsTool to retrieve a paginated list of teams.
List Telegram IntegrationsTool to retrieve a list of Telegram integrations.
List TokensTool to retrieve a list of all API tokens.
List Twilio IntegrationsTool to retrieve a list of Twilio integrations.
List WhatsApp IntegrationsTool to retrieve a list of WhatsApp integrations.
List Widget IntegrationsTool to retrieve a list of widget integrations.
Publish Channel MessagePublish a message to a ChatBotKit channel.
Search Bot MemoryTool to search memories for a specific bot.
Search Contact MemoryTool to search memories for a specific contact by keyword or phrase.
Search DatasetTool to search a dataset for records matching a given search query.
Search MemoryTool to search memories for records matching a given search query.
Search Platform AbilitiesTool to search platform abilities using semantic similarity.
Search Platform DocsTool to search platform documentation using semantic similarity.
Search Platform Docs (GraphQL)Tool to search platform documentation by search query via GraphQL and retrieve docs with id, name, excerpt, and link.
Search Platform ExamplesTool to search platform examples using semantic similarity.
Search Platform GuidesTool to search platform guides using semantic similarity.
Search Platform ManualsTool to search platform manuals using semantic similarity.
Search Platform SecretsTool to search platform secrets using semantic similarity.
Search Platform TutorialsTool to search platform tutorials using semantic similarity.
Setup Email IntegrationTool to setup an email integration in ChatBotKit.
Setup Trigger IntegrationTool to setup a trigger integration in ChatBotKit.
Setup Twilio IntegrationTool to setup a Twilio integration in ChatBotKit.
Setup WhatsApp IntegrationTool to setup a WhatsApp integration in ChatBotKit.
Setup Widget IntegrationTool to setup a Widget integration in ChatBotKit.
Subscribe to ChannelTool to subscribe to messages from a ChatBotKit channel.
Sync Dataset FileTool to sync a dataset file.
Sync FileTool to sync a file.
Sync Notion IntegrationTool to sync a Notion integration with ChatBotKit.
Sync Sitemap IntegrationTool to sync a sitemap integration.
Synthesize conversation messageTool to convert a conversation message into speech audio.
Trigger Extract IntegrationTool to trigger an extract integration on historic conversations in ChatBotKit.
Trigger Support IntegrationTool to trigger a support integration on historic conversations in ChatBotKit.
Trigger TaskTool to trigger execution of a background task.
Update BlueprintTool to update an existing blueprint.
Update Blueprint (GraphQL)Tool to update an existing blueprint using GraphQL mutation.
Update BotTool to update an existing bot's configuration and properties.
Update Bot (GraphQL)Tool to update an existing bot using GraphQL mutation.
Update ContactTool to update an existing contact's information.
Update ConversationTool to update an existing conversation's properties.
Update conversation messageTool to update an existing message in a conversation.
Update DatasetTool to update an existing dataset's configuration and properties.
Update Dataset (GraphQL)Tool to update an existing dataset using GraphQL mutation.
Update Dataset RecordTool to update an existing record in a dataset.
Update Discord IntegrationTool to update an existing Discord integration's configuration.
Update Email IntegrationTool to update an existing Email integration's configuration and properties.
Update Extract IntegrationTool to update an existing Extract integration's configuration.
Update FileTool to update an existing file's metadata and properties.
Update File (GraphQL)Tool to update an existing file using GraphQL mutation.
Update Instagram IntegrationTool to update an existing Instagram integration's configuration.
Update Trigger Integration (GraphQL)Tool to update trigger integration configuration and settings using GraphQL mutation.
Update MCP Server IntegrationTool to update an existing MCP Server integration.
Update MemoryTool to update an existing memory's text or associations.
Update Messenger IntegrationTool to update an existing Messenger integration's configuration.
Update Notion IntegrationTool to update an existing Notion integration's configuration and properties.
Update Partner UserTool to update an existing partner user's information.
Update RatingTool to update an existing rating by ID.
Update SecretTool to update an existing secret's configuration and properties.
Update Secret (GraphQL)Tool to update an existing secret via GraphQL mutation.
Update Sitemap IntegrationTool to update an existing Sitemap integration's configuration.
Update SkillsetTool to update an existing skillset's configuration and properties.
Update Skillset AbilityTool to update an existing ability within a skillset.
Update Skillset (GraphQL)Tool to update an existing skillset using GraphQL mutation.
Update Slack IntegrationTool to update an existing Slack integration's configuration.
Update SpaceTool to update an existing space's configuration and properties.
Update Support IntegrationTool to update an existing Support integration's configuration and properties.
Update TaskTool to update an existing task's configuration and properties.
Update Telegram IntegrationTool to update an existing Telegram integration's configuration and properties.
Update Trigger IntegrationTool to update an existing Trigger integration's configuration.
Update Twilio IntegrationTool to update an existing Twilio integration's configuration.
Update WhatsApp IntegrationTool to update an existing WhatsApp integration's configuration.
Update Widget IntegrationTool to update an existing Widget integration's configuration.
Upload Conversation AttachmentUpload a file as a conversation attachment in ChatBotKit.
Upload FileTool to upload content to an existing file resource in ChatBotKit.
Upsert Conversation ContactTool to upsert (create or update) contact information for a conversation in ChatBotKit.
Upvote BotTool to upvote a bot in ChatBotKit.
Upvote ConversationTool to upvote a conversation in ChatBotKit.
Upvote Conversation MessageTool to upvote a conversation message in ChatBotKit.
Verify SecretTool to verify a secret in ChatBotKit.

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

Before starting, make sure you have:
  • A Google API key for Gemini models
  • A Composio account and API key
  • Python 3.9 or later installed
  • Basic familiarity with Python

Getting API Keys for Google and Composio

Google API Key
  • Go to Google AI Studio and create an API key.
  • Copy the key and keep it safe. You will put this in GOOGLE_API_KEY.
Composio API Key and User ID
  • Log in to the Composio dashboard.
  • Go to Settings → API Keys and copy your Composio API key. Use this for COMPOSIO_API_KEY.
  • Decide on a stable user identifier to scope sessions, often your email or a user ID. Use this for COMPOSIO_USER_ID.

Install dependencies

bash
pip install google-adk composio python-dotenv

Inside your virtual environment, install the required packages.

What's happening:

  • google-adk is Google's Agents Development Kit
  • composio connects your agent to Chatbotkit via MCP
  • python-dotenv loads environment variables

Set up ADK project

bash
adk create my_agent

Set up a new Google ADK project.

What's happening:

  • This creates an agent folder with a root agent file and .env file

Set environment variables

bash
GOOGLE_API_KEY=your-google-api-key
COMPOSIO_API_KEY=your-composio-api-key
COMPOSIO_USER_ID=your-user-id-or-email

Save all your credentials in the .env file.

What's happening:

  • GOOGLE_API_KEY authenticates with Google's Gemini models
  • COMPOSIO_API_KEY authenticates with Composio
  • COMPOSIO_USER_ID identifies the user for session management

Import modules and validate environment

python
import os
import warnings

from composio import Composio
from dotenv import load_dotenv
from google.adk.agents.llm_agent import Agent
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset

load_dotenv()

warnings.filterwarnings("ignore", message=".*BaseAuthenticatedTool.*")

GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not GOOGLE_API_KEY:
    raise ValueError("GOOGLE_API_KEY is not set in the environment.")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set in the environment.")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set in the environment.")
What's happening:
  • os reads environment variables
  • Composio is the main Composio SDK client
  • GoogleProvider declares that you are using Google ADK as the agent runtime
  • Agent is the Google ADK LLM agent class
  • McpToolset lets the ADK agent call MCP tools over HTTP

Create Composio client and Tool Router session

python
composio_client = Composio(api_key=COMPOSIO_API_KEY)

composio_session = composio_client.create(
    user_id=COMPOSIO_USER_ID,
    toolkits=["chatbotkit"],
)

COMPOSIO_MCP_URL = composio_session.mcp.url,
print(f"Composio MCP URL: {COMPOSIO_MCP_URL}")
What's happening:
  • Authenticates to Composio with your API key
  • Declares Google ADK as the provider
  • Spins up a short-lived MCP endpoint for your user and selected toolkit
  • Stores the MCP HTTP URL for the ADK MCP integration

Set up the McpToolset and create the Agent

python
composio_toolset = McpToolset(
    connection_params=StreamableHTTPConnectionParams(
        url=COMPOSIO_MCP_URL,
        headers={"x-api-key": COMPOSIO_API_KEY}
    )
)

root_agent = Agent(
    model="gemini-2.5-flash",
    name="composio_agent",
    description="An agent that uses Composio tools to perform actions.",
    instruction=(
        "You are a helpful assistant connected to Composio. "
        "You have the following tools available: "
        "COMPOSIO_SEARCH_TOOLS, COMPOSIO_MULTI_EXECUTE_TOOL, "
        "COMPOSIO_MANAGE_CONNECTIONS, COMPOSIO_REMOTE_BASH_TOOL, COMPOSIO_REMOTE_WORKBENCH. "
        "Use these tools to help users with Chatbotkit operations."
    ),
    tools=[composio_toolset],
)

print("\nAgent setup complete. You can now run this agent directly ;)")
What's happening:
  • Connects the ADK agent to the Composio MCP endpoint through McpToolset
  • Uses Gemini as the model powering the agent
  • Lists exact tool names in instruction to reduce misnamed tool calls

Run the agent

bash
# Run in CLI mode
adk run my_agent

# Or run in web UI mode
adk web

Execute the agent from the project root. The web command opens a web portal where you can chat with the agent.

What's happening:

  • adk run runs the agent in CLI mode
  • adk web . opens a web UI for interactive testing

Complete Code

Here's the complete code to get you started with Chatbotkit and Google ADK:

python
import os
import warnings

from composio import Composio
from composio_google import GoogleProvider
from dotenv import load_dotenv
from google.adk.agents.llm_agent import Agent
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset

load_dotenv()
warnings.filterwarnings("ignore", message=".*BaseAuthenticatedTool.*")

GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
COMPOSIO_USER_ID = os.getenv("COMPOSIO_USER_ID")

if not GOOGLE_API_KEY:
    raise ValueError("GOOGLE_API_KEY is not set in the environment.")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set in the environment.")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set in the environment.")

composio_client = Composio(api_key=COMPOSIO_API_KEY, provider=GoogleProvider())

composio_session = composio_client.create(
    user_id=COMPOSIO_USER_ID,
    toolkits=["chatbotkit"],
)

COMPOSIO_MCP_URL = composio_session.mcp.url


composio_toolset = McpToolset(
    connection_params=StreamableHTTPConnectionParams(
        url=COMPOSIO_MCP_URL,
        headers={"x-api-key": COMPOSIO_API_KEY}
    )
)

root_agent = Agent(
    model="gemini-2.5-flash",
    name="composio_agent",
    description="An agent that uses Composio tools to perform actions.",
    instruction=(
        "You are a helpful assistant connected to Composio. "
        "You have the following tools available: "
        "COMPOSIO_SEARCH_TOOLS, COMPOSIO_MULTI_EXECUTE_TOOL, "
        "COMPOSIO_MANAGE_CONNECTIONS, COMPOSIO_REMOTE_BASH_TOOL, COMPOSIO_REMOTE_WORKBENCH. "
        "Use these tools to help users with Chatbotkit operations."
    ),  
    tools=[composio_toolset],
)

print("\nAgent setup complete. You can now run this agent directly ;)")

Conclusion

You've successfully integrated Chatbotkit with the Google ADK through Composio's MCP Tool Router. Your agent can now interact with Chatbotkit using natural language commands.

Key takeaways:

  • The Tool Router approach dynamically routes requests to the appropriate Chatbotkit tools
  • Environment variables keep your credentials secure and separate from code
  • Clear agent instructions reduce tool calling errors
  • The ADK web UI provides an interactive interface for testing and development

You can extend this setup by adding more toolkits to the toolkits array in your session configuration.

How to build Chatbotkit MCP Agent with another framework

FAQ

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

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

Can I use Tool Router MCP with Google ADK?

Yes, you can. Google ADK 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 Chatbotkit tools.

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

Yes, absolutely. You can configure which Chatbotkit 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 Chatbotkit 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.