How to integrate Active campaign MCP with LlamaIndex

Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Active campaign logo
LlamaIndex logo
divider

Introduction

This guide walks you through connecting Active campaign to LlamaIndex using the Composio tool router. By the end, you'll have a working Active campaign agent that can add a note to john doe's contact record, create a new contact with email and tags, add contact jane@company.com to 'welcome series' automation through natural language commands.

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

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

Also integrate Active campaign with

TL;DR

Here's what you'll learn:
  • Set your OpenAI and Composio API keys
  • Install LlamaIndex and Composio packages
  • Create a Composio Tool Router session for Active campaign
  • Connect LlamaIndex to the Active campaign MCP server
  • Build a Active campaign-powered agent using LlamaIndex
  • Interact with Active campaign through natural language

What is LlamaIndex?

LlamaIndex is a data framework for building LLM applications. It provides tools for connecting LLMs to external data sources and services through agents and tools.

Key features include:

  • ReAct Agent: Reasoning and acting pattern for tool-using agents
  • MCP Tools: Native support for Model Context Protocol
  • Context Management: Maintain conversation context across interactions
  • Async Support: Built for async/await patterns

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

The ActiveCampaign MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your ActiveCampaign account. It provides structured and secure access to your marketing automation and CRM data, so your agent can perform actions like adding contacts, managing deals, creating tasks, and organizing pipelines on your behalf.

  • Automated contact management: Easily add new contacts, update details, or attach notes so your customer database stays current and actionable.
  • Sales pipeline creation and management: Let your agent create, customize, or delete deal pipelines and organize deals through every stage of your sales process.
  • Task and activity automation: Have your agent create tasks for contacts and deals, assign due dates, and ensure important follow-ups never slip through the cracks.
  • Deal and account organization: Automatically create, update, or remove accounts and associate them with the right contacts and opportunities for seamless CRM workflows.
  • Seamless automation enrollment: Add contacts directly to specific automations, personalizing your marketing or sales outreach at scale without manual effort.

Supported Tools & Triggers

Tools
Add Browse Session to CartSet a browse session to have addedToCart flag set to true in ActiveCampaign.
Add contact noteAdd a note to a contact in ActiveCampaign.
Add Contact to AutomationAdds an existing ActiveCampaign contact to a specific automation workflow.
Add contact to listTool to add a contact to a list in ActiveCampaign.
Add Custom FieldTool to add a new custom field in ActiveCampaign.
Add Custom Field OptionsTool to add custom field options in bulk to ActiveCampaign.
Add Custom Field to Field GroupTool to add a custom field to a field group in ActiveCampaign.
Add Domain to Site Tracking WhitelistAdd a domain to ActiveCampaign's site tracking whitelist.
Add Field RelationshipAdd a field relationship in ActiveCampaign.
Add Secondary Contact to DealAdds a secondary contact to an existing deal in ActiveCampaign.
Add Tag to ContactTool to add a tag to a contact in ActiveCampaign.
Create AccountCreates a new account in ActiveCampaign.
Create Account Contact AssociationTool to create a new account-contact association in ActiveCampaign.
Create Account Custom Field DataCreates a custom field value for an account in ActiveCampaign.
Create Account Custom Field MetadataTool to create a new account custom field metadata in ActiveCampaign.
Create Account NoteTool to create a new note for an account in ActiveCampaign.
Create AddressTool to create a new address in ActiveCampaign.
Create a Deal NoteTool to create a note for a specific deal in ActiveCampaign.
Create An OrderTool to create an e-commerce order in ActiveCampaign.
Create Tag with TypeTool to create a new tag in ActiveCampaign with explicit tag type specification.
Bulk Create Account Custom Field DataTool to bulk create custom field values for accounts in ActiveCampaign.
Create Calendar FeedTool to create a new calendar feed in ActiveCampaign.
Create CampaignTool to create a new campaign in ActiveCampaign.
Create Child SchemaTool to create a child schema in ActiveCampaign.
Create ConnectionTool to create a new connection in ActiveCampaign.
Create contact taskCreate a task associated with a contact in ActiveCampaign.
Create CustomerTool to create an e-commerce customer in ActiveCampaign.
Create Deal Custom Field MetadataTool to create a new deal custom field metadata in ActiveCampaign.
Create Deal PipelineCreates a new deal pipeline in ActiveCampaign.
Create Deal RoleTool to create a new deal role in ActiveCampaign.
Create Deal StageTool to create a new stage in an ActiveCampaign deal pipeline.
Create Deal Task TypeThis tool creates a new deal task type in ActiveCampaign.
Create Duplicate CampaignTool to duplicate an existing campaign in ActiveCampaign.
Create Event Tracking EventTool to create a new event tracking event in ActiveCampaign.
Create Form Opt-inSubmit a form opt-in for a specific form in ActiveCampaign.
Bulk Import ContactsBulk import large numbers of contacts into ActiveCampaign with a single API call.
Create ListTool to create a new list in ActiveCampaign.
Create List Group PermissionCreates a list group permission in ActiveCampaign by associating a list with a user group.
Create MessageTool to create a message in ActiveCampaign.
Create Metrics Snapshot for BroadcastsTool to retrieve snapshot metrics for specified SMS broadcast IDs in ActiveCampaign.
Create NoteCreate a note and attach it to a specific entity (contact, deal, account, etc.
Create or Update ContactCreate a new contact or update an existing contact in ActiveCampaign using the sync endpoint.
Create or Update Custom Object RecordTool to create or update a custom object record in ActiveCampaign.
Add Domain to Tracking WhitelistAdd a domain to ActiveCampaign's site tracking whitelist.
Create Product in CatalogCreate a new product entry in the ActiveCampaign ecommerce catalog using GraphQL.
Create Saved ResponseTool to create a new saved response in ActiveCampaign.
Create Segment V2Tool to create advanced segments in ActiveCampaign using the V2 segments API.
Create Shareable Campaign Template LinkTool to create a shareable link for a campaign template in ActiveCampaign.
Create Task OutcomeTool to create a new task outcome in ActiveCampaign.
Create Task ReminderCreate a new task reminder notification in ActiveCampaign.
Create UserCreates a new user (team member/staff account) in ActiveCampaign with specified details.
Create WebhookCreate a new webhook in ActiveCampaign to receive real-time notifications when specific events occur.
Delete AccountPermanently deletes an account from ActiveCampaign by its ID.
Delete Account Contact AssociationDeletes an existing account-contact association in ActiveCampaign.
Delete Account Custom Field DataTool to delete a custom account field value in ActiveCampaign.
Delete Account Custom Field MetaTool to delete an account custom field meta definition from ActiveCampaign.
Delete Bulk AccountsTool to bulk delete multiple accounts from ActiveCampaign in a single operation.
Delete AddressPermanently deletes an address from ActiveCampaign by its ID.
Delete Address GroupTool to delete an address group from ActiveCampaign by its ID.
Delete An OrderTool to permanently delete an e-commerce order from ActiveCampaign by its ID.
Delete Calendar FeedTool to permanently delete a calendar feed from ActiveCampaign by its ID.
Delete ConnectionPermanently deletes a connection from ActiveCampaign by its ID.
Delete ContactPermanently deletes a contact from ActiveCampaign by its ID.
Delete CustomerTool to permanently delete an e-commerce customer from ActiveCampaign by ID.
Delete Custom FieldTool to delete a custom field from ActiveCampaign by its ID.
Delete Custom Field Field GroupTool to delete a custom field field group member in ActiveCampaign.
Delete DealTool to permanently delete a deal from ActiveCampaign by its ID.
Delete Deal Custom Field DataTool to delete a custom deal field value in ActiveCampaign.
Delete Deal Custom Field MetadataTool to delete a custom deal field metadata from ActiveCampaign.
Delete Deal PipelineThis tool deletes an existing deal pipeline in ActiveCampaign.
Delete Deal RoleTool to delete an existing deal role in ActiveCampaign.
Delete Deal StageThis tool deletes an existing deal stage in ActiveCampaign.
Delete Deal TaskPermanently deletes a deal task from ActiveCampaign by its ID.
Delete EventTool to delete an event tracking event from ActiveCampaign.
Delete Field RelationshipTool to delete a field relationship in ActiveCampaign.
Delete Field ValueTool to permanently delete a custom field value from ActiveCampaign by its ID.
Delete FormTool to permanently delete a form from ActiveCampaign by its ID.
Delete GroupTool to permanently delete a permission group from ActiveCampaign by its ID.
Delete ListPermanently deletes a list from ActiveCampaign by its ID.
Delete MessagePermanently deletes a message from ActiveCampaign by its ID.
Delete NotePermanently deletes a note from ActiveCampaign by its ID.
Delete ProductPermanently delete a product from ActiveCampaign's e-commerce catalog by its ID.
Delete Record by External IDPermanently deletes a custom object record from ActiveCampaign by its external ID.
Delete Custom Object RecordPermanently deletes a custom object record from ActiveCampaign by its ID and schema ID.
Delete Saved ResponseTool to permanently delete a saved response from ActiveCampaign by its ID.
Delete SchemaPermanently deletes a custom object schema from ActiveCampaign by its UUID.
Delete Secondary ContactPermanently deletes a secondary contact association from a deal in ActiveCampaign.
Delete Segment V2Tool to permanently delete a segment from ActiveCampaign by its UUID.
Delete TagTool to permanently delete a tag from ActiveCampaign by its ID.
Delete UserPermanently deletes a user from ActiveCampaign by their ID.
Delete VariablePermanently deletes a personalization variable from ActiveCampaign by its ID.
Bulk Delete VariablesTool to bulk delete personalization variables in ActiveCampaign.
Delete WebhookPermanently deletes a webhook from ActiveCampaign by its ID.
Edit CampaignEdit an existing campaign in ActiveCampaign.
Find contactFind a specific contact in ActiveCampaign using either their email address, ID, or phone number.
Find Contact TasksThis tool allows you to find tasks associated with a specific contact in ActiveCampaign.
Find User by EmailFind an ActiveCampaign account user (team member/staff) by their email address.
Get Account Contact AssociationTool to retrieve an existing account-contact association in ActiveCampaign.
Get Account Custom Field DataRetrieves a specific account custom field data record by ID.
Get Account Custom Field MetadataRetrieve metadata for a specific account custom field by ID.
Get Address by IDRetrieves a single address by ID from ActiveCampaign.
Get All Field RelationshipsGet all field relationships in ActiveCampaign.
Get Audience Segment by IDRetrieve a specific audience segment by ID from ActiveCampaign.
Get BrandingTool to retrieve an existing branding resource from ActiveCampaign by its ID.
Get Broadcast Metrics FailuresRetrieve grouping and counts of failures for an SMS broadcast in ActiveCampaign.
Get Broadcasts MetricsTool to retrieve metrics for specified SMS broadcast IDs in ActiveCampaign.
Get Broadcast RecipientsFetch all contacts who were sent a specific SMS broadcast in ActiveCampaign.
Get Bulk Import Status InfoTool to retrieve the status of a specific bulk import in ActiveCampaign.
Get Calendar FeedTool to retrieve a specific calendar feed from ActiveCampaign by its ID.
Get Campaign Automation Campaign ListsTool to retrieve all lists associated with a specific campaign automation in ActiveCampaign.
Get Campaign AutomationsGet automation information associated with a specific campaign in ActiveCampaign.
Get Campaign By IDRetrieve a single campaign by its ID from ActiveCampaign.
Get Campaign LinksGet all links associated with a specific campaign in ActiveCampaign.
Get Campaign MessageGet the message associated with a specific campaign in ActiveCampaign.
Get Campaign MessagesGet campaign messages associated with a specific campaign in ActiveCampaign.
Get Campaign UserGet the user (account owner/staff member) associated with a specific campaign in ActiveCampaign.
Get Contact Account ContactsRetrieve all account-contact associations for a specific contact in ActiveCampaign.
Get Contact Automation Entry CountsTool to retrieve the number of times a contact has entered each automation.
Get Contact AutomationsRetrieve all automations that a specific contact is enrolled in or has been enrolled in.
Get contact dataRetrieve detailed data for a specific contact in ActiveCampaign.
Get Contact GoalsRetrieve a contact's goals from ActiveCampaign.
Get Contact DealsTool to retrieve all deals associated with a specific contact in ActiveCampaign.
Get Contact Events and ActivitiesTool to retrieve contact events and activities from ActiveCampaign.
Get Contact Field ValuesTool to retrieve all custom field values for a specific contact in ActiveCampaign.
Get Contact Geo IPs ListRetrieve all geo IP addresses associated with a specific contact in ActiveCampaign.
Get Contact ListsTool to retrieve all list memberships for a specific contact in ActiveCampaign.
Get Contact LogsTool to retrieve logs for a specific contact in ActiveCampaign.
Get contact notesRetrieve all existing notes associated with a specific contact in ActiveCampaign.
Get Contact OrganizationTool to retrieve organization information associated with a specific contact in ActiveCampaign.
Get Contact Plus AppendTool to retrieve a contact's plus append enrichment data from ActiveCampaign.
Get Contact Score ValuesTool to retrieve all score values associated with a specific contact in ActiveCampaign.
Get Contact TagsTool to retrieve all tags associated with a specific contact in ActiveCampaign.
Get contact tracking logsRetrieve tracking logs for a specific contact in ActiveCampaign.
Get Custom FieldRetrieve a specific custom field by ID from ActiveCampaign.
Get Deal Custom Field DataRetrieves a specific deal custom field data record by ID.
Get Deal Custom Field MetadataRetrieve metadata for a specific deal custom field by ID.
Get Deal PipelineTool to retrieve an existing pipeline (deal group) from ActiveCampaign by its ID.
Get Deal StageTool to retrieve an existing deal stage from ActiveCampaign by its ID.
Get Deal TaskTool to retrieve an existing task in ActiveCampaign by its ID.
Get Deal Task TypeTool to retrieve an existing deal task type in ActiveCampaign by its ID.
Get Event Tracking StatusTool to retrieve the event tracking status for your ActiveCampaign account.
Get Field ValueTool to retrieve a specific field value by its ID in ActiveCampaign.
Get FormRetrieve a single form by its ID from ActiveCampaign.
Get Group By IDRetrieve a specific group by ID in ActiveCampaign.
Get Group LimitsTool to retrieve group limits configured for different groups in ActiveCampaign account.
Get ListsTool to retrieve all mailing lists in ActiveCampaign.
Get Logged-In UserRetrieve information about the currently authenticated user (the user whose API token is being used).
Get NoteTool to retrieve a specific note from ActiveCampaign by its ID.
Get Order from ActiveCampaignRetrieve a single order from ActiveCampaign by legacy connection ID and store order ID.
Get Product By IDRetrieve a single product by its ID from ActiveCampaign's e-commerce catalog.
Get Recent Segment CountsRetrieve the most recent result count for segments that were run without additional criteria.
Get Record by External IDTool to retrieve a custom object record from ActiveCampaign by its external ID.
Get Custom Object Record By IDTool to retrieve a custom object record from ActiveCampaign by schema ID and record ID.
Get Saved ResponseTool to retrieve a specific saved response from ActiveCampaign by its ID.
Get Schema by IDRetrieve a specific custom object schema by ID in ActiveCampaign.
Get Secondary ContactTool to retrieve a specific secondary contact (contact-deal association) by ID in ActiveCampaign.
Get Segment Count by TimestampTool to retrieve all result counts for a segment that were run without an AdditionalCriteria.
Get Segment Count HistoryTool to retrieve all historical result counts for a given segment that were run without additional criteria.
Get Segment MatchRetrieve segment match evaluation for a contact in ActiveCampaign.
Get Segment Match-All Result SetTool to retrieve segment match-all result set by ID.
Get Segment Match by External IDCheck if a contact matches a segment using segment ID, contact ID, and external ID.
Get Segment Match ResultTool to retrieve segment match result set by run ID in ActiveCampaign.
Get Segment V2Tool to retrieve a specific segment by its ID in ActiveCampaign.
Get Historic Segment by TimestampTool to retrieve a segment as it existed at a given point in time in ActiveCampaign.
Get Site Tracking CodeTool to retrieve the site tracking JavaScript code for your ActiveCampaign account.
Get Site Tracking StatusTool to retrieve the site tracking status for your ActiveCampaign account.
Get SMS Broadcast Metrics SnapshotTool to retrieve snapshot data for all SMS broadcasts in ActiveCampaign.
Get SMS CreditsTool to retrieve the current period's SMS credit usage and remaining balance.
Get TagTool to retrieve a tag from ActiveCampaign by its ID.
Get Task OutcomeTool to retrieve a specific task outcome from ActiveCampaign by its ID.
Get TemplateRetrieve a single template by its ID from ActiveCampaign.
Get User by IDTool to retrieve a specific ActiveCampaign account user (team member/staff) by their ID.
Get User by UsernameTool to retrieve an ActiveCampaign account user (team member/staff) by their username.
Get UsersTool to retrieve all ActiveCampaign account users (team members/staff).
Get Users By GroupTool to retrieve all users associated with a specific group in ActiveCampaign.
Get VariableTool to retrieve a personalization variable from ActiveCampaign by its ID.
Get Personalization VariablesTool to retrieve personalization variables from ActiveCampaign.
Get WebhookRetrieve an existing webhook by ID from ActiveCampaign.
List Account Contact AssociationsTool to retrieve all existing account-contact associations in ActiveCampaign.
List Account Custom Field DataTool to list all custom field values for accounts in ActiveCampaign.
List Account Custom Field MetadataTool to list all account custom field metadata in ActiveCampaign.
List AddressesTool to list all addresses in the ActiveCampaign account.
List All AccountsTool to list all accounts in ActiveCampaign.
List all contactsList all contacts in ActiveCampaign.
List All Custom Fields (with pagination)Tool to list all custom fields in ActiveCampaign with pagination support.
List All Custom Field ValuesTool to list all custom field values in ActiveCampaign.
List All Event Tracking EventsTool to list all whitelisted event tracking events in ActiveCampaign.
List All SchemasTool to list all custom object schemas in ActiveCampaign.
List All TagsTool to retrieve all tags in ActiveCampaign with search functionality.
List All Whitelisted DomainsTool to list all whitelisted domains for site tracking in ActiveCampaign.
List AudiencesRetrieve all saved segment summaries (audiences) from ActiveCampaign.
List AutomationsList all automations in ActiveCampaign.
List Bulk Import StatusTool to monitor bulk import progress in ActiveCampaign.
List Bulk Import Status AggregateTool to retrieve aggregate progress data for all bulk import jobs in ActiveCampaign.
List All Calendar FeedsTool to list all calendar feeds in ActiveCampaign.
List CampaignsTool to list all campaigns in ActiveCampaign.
List Contact AutomationsList all automations that contacts are enrolled in.
List All Secondary ContactsTool to retrieve all secondary contacts (contact-deal associations) in ActiveCampaign.
List All Deal ActivitiesTool to retrieve all recent activities for deals in ActiveCampaign.
List Deal Custom Field DataTool to list all custom field values for deals in ActiveCampaign.
List Deal Custom Field MetadataTool to list all deal custom field metadata in ActiveCampaign.
List Deal PipelinesTool to retrieve all existing deal pipelines from ActiveCampaign.
List All Deal RolesTool to retrieve all deal roles in ActiveCampaign.
List All Deals (Search & Filter)Tool to list all deals from ActiveCampaign with search and filtering capabilities.
List Deal StagesTool to list all deal stages (pipeline stages) in ActiveCampaign.
List All Deal Task TypesTool to retrieve all existing task types for deals in ActiveCampaign.
List Email ActivitiesTool to list all email activities in ActiveCampaign.
List FormsTool to list all forms in ActiveCampaign.
List All Group MembersTool to list all group members in ActiveCampaign.
List GroupsTool to retrieve all permission groups from ActiveCampaign.
List MessagesTool to list all messages in ActiveCampaign.
List all notesRetrieve a list of all notes in ActiveCampaign.
List Order ProductsTool to list all e-commerce order products in ActiveCampaign.
List Prism URL WhitelistingsTool to list all whitelisted site tracking domains in ActiveCampaign.
List Records for SchemaTool to list custom object records for a specific schema in ActiveCampaign.
List Saved ResponsesTool to list all saved responses in ActiveCampaign.
List All ScoresTool to list all scoring rules configured in ActiveCampaign.
List Segment Match All ContactsInitiate a match-all request for contacts in a segment.
List SMS Broadcast ListsTool to retrieve a paged list of all SMS broadcast lists in ActiveCampaign.
List SMS BroadcastsTool to list all SMS broadcasts in ActiveCampaign with optional filtering and pagination.
List Task OutcomesTool to retrieve all existing task outcomes from ActiveCampaign.
List Webhook EventsList all available webhook events in ActiveCampaign.
List WebhooksTool to list all existing webhooks in ActiveCampaign.
Lock Personalization VariableTool to lock a personalization variable in ActiveCampaign.
Manage contact tagManage tags for a contact in ActiveCampaign.
Remove Contact from AutomationRemoves a contact from a specified automation in ActiveCampaign.
Remove Domain from WhitelistRemove a domain from ActiveCampaign's URL whitelist.
Remove Tag from ContactTool to remove a tag from a contact in ActiveCampaign.
Retrieve AccountTool to retrieve an account from ActiveCampaign by its ID.
Retrieve a DealTool to retrieve a specific deal by its ID in ActiveCampaign.
Retrieve All ConnectionsTool to retrieve all Deep Data connection resources in ActiveCampaign.
Retrieve All E-Commerce CustomersTool to retrieve all e-commerce customer resources from ActiveCampaign.
Retrieve All DealsTool to retrieve all deals from ActiveCampaign with filtering and pagination support.
Retrieve All E-Commerce OrdersTool to retrieve all e-commerce orders from ActiveCampaign with pagination support.
Retrieve All Products for OrderTool to retrieve all products associated with a specific e-commerce order in ActiveCampaign.
Retrieve An OrderTool to retrieve an e-commerce order from ActiveCampaign by its ID.
Retrieve an Order ProductTool to retrieve an ecommerce order product from ActiveCampaign by its ID.
Retrieve ConnectionTool to retrieve a connection from ActiveCampaign by its ID.
Retrieve CustomerTool to retrieve an e-commerce customer from ActiveCampaign by their ID.
Retrieve Deal ActivitiesTool to retrieve all activities associated with a deal in ActiveCampaign.
Retrieve ListTool to retrieve a specific list from ActiveCampaign by its ID.
Retrieve MessageTool to retrieve a specific message by its ID in ActiveCampaign.
Save Browse SessionCreate a browse session in ActiveCampaign for testing purposes.
Search Browse SessionsSearch for browse sessions matching specified criteria in ActiveCampaign.
Search ProductsSearch for products using filter criteria in ActiveCampaign's e-commerce catalog.
Search Recurring PaymentsSearch for recurring payment records based on filter criteria.
Test Tracking EventSimulate a tracking event coming into the Browse Session system with debug output for testing URL patterns.
Track Event in ActiveCampaignTrack custom events for contacts in ActiveCampaign to trigger automations and monitor user engagement.
Unlock Personalization VariableTool to unlock a personalization variable in ActiveCampaign.
Update AccountThis tool updates an existing account in ActiveCampaign.
Update Account Contact AssociationTool to update an existing account-contact association in ActiveCampaign.
Update Account Custom Field DataUpdates a custom account field value in ActiveCampaign.
Bulk Update Account Custom Field DataTool to bulk update multiple custom account field values in a single request.
Update Account Custom Field MetadataUpdate metadata for an account custom field.
Update Account NoteTool to update an existing account note in ActiveCampaign.
Update AddressTool to update an existing address in ActiveCampaign.
Update a DealTool to update an existing deal in ActiveCampaign.
Update a Deal NoteTool to update an existing note for a specific deal in ActiveCampaign.
Update An OrderTool to update an existing e-commerce order in ActiveCampaign.
Update a TagTool to update an existing tag in ActiveCampaign.
Update BrandingTool to update an existing branding resource in ActiveCampaign.
Update Calendar FeedTool to update an existing calendar feed in ActiveCampaign.
Update ConfigurationTool to update an existing configuration in ActiveCampaign.
Update ConnectionTool to update an existing connection in ActiveCampaign.
Update ContactUpdate an existing contact in ActiveCampaign by ID.
Update Secondary ContactTool to update an existing secondary contact (contact-deal association) in ActiveCampaign.
Update CustomerTool to update an existing e-commerce customer in ActiveCampaign.
Update Custom FieldTool to update an existing custom field in ActiveCampaign.
Update Custom Field Field GroupTool to update a custom field field group member in ActiveCampaign.
Update Custom Field Value For ContactTool to update a custom field value for a contact in ActiveCampaign.
Update Deal Custom Field DataUpdates a custom deal field value in ActiveCampaign.
Update Deal Custom Field MetadataUpdates a custom deal field metadata in ActiveCampaign.
Update Deal PipelineTool to update an existing pipeline (deal group) in ActiveCampaign.
Bulk Update Deal OwnersTool to bulk update deal owners in ActiveCampaign.
Update Deal StageTool to update an existing stage in an ActiveCampaign deal pipeline.
Update Deal Stage DealsTool to move all deals from one stage to another stage in ActiveCampaign.
Update Deal TaskTool to update an existing task in ActiveCampaign.
Update Deal Task TypeTool to update an existing deal task type in ActiveCampaign.
Update Edit VariableTool to edit an existing personalization variable in ActiveCampaign.
Update Event Tracking StatusTool to enable or disable event tracking for your ActiveCampaign account.
Update Field ValueTool to update a custom field value by its field value ID in ActiveCampaign.
Update GroupTool to update an existing permission group in ActiveCampaign.
Update MessageTool to update an existing message in ActiveCampaign.
Update NoteTool to update an existing note in ActiveCampaign by its ID.
Update ProductTool to update an existing product in ActiveCampaign's e-commerce system using GraphQL.
Update Saved ResponseTool to update an existing saved response in ActiveCampaign.
Update SchemaTool to update a custom object schema in ActiveCampaign.
Update Segment V2Tool to update existing segments in ActiveCampaign using the V2 segments API.
Revert Segment to Historic StateTool to revert a segment to how it looked at a specific point in time in ActiveCampaign.
Update Site Tracking StatusTool to enable or disable site tracking for your ActiveCampaign account.
Update UserTool to update an existing ActiveCampaign user (team member/staff account) by ID.
Update WebhookUpdate an existing webhook in ActiveCampaign to modify its configuration such as URL, events, or sources.
Upsert AccountCreates a new account or updates an existing one in ActiveCampaign based on the account name.
Upsert OrderCreate a new order or update an existing order in ActiveCampaign.
Bulk Upsert OrdersInsert multiple orders or update them if they already exist in ActiveCampaign.
Bulk Upsert Orders AsyncTool to insert or update multiple orders asynchronously in ActiveCampaign with high throughput.
Bulk Upsert ProductsCreate or update multiple products in a single request using ActiveCampaign's GraphQL API.
Upsert Recurring Payments BulkCreate or update multiple recurring payments asynchronously in ActiveCampaign.

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 you begin, make sure you have:
  • Python 3.8/Node 16 or higher installed
  • A Composio account with the API key
  • An OpenAI API key
  • A Active campaign account and project
  • Basic familiarity with async Python/Typescript

Getting API Keys for OpenAI, Composio, and Active campaign

OpenAI API key (OPENAI_API_KEY)
  • Go to the OpenAI dashboard
  • Create an API key if you don't have one
  • Assign it to OPENAI_API_KEY in .env
Composio API key and user ID
  • Log into the Composio dashboard
  • Copy your API key from Settings
    • Use this as COMPOSIO_API_KEY
  • Pick a stable user identifier (email or ID)
    • Use this as COMPOSIO_USER_ID

Installing dependencies

pip install composio-llamaindex llama-index llama-index-llms-openai llama-index-tools-mcp python-dotenv

Create a new Python project and install the necessary dependencies:

  • composio-llamaindex: Composio's LlamaIndex integration
  • llama-index: Core LlamaIndex framework
  • llama-index-llms-openai: OpenAI LLM integration
  • llama-index-tools-mcp: MCP client for LlamaIndex
  • python-dotenv: Environment variable management

Set environment variables

bash
OPENAI_API_KEY=your-openai-api-key
COMPOSIO_API_KEY=your-composio-api-key
COMPOSIO_USER_ID=your-user-id

Create a .env file in your project root:

These credentials will be used to:

  • Authenticate with OpenAI's GPT-5 model
  • Connect to Composio's Tool Router
  • Identify your Composio user session for Active campaign access

Import modules

import asyncio
import os
import dotenv

from composio import Composio
from composio_llamaindex import LlamaIndexProvider
from llama_index.core.agent.workflow import ReActAgent
from llama_index.core.workflow import Context
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

dotenv.load_dotenv()

Create a new file called active campaign_llamaindex_agent.py and import the required modules:

Key imports:

  • asyncio: For async/await support
  • Composio: Main client for Composio services
  • LlamaIndexProvider: Adapts Composio tools for LlamaIndex
  • ReActAgent: LlamaIndex's reasoning and action agent
  • BasicMCPClient: Connects to MCP endpoints
  • McpToolSpec: Converts MCP tools to LlamaIndex format

Load environment variables and initialize Composio

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

if not OPENAI_API_KEY:
    raise ValueError("OPENAI_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:

This ensures missing credentials cause early, clear errors before the agent attempts to initialise.

Create a Tool Router session and build the agent function

async def build_agent() -> ReActAgent:
    composio_client = Composio(
        api_key=COMPOSIO_API_KEY,
        provider=LlamaIndexProvider(),
    )

    session = composio_client.create(
        user_id=COMPOSIO_USER_ID,
        toolkits=["active_campaign"],
    )

    mcp_url = session.mcp.url
    print(f"Composio MCP URL: {mcp_url}")

    mcp_client = BasicMCPClient(mcp_url, headers={"x-api-key": COMPOSIO_API_KEY})
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = await mcp_tool_spec.to_tool_list_async()

    llm = OpenAI(model="gpt-5")

    description = "An agent that uses Composio Tool Router MCP tools to perform Active campaign actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Active campaign actions.
    """
    return ReActAgent(tools=tools, llm=llm, description=description, system_prompt=system_prompt, verbose=True)

What's happening here:

  • We create a Composio client using your API key and configure it with the LlamaIndex provider
  • We then create a tool router MCP session for your user, specifying the toolkits we want to use (in this case, active campaign)
  • The session returns an MCP HTTP endpoint URL that acts as a gateway to all your configured tools
  • LlamaIndex will connect to this endpoint to dynamically discover and use the available Active campaign tools.
  • The MCP tools are mapped to LlamaIndex-compatible tools and plug them into the Agent.

Create an interactive chat loop

async def chat_loop(agent: ReActAgent) -> None:
    ctx = Context(agent)
    print("Type 'quit', 'exit', or Ctrl+C to stop.")

    while True:
        try:
            user_input = input("\nYou: ").strip()
        except (KeyboardInterrupt, EOFError):
            print("\nBye!")
            break

        if not user_input or user_input.lower() in {"quit", "exit"}:
            print("Bye!")
            break

        try:
            print("Agent: ", end="", flush=True)
            handler = agent.run(user_input, ctx=ctx)

            async for event in handler.stream_events():
                # Stream token-by-token from LLM responses
                if hasattr(event, "delta") and event.delta:
                    print(event.delta, end="", flush=True)
                # Show tool calls as they happen
                elif hasattr(event, "tool_name"):
                    print(f"\n[Using tool: {event.tool_name}]", flush=True)

            # Get final response
            response = await handler
            print()  # Newline after streaming
        except KeyboardInterrupt:
            print("\n[Interrupted]")
            continue
        except Exception as e:
            print(f"\nError: {e}")

What's happening here:

  • We're creating a direct terminal interface to chat with your Active campaign database
  • The LLM's responses are streamed to the CLI for faster interaction.
  • The agent uses context to maintain conversation history
  • You can type 'quit' or 'exit' to stop the chat loop gracefully
  • Agent responses and any errors are displayed in a clear, readable format

Define the main entry point

async def main() -> None:
    agent = await build_agent()
    await chat_loop(agent)

if __name__ == "__main__":
    # Handle Ctrl+C gracefully
    signal.signal(signal.SIGINT, lambda s, f: (print("\nBye!"), exit(0)))
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nBye!")

What's happening here:

  • We're orchestrating the entire application flow
  • The agent gets built with proper error handling
  • Then we kick off the interactive chat loop so you can start talking to Active campaign

Run the agent

npx ts-node llamaindex-agent.ts

When prompted, authenticate and authorise your agent with Active campaign, then start asking questions.

Complete Code

Here's the complete code to get you started with Active campaign and LlamaIndex:

import asyncio
import os
import signal
import dotenv

from composio import Composio
from composio_llamaindex import LlamaIndexProvider
from llama_index.core.agent.workflow import ReActAgent
from llama_index.core.workflow import Context
from llama_index.llms.openai import OpenAI
from llama_index.tools.mcp import BasicMCPClient, McpToolSpec

dotenv.load_dotenv()

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

if not OPENAI_API_KEY:
    raise ValueError("OPENAI_API_KEY is not set")
if not COMPOSIO_API_KEY:
    raise ValueError("COMPOSIO_API_KEY is not set")
if not COMPOSIO_USER_ID:
    raise ValueError("COMPOSIO_USER_ID is not set")

async def build_agent() -> ReActAgent:
    composio_client = Composio(
        api_key=COMPOSIO_API_KEY,
        provider=LlamaIndexProvider(),
    )

    session = composio_client.create(
        user_id=COMPOSIO_USER_ID,
        toolkits=["active_campaign"],
    )

    mcp_url = session.mcp.url
    print(f"Composio MCP URL: {mcp_url}")

    mcp_client = BasicMCPClient(mcp_url, headers={"x-api-key": COMPOSIO_API_KEY})
    mcp_tool_spec = McpToolSpec(client=mcp_client)
    tools = await mcp_tool_spec.to_tool_list_async()

    llm = OpenAI(model="gpt-5")
    description = "An agent that uses Composio Tool Router MCP tools to perform Active campaign actions."
    system_prompt = """
    You are a helpful assistant connected to Composio Tool Router.
    Use the available tools to answer user queries and perform Active campaign actions.
    """
    return ReActAgent(
        tools=tools,
        llm=llm,
        description=description,
        system_prompt=system_prompt,
        verbose=True,
    );

async def chat_loop(agent: ReActAgent) -> None:
    ctx = Context(agent)
    print("Type 'quit', 'exit', or Ctrl+C to stop.")

    while True:
        try:
            user_input = input("\nYou: ").strip()
        except (KeyboardInterrupt, EOFError):
            print("\nBye!")
            break

        if not user_input or user_input.lower() in {"quit", "exit"}:
            print("Bye!")
            break

        try:
            print("Agent: ", end="", flush=True)
            handler = agent.run(user_input, ctx=ctx)

            async for event in handler.stream_events():
                # Stream token-by-token from LLM responses
                if hasattr(event, "delta") and event.delta:
                    print(event.delta, end="", flush=True)
                # Show tool calls as they happen
                elif hasattr(event, "tool_name"):
                    print(f"\n[Using tool: {event.tool_name}]", flush=True)

            # Get final response
            response = await handler
            print()  # Newline after streaming
        except KeyboardInterrupt:
            print("\n[Interrupted]")
            continue
        except Exception as e:
            print(f"\nError: {e}")

async def main() -> None:
    agent = await build_agent()
    await chat_loop(agent)

if __name__ == "__main__":
    # Handle Ctrl+C gracefully
    signal.signal(signal.SIGINT, lambda s, f: (print("\nBye!"), exit(0)))
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("\nBye!")

Conclusion

You've successfully connected Active campaign to LlamaIndex through Composio's Tool Router MCP layer. Key takeaways:
  • Tool Router dynamically exposes Active campaign tools through an MCP endpoint
  • LlamaIndex's ReActAgent handles reasoning and orchestration; Composio handles integrations
  • The agent becomes more capable without increasing prompt size
  • Async Python provides clean, efficient execution of agent workflows
You can easily extend this to other toolkits like Gmail, Notion, Stripe, GitHub, and more by adding them to the toolkits parameter.

How to build Active campaign MCP Agent with another framework

FAQ

What are the differences in Tool Router MCP and Active campaign MCP?

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

Can I use Tool Router MCP with LlamaIndex?

Yes, you can. LlamaIndex 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 Active campaign tools.

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

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