locust-mcp-server logo

locust-mcp-server

by MCP-Mirror

A Model Context Protocol (MCP) server implementation for running Locust load tests. This server enables seamless integration of Locust load testing capabilities with AI-powered development environments.

View on GitHub

Last updated: N/A

What is locust-mcp-server?

The locust-mcp-server is a Model Context Protocol (MCP) server designed to integrate Locust load testing with AI-powered development environments. It allows users to run Locust tests seamlessly from within tools like Claude Desktop, Cursor, and Windsurf.

How to use locust-mcp-server?

To use the locust-mcp-server, first clone the repository and install the dependencies using uv. Then, create a Locust test script. Configure the MCP server in your client with the provided JSON specs, pointing to the locust_server.py. Finally, instruct your LLM to run the test, specifying the test file. The server will use the run_locust tool to execute the test with configurable options.

Key features of locust-mcp-server

  • Simple integration with Model Context Protocol framework

  • Support for headless and UI modes

  • Configurable test parameters (users, spawn rate, runtime)

  • Easy-to-use API for running Locust load tests

  • Real-time test execution output

  • HTTP/HTTPS protocol support out of the box

  • Custom task scenarios support

Use cases of locust-mcp-server

  • Integrating load testing into AI-powered development workflows

  • Running Locust tests from within IDEs and other development tools

  • Automating load testing as part of a CI/CD pipeline

  • Validating the performance of web applications and APIs

  • Simulating realistic user traffic to identify bottlenecks

FAQ from locust-mcp-server

What is the default host for the tests?

The default host is http://localhost:8089, but it can be configured using the LOCUST_HOST environment variable.

How do I run the tests in headless mode?

The headless parameter in the run_locust function controls this. Set it to True for headless mode and False for UI mode.

Can I customize the number of users and spawn rate?

Yes, you can configure the number of users and spawn rate using the users and spawn_rate parameters in the run_locust function or by setting the LOCUST_USERS and LOCUST_SPAWN_RATE environment variables.

What is the format for specifying the runtime?

The runtime should be specified as a string with a time unit, such as '30s', '1m', or '5m'.

How do I contribute to the project?

Contributions are welcome! Please submit a Pull Request with your changes.