- Home
- MCP servers
- Locust
Locust
- python
11
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"qainsights-locust-mcp-server": {
"command": "/Users/naveenkumar/.local/bin/uv",
"args": [
"--directory",
"/Users/naveenkumar/Gits/locust-mcp-server",
"run",
"locust_server.py"
],
"env": {
"LOCUST_HOST": "http://localhost:8089",
"LOCUST_USERS": "3",
"LOCUST_RUN_TIME": "10s",
"LOCUST_SPAWN_RATE": "1"
}
}
}
}You run locust-based load tests from within an MCP environment by hosting a dedicated MCP server that bridges Locust with your AI-powered workflows. This setup lets you start, monitor, and adjust load tests using simple MCP client commands while receiving real-time output and control over test parameters.
How to use
Configure the MCP client to connect to the Locust MCP server. You will start tests with a command that references a Locust script, specify whether you want a headless run or a UI session, and set runtime and user parameters. Use the client’s Run Locust Test capability to kick off a test with the desired test file, host, duration, and user configuration. While the test runs, you will see real-time output and progress from the Locust server.
How to install
Prerequisites you need before installing are Python 3.13 or higher and the uv package manager.
- Clone the Locust MCP server repository.
git clone https://github.com/qainsights/locust-mcp-server.git
- Install the required dependencies using the uv package manager.
uv pip install -r requirements.txt
- (Optional) Create environment variables to configure default Locust behavior. Create a .env file in the project root with settings like host, users, spawn rate, and run time.
LOCUST_HOST=http://localhost:8089 # Default host for your tests
LOCUST_USERS=3 # Default number of users
LOCUST_SPAWN_RATE=1 # Default user spawn rate
LOCUST_RUN_TIME=10s # Default test duration
Additional setup and notes
If you plan to run Locust tests via MCP, you will use the provided MCP configuration to connect the local server to your MCP client. The Locust MCP server is designed to operate in both headless and UI modes, with configurable test parameters such as users, spawn rate, and runtime.
Configuration examples
{
"mcpServers": {
"locust": {
"command": "/Users/naveenkumar/.local/bin/uv",
"args": [
"--directory",
"/Users/naveenkumar/Gits/locust-mcp-server",
"run",
"locust_server.py"
]
}
}
}
API and usage details
You can run a Locust test through the MCP server with a function like run_locust. The function takes the test file path, a headless flag, host, runtime, user count, and spawn rate to configure the test.
Tools and capabilities
The Locust MCP server provides a tool to Run a Locust test with configurable options for headless mode, host, runtime, users, and spawn rate.
Available tools
run_locust
Runs a Locust test with configurable options including headless vs UI mode, target host, duration, number of users, and spawn rate.