SuperAPI AI Directory

locust-mcp-server

Performance testing with Locust.

Open website

About this tool

Purpose

locust-mcp-server is a Model Context Protocol (MCP) server implementation for running Locust load tests. Its goal is to enable seamless integration of Locust load testing capabilities with AI-driven development environments, allowing developers to directly trigger and run Locust load tests through an LLM in supported MCP clients.

Key Capabilities

  • Simple integration with the Model Context Protocol framework
  • Supports both headless and UI modes
  • Configurable test parameters: users, spawn_rate, runtime
  • Provides an easy-to-use API for running Locust load tests
  • Real-time test execution output
  • Supports HTTP/HTTPS protocols out of the box
  • Supports custom task scenarios
  • Result analysis and debugging with the help of an LLM

Usage

  1. Prerequisites: Python 3.13 or higher; the uv package manager (refer to its installation guide).
  2. Clone the repository and install the required dependencies.
  3. Optional: create a .env file in the project root directory to set environment variables.
  4. Create a Locust test script (for example, hello.py).
  5. Configure the MCP server according to the given specification in a commonly used MCP client (Claude Desktop, Cursor, Windsurf, etc.).
  6. Ask the LLM to run the test, for example with the prompt "run locust test for hello.py". The Locust MCP server will use the run_locust tool to start the test.

Tools and Parameters

run_locust: runs a test with configurable options, including:

  • test_file: the path to the Locust test script
  • headless: run in headless mode (True) or with UI mode (False)
  • host: the target host to load test
  • runtime: the test duration (for example "30s", "1m", "5m")
  • users: the number of concurrent users to simulate
  • spawn_rate: the user spawn rate

Applicable Scenarios

  • Running Locust load tests directly in an AI-driven development environment
  • Developers and testers who need to quickly configure and execute HTTP/HTTPS load tests
  • Scenarios where test result analysis and debugging are desired with the help of an LLM

Limitations and License

This project is released under the MIT License; see the LICENSE file for details. Pull Requests for code contributions are welcome. The material does not provide more information about fees, pricing, performance results, or the specific scope of platform support.