How to integrate JoggAI MCP with CrewAI

This guide walks you through connecting JoggAI to CrewAI using the Composio tool router. By the end, you'll have a working JoggAI agent that can generate your scripts, animate avatars, create product videos, sync lips to audio, and manage webhooks through natural language commands. This guide will help you understand how to give your CrewAI agent real control over a JoggAI account through Composio's JoggAI MCP server. Before we dive in, let's take a quick look at the key ideas and tools involved.

JoggAI logoJoggAI
Api Key

JoggAI is an AI video creation platform for avatar, product, lip-sync, template, and translated videos. It helps teams turn scripts, products, and media assets into polished videos through APIs.

36 Tools

Introduction

This guide walks you through connecting JoggAI to CrewAI using the Composio tool router. By the end, you'll have a working JoggAI agent that can generate your scripts, animate avatars, create product videos, sync lips to audio, and manage webhooks through natural language commands.

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

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

Also integrate JoggAI with

TL;DR

Here's what you'll learn:
  • Get a Composio API key and configure your JoggAI connection
  • Set up CrewAI with an MCP enabled agent
  • Create a Tool Router session or standalone MCP server for JoggAI
  • Build a conversational loop where your agent can execute JoggAI operations

What is CrewAI?

CrewAI is a powerful framework for building multi-agent AI systems. It provides primitives for defining agents with specific roles, creating tasks, and orchestrating workflows through crews.

Key features include:

  • Agent Roles: Define specialized agents with specific goals and backstories
  • Task Management: Create tasks with clear descriptions and expected outputs
  • Crew Orchestration: Combine agents and tasks into collaborative workflows
  • MCP Integration: Connect to external tools through Model Context Protocol

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

The JoggAI MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your JoggAI account. It provides structured and secure access to your avatars, products, videos, templates, scripts, and supporting media assets, so your agent can create videos, generate avatars, translate content, track production tasks, and manage webhooks on your behalf.

  • Avatar and lip-sync video creation: Have your agent create talking-avatar and lip-sync videos, generate photo or product avatars, and animate selected avatar images with speech and motion.
  • Product video production: Let the agent create or update product details, generate scripts and visual previews, then render selected concepts into finished product videos.
  • Template-based video rendering: Direct your agent to produce videos from JoggAI templates using text, scripts, images, videos, avatars, voices, captions, and music.
  • Video translation and dubbing: Instruct your agent to find supported languages and translate videos with options for dubbing, lip sync, subtitles, audio-only output, and adjusted duration.
  • Media tracking and notifications: Have your agent check video and avatar generation progress, browse available voices, music, templates, and visual styles, review account credits, and manage webhook notifications.

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

Before starting, make sure you have:
  • Python 3.9 or higher
  • A Composio account and API key
  • A JoggAI connection authorized in Composio
  • An OpenAI API key for the CrewAI LLM
  • Basic familiarity with Python
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 crewai crewai-tools[mcp] python-dotenv
What's happening:
  • composio connects your agent to JoggAI via MCP
  • crewai provides Agent, Task, Crew, and LLM primitives
  • crewai-tools[mcp] includes MCP helpers
  • python-dotenv loads environment variables from .env
4

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_user_id_here
OPENAI_API_KEY=your_openai_api_key_here

Create a .env file in your project root.

What's happening:

  • COMPOSIO_API_KEY authenticates with Composio
  • USER_ID scopes the session to your account
  • OPENAI_API_KEY lets CrewAI use your chosen OpenAI model
5

Import dependencies

python
import os
from composio import Composio
from crewai import Agent, Task, Crew
from crewai_tools import MCPServerAdapter
import dotenv

dotenv.load_dotenv()

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

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")
What's happening:
  • CrewAI classes define agents and tasks, and run the workflow
  • MCPServerHTTP connects the agent to an MCP endpoint
  • Composio will give you a short lived JoggAI MCP URL
6

Create a Composio Tool Router session for JoggAI

python
composio_client = Composio(api_key=COMPOSIO_API_KEY)
session = composio_client.create(user_id=COMPOSIO_USER_ID, toolkits=["jogg_ai"])

url = session.mcp.url
What's happening:
  • You create a JoggAI only session through Composio
  • Composio returns an MCP HTTP URL that exposes JoggAI tools
7

Initialize the MCP Server

python
server_params = {
    "url": url,
    "transport": "streamable-http",
    "headers": {"x-api-key": COMPOSIO_API_KEY},
}

with MCPServerAdapter(server_params) as tools:
    agent = Agent(
        role="Search Assistant",
        goal="Help users search the internet effectively",
        backstory="You are a helpful assistant with access to search tools.",
        tools=tools,
        verbose=False,
        max_iter=10,
    )
What's Happening:
  • Server Configuration: The code sets up connection parameters including the MCP server URL, streamable HTTP transport, and Composio API key authentication.
  • MCP Adapter Bridge: MCPServerAdapter acts as a context manager that converts Composio MCP tools into a CrewAI-compatible format.
  • Agent Setup: Creates a CrewAI Agent with a defined role (Search Assistant), goal (help with internet searches), and access to the MCP tools.
  • Configuration Options: The agent includes settings like verbose=False for clean output and max_iter=10 to prevent infinite loops.
  • Dynamic Tool Usage: Once created, the agent automatically accesses all Composio Search tools and decides when to use them based on user queries.
8

Create a CLI Chatloop and define the Crew

python
print("Chat started! Type 'exit' or 'quit' to end.\n")

conversation_context = ""

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

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

    if not user_input:
        continue

    conversation_context += f"\nUser: {user_input}\n"
    print("\nAgent is thinking...\n")

    task = Task(
        description=(
            f"Conversation history:\n{conversation_context}\n\n"
            f"Current request: {user_input}"
        ),
        expected_output="A helpful response addressing the user's request",
        agent=agent,
    )

    crew = Crew(agents=[agent], tasks=[task], verbose=False)
    result = crew.kickoff()
    response = str(result)

    conversation_context += f"Agent: {response}\n"
    print(f"Agent: {response}\n")
What's Happening:
  • Interactive CLI Setup: The code creates an infinite loop that continuously prompts for user input and maintains the entire conversation history in a string variable.
  • Input Validation: Empty inputs are ignored to prevent processing blank messages and keep the conversation clean.
  • Context Building: Each user message is appended to the conversation context, which preserves the full dialogue history for better agent responses.
  • Dynamic Task Creation: For every user input, a new Task is created that includes both the full conversation history and the current request as context.
  • Crew Execution: A Crew is instantiated with the agent and task, then kicked off to process the request and generate a response.
  • Response Management: The agent's response is converted to a string, added to the conversation context, and displayed to the user, maintaining conversational continuity.

Complete Code

Here's the complete code to get you started with JoggAI and CrewAI:

python
from crewai import Agent, Task, Crew, LLM
from crewai_tools import MCPServerAdapter
from composio import Composio
from dotenv import load_dotenv
import os

load_dotenv()

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.")

# Initialize Composio and create a session
composio = Composio(api_key=COMPOSIO_API_KEY)
session = composio.create(
    user_id=COMPOSIO_USER_ID,
    toolkits=["jogg_ai"],
)
url = session.mcp.url

# Configure LLM
llm = LLM(
    model="gpt-5",
    api_key=os.getenv("OPENAI_API_KEY"),
)

server_params = {
    "url": url,
    "transport": "streamable-http",
    "headers": {"x-api-key": COMPOSIO_API_KEY},
}

with MCPServerAdapter(server_params) as tools:
    agent = Agent(
        role="Search Assistant",
        goal="Help users with internet searches",
        backstory="You are an expert assistant with access to Composio Search tools.",
        tools=tools,
        llm=llm,
        verbose=False,
        max_iter=10,
    )

    print("Chat started! Type 'exit' or 'quit' to end.\n")

    conversation_context = ""

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

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

        if not user_input:
            continue

        conversation_context += f"\nUser: {user_input}\n"
        print("\nAgent is thinking...\n")

        task = Task(
            description=(
                f"Conversation history:\n{conversation_context}\n\n"
                f"Current request: {user_input}"
            ),
            expected_output="A helpful response addressing the user's request",
            agent=agent,
        )

        crew = Crew(agents=[agent], tasks=[task], verbose=False)
        result = crew.kickoff()
        response = str(result)

        conversation_context += f"Agent: {response}\n"
        print(f"Agent: {response}\n")

Conclusion

You now have a CrewAI agent connected to JoggAI through Composio's Tool Router. The agent can perform JoggAI operations through natural language commands.

Next steps:

  • Add role-specific instructions to customize agent behavior
  • Plug in more toolkits for multi-app workflows
  • Chain tasks for complex multi-step operations
TOOLS

Supported Tools

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

Animate Photo Avatar

Create a reusable animated avatar from a photo-avatar image.

Animate Product Avatar

Add motion and a voice to a selected JoggAI product-avatar image generation.

Create Asset Upload URL

Create a signed URL for uploading an asset to JoggAI.

Create Lip Sync Video

Start an asynchronous lip-sync video from publicly reachable video and audio URLs.

Create Product

Create product information from exactly one source: a product page URL, or manually supplied product details.

Create Product Video

Start a product video using a saved product and nested video, avatar, voice, audio, and script settings.

Create Product Video Previews

Generate product-video previews for one or more visual styles.

Create Talking Avatar Video

Start a talking-avatar video using an avatar and either a text script or hosted audio.

Create Template Video

Start rendering a JoggAI v2 template with typed text, script, image, or video variables and optional avatar, voice, captions, and music settings.

Create Webhook

Create a JoggAI webhook endpoint with a callback URL, delivery status, and event subscriptions.

Delete Webhook

Permanently delete one JoggAI webhook endpoint.

Generate AI Scripts

Start asynchronous AI script generation from a saved product or inline product details.

Generate Photo Avatar Image

Start AI photo-avatar image generation using JoggAI's exact demographic, style, model, and aspect-ratio modes.

Generate Product Avatar Images

Start asynchronous generation of one to four product-avatar images from a public product image and an existing avatar, reference image, or description.

Get Account and Credit Balance

Return the connected JoggAI user and remaining credit balance.

Get AI Script Task

Check an AI script generation task and return generated scripts when completed.

Get Lip Sync Video

Check a lip-sync task and return its output URLs and duration when successful.

Get Photo Avatar

Check photo-avatar motion generation and return the reusable avatar details when complete.

Get Photo Avatar Image

Check photo-avatar image generation and return the generated image URLs and keys when ready.

Get Product Avatar

Check product-avatar motion generation and return the reusable avatar when complete.

Get Product Avatar Image Task

Check a product-avatar image generation batch and return its status summary and generated image candidates.

Get Product Video

Check one product video and return its generated media when available.

Get Talking Avatar Video

Check a talking-avatar video and return its media URLs when completed.

Get Template Video

Check a template-rendered video and return its output details when complete.

Get Video Translation

Check a video translation and return translated media when complete.

List Avatars

List public, instant, photo, or product avatars available for JoggAI video generation.

List Creation Assets

Browse one music, template, visual-style, or voice catalog used to create JoggAI media.

List Product Previews

List generated JoggAI product-video previews and their statuses one page at a time.

List Product Videos

List product videos with status and sort filters, one bounded page at a time.

List Translation Languages

Return currently supported lowercase target-language identifiers for JoggAI video translation.

List Webhook Events

Return event identifiers that can be subscribed to by a JoggAI webhook.

List Webhooks

List webhook endpoints registered on the connected JoggAI account.

Render Product Video Preview

Render one selected product preview into a final video.

Translate Video

Start asynchronous video translation with optional audio-only translation, dubbing, lip sync, subtitles, and dynamic duration.

Update Product

Update an existing JoggAI product's descriptive fields.

Update Webhook

Fully replace an existing JoggAI webhook's callback URL, delivery status, and event subscriptions.

FAQ

Frequently asked questions

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

Yes, you can. CrewAI 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 JoggAI tools.

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

Start with JoggAI.It takes 30 seconds.

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

Start building