How to integrate Blazemeter MCP with CrewAI

Trusted by
AWS
Glean
Zoom
Airtable

30 min · no commitment · see it on your stack

Blazemeter logo
CrewAI logo
divider

Introduction

This guide walks you through connecting Blazemeter to CrewAI using the Composio tool router. By the end, you'll have a working Blazemeter agent that can start a new performance test on your main project, fetch results from the latest test run, list all test runs for project alpha through natural language commands.

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

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

Also integrate Blazemeter with

TL;DR

Here's what you'll learn:
  • Get a Composio API key and configure your Blazemeter connection
  • Set up CrewAI with an MCP enabled agent
  • Create a Tool Router session or standalone MCP server for Blazemeter
  • Build a conversational loop where your agent can execute Blazemeter 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 Blazemeter MCP server, and what's possible with it?

The Blazemeter MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Blazemeter account. It provides structured and secure access so your agent can perform Blazemeter operations on your behalf.

Supported Tools & Triggers

Tools
Convert TransactionsTool to convert transaction files to BlazeMeter DSL format for service virtualization.
Create API Monitoring ScheduleTool to create a new schedule for running API monitoring tests.
Create Multi TestTool to create a new multi-test within a specified project.
Create Private LocationTool to create a new private location in BlazeMeter.
Create Private Location AgentCreates a new agent (server) within a BlazeMeter private location.
Create ProjectCreates a new project within a BlazeMeter workspace.
Create SearchExecute a search query against BlazeMeter entities using advanced filtering and sorting.
Create TagCreates a new tag in BlazeMeter for organizing and categorizing resources.
Create TestTool to create a new single test within a specified project.
Create Workspace AssetTool to create an asset in a workspace for test data management.
Create Asset DependencyTool to create a dependency relationship between two assets in a BlazeMeter workspace.
Create Workspace PackageCreates a new package within a BlazeMeter workspace.
Create Workspace TransactionsTool to create transactions in a BlazeMeter workspace for service virtualization.
Delete API Monitoring ScheduleTool to delete a specific test schedule by its ID.
Delete Private Location WorkspaceTool to remove a workspace from a private location.
Delete ProjectTool to delete a specific project by its ID.
Delete Test FileTool to delete a file from a test.
Delete TestsTool to delete a test by its ID.
Delete Workspace Asset DependencyTool to delete a dependency from a workspace's asset repository by its ID.
Delete Workspace AssetTool to delete an asset from a workspace in BlazeMeter's Asset Repository.
Delete Workspace Assets DependenciesTool to delete asset dependencies by source/target in a workspace.
Delete Workspace LogsTool to delete master test execution logs from a BlazeMeter workspace.
Delete Workspace ManagersTool to remove managers from a workspace.
Delete Workspace PackageTool to delete a package from a workspace in the BlazeMeter Asset Repository.
Duplicate TestTool to duplicate an existing test by its ID.
Export PackageTool to export a package from BlazeMeter Asset Repository as a zip file.
Export Workspaces PackagesTool to export multiple packages from a workspace as a zip file.
Generate Test Data from Data ModelTool to generate test data from a data model in Asset Repository.
Generate Workspace Test DataTool to generate synthetic test data on-the-fly without storing in Asset Repository.
Get AccountsTool to retrieve a list of accounts associated with the authenticated user.
Get API Monitoring ScheduleTool to retrieve details of a specific API monitoring schedule by its ID.
Get API Monitoring SchedulesRetrieves a paginated list of API monitoring test schedules.
Get Generator FunctionsTool to retrieve all available test data generator functions from BlazeMeter Test Data API.
Get Generator Seed ListsTool to retrieve a list of all available seed lists from BlazeMeter Test Data Management API.
Get Info HealthTool to retrieve the BlazeMeter service health status.
Get Info VersionTool to retrieve BlazeMeter service version information.
Get Masters Reports Main SummaryTool to retrieve request statistics summary for a master test run.
Get Multi TestTool to retrieve details of a specific multi-test.
Get Multi TestsRetrieves a paginated list of multi-tests within a BlazeMeter workspace.
Get Private LocationsTool to retrieve a list of private locations filtered by account or workspace.
Get Project DetailsTool to retrieve detailed information about a specific project by its ID.
Get ProjectsTool to retrieve a list of projects within a specified workspace.
Get RegionsTool to retrieve a list of all available test regions for API monitoring.
Get Search MetadataRetrieve metadata about searchable entities, fields, relationships, and operators in BlazeMeter's search API.
Get Shared FoldersTool to retrieve a list of shared folders within a specified workspace.
Get TagsTool to retrieve a list of all tags from BlazeMeter Mock Services API.
Get Test DetailsTool to retrieve complete details of a specific test by its ID.
Get TestsRetrieve a list of performance tests filtered by workspace or project.
Get Tests FilesTool to list all files associated with a test.
Get Test ValidationsTool to retrieve validation results for a specific test by its ID.
Get UserRetrieve the authenticated user's profile information including their default project and preferences.
Get User Active SessionsTool to retrieve the list of active test sessions for the authenticated user.
Get User InvitesTool to retrieve pending invites for the authenticated user.
Get User ProjectsTool to retrieve all projects belonging to the authenticated user.
Get Workspace DetailsTool to retrieve detailed information about a specific workspace by its ID.
Get Workspace PackageTool to retrieve a specific package by its ID from a workspace in the BlazeMeter Asset Repository.
Get WorkspacesTool to retrieve a list of workspaces for a specified account.
Get Workspace AssetsTool to retrieve all data models (assets) in a workspace for Test Data Management.
Get Workspace Asset By IDTool to retrieve a specific asset by ID from the Test Data Management Asset Repository.
Get Workspace Asset DataTool to retrieve data from a specific asset in a workspace's asset repository.
Get Workspace Assets DependenciesTool to retrieve all dependencies for a given workspace with optional filtering criteria.
Get Workspace Asset DependencyTool to retrieve a specific dependency by ID from a workspace's asset repository.
Get Asset DependenciesTool to retrieve dependencies for a specific asset in a workspace from the BlazeMeter Asset Repository.
Get Workspace Data Model By IDTool to retrieve a specific data model by ID from a workspace in Test Data Management.
Get Virtual Service Template by IDTool to get virtual service template details from a specific workspace.
Get Workspace PackagesTool to retrieve packages from a BlazeMeter workspace.
Get Workspace Package DependenciesTool to retrieve package dependencies for a specific package in a workspace.
Get Workspace Service Mock TemplatesTool to list virtual service templates available in a workspace.
Get Workspace TransactionsTool to list transactions for virtual services in a workspace.
Get Workspace UsersTool to retrieve a list of users within a specified workspace.
Import Workspace PackageImport a package from a ZIP file into a BlazeMeter workspace.
List Generator Card IssuersTool to retrieve a list of available card issuers for test data generation.
Publish API DataPublishes test data through the BlazeMeter Test Data Management API.
Register UserTool to register a new user account in BlazeMeter.
Start TestTool to start a preconfigured performance load test.
Stop MasterGracefully stop a running BlazeMeter test execution (master) by its ID.
Stop TestTool to stop all active masters (test executions) for a given test ID.
Terminate User Active SessionsTool to immediately terminate active user sessions in BlazeMeter.
Terminate Workspaces MastersTool to terminate all running masters in a BlazeMeter workspace.
Update API Monitoring ScheduleTool to update the configuration of an existing API monitoring schedule.
Update ProjectTool to update an existing BlazeMeter project by its ID.
Update TestTool to update details of a specific test by its ID.
Update Workspace AssetTool to update an existing asset in a BlazeMeter workspace.
Update Workspaces Assets DependenciesTool to update asset dependencies in a BlazeMeter workspace.
Update Workspace PackageTool to update an existing package in a BlazeMeter workspace.
Update Workspace Package DependenciesTool to update package dependencies for a specific package in a workspace.
Update Workspace Service Mock TemplateTool to update a virtual service template configuration (Service Virtualization).
Update Workspace UserTool to update a user's role and status within a BlazeMeter workspace.
Upload Test FilesUpload a file asset (script, data file, or configuration) to a BlazeMeter test.
Upload Workspace Asset DataTool to upload asset data to a BlazeMeter workspace.
Validate TestTool to validate a specific test by its ID.
Validate Workspace AssetTool to validate a data model asset in a workspace for test data management.

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:
  • Python 3.9 or higher
  • A Composio account and API key
  • A Blazemeter connection authorized in Composio
  • An OpenAI API key for the CrewAI LLM
  • Basic familiarity with Python

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard and create an API key. You'll need credits to use the models, or you can connect to another model provider.
  • Keep the API key safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Navigate to your API settings and generate a new API key.
  • Store this key securely as you'll need it for authentication.

Install dependencies

bash
pip install composio crewai crewai-tools[mcp] python-dotenv
What's happening:
  • composio connects your agent to Blazemeter via MCP
  • crewai provides Agent, Task, Crew, and LLM primitives
  • crewai-tools[mcp] includes MCP helpers
  • python-dotenv loads environment variables from .env

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

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 Blazemeter MCP URL

Create a Composio Tool Router session for Blazemeter

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

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

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.

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 Blazemeter 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=["blazemeter"],
)
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 Blazemeter through Composio's Tool Router. The agent can perform Blazemeter 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

How to build Blazemeter MCP Agent with another framework

FAQ

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

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

Can I use Tool Router MCP with CrewAI?

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 Blazemeter tools.

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

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