QL

qainsights/locust-mcp-server

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

13 stars 9 forks 품질 65 트렌드 20MIT

Locust 부하 테스트를 실행하기위한 모델 Context Protocol (MCP) 서버 구현. 이 서버는 AI-powered 개발과 함께 Locust 로드 테스트 기능을 완벽하게 통합 할 수 있습니다 ...

개요

Locust 부하 테스트를 실행하기위한 모델 Context Protocol (MCP) 서버 구현. 이 서버는 AI-powered 개발 환경을 가진 Locust 짐 테스트 기능의 이음새가 없는 통합을 가능하게 합니다. - 모델 콘텍스트 프로토콜 프레임 워크와 간단한 통합 - 헤드리스 및 UI 모드 지원 - 구성 가능한 테스트 매개 변수 (사용자, 스페인 속도, 실행 시간) - Locust 부하 테스트를 실행하기위한 사용하기 쉬운 API - 실시간 테스트 실행 출력 - HTTP / HTTPS 프로토콜 지원 상자 - 사용자 정의 작업 시나리오 지원 시작하기 전에 다음을 설치해야합니다. - Python 3.13 이상 - uv 패키지 관리자 (설치 가이드) 3. 환경 변수 설정 (선택 사항): 프로젝트 루트의 .env 파일 만들기: 1. Locust 테스트 스크립트 생성 (예: hello.py): 2. 좋아하는 MCP 클라이언트의 아래 사양을 사용하여 MCP 서버를 구성 (Claude Desktop, Cursor, Windsurf 등) : 3. 이제 테스트 e.g를 실행하기 위해 LLM을 묻습니다. hello.py에 대한 locust 테스트를 실행합니다.

개요(AI 번역)

Locust 부하 테스트를 실행하기위한 모델 Context Protocol (MCP) 서버 구현. 이 서버는 AI-powered 개발 환경을 가진 Locust 짐 테스트 기능의 이음새가 없는 통합을 가능하게 합니다.

✨ 특징

  • Model Context Protocol Framework와 간단한 통합
  • headless 및 UI 모드 지원
  • 구성 가능한 테스트 매개 변수 (사용자, 스페인 비율, 실행 시간)
  • Easy-to-use API for running Locust Load 테스트
  • 실시간 테스트 실행 출력
  • 상자에서 HTTP/HTTPS 프로토콜 지원
  • 사용자 정의 작업 시나리오 지원

過去문의

시작하기 전에 다음을 설치해야합니다.

  • Python 3.13 이상
  • uv 패키지 관리자 (설치 가이드)

☸ 임명

  1. 저장소를 복제:

  2. 필수 종속을 설치하십시오:

  3. 환경 변수 설정 (옵션): 프로젝트 루트의 .env 파일 만들기:

⭐ 시작하기

  1. Locust 테스트 스크립트 생성 (예: hello.py):

  2. 좋아하는 MCP 클라이언트의 아래 사양을 사용하여 MCP 서버를 구성 (Claude Desktop, Cursor, Windsurf 등) :

  3. 이제 테스트 e.g. run locust test for hello.py]를 실행하기 위해 LLM을 요청합니다. Locust MCP 서버는 다음과 같은 도구를 사용하여 테스트를 시작합니다

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

🚀 ⚡️ locust-mcp-server

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.

✨ Features

  • 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

🔧 Prerequisites

Before you begin, ensure you have the following installed:

📦 Installation

  1. Clone the repository:
git clone https://github.com/qainsights/locust-mcp-server.git
  1. Install the required dependencies:
uv pip install -r requirements.txt
  1. Set up environment variables (optional): Create a .env file in the project root:
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

🚀 Getting Started

  1. Create a Locust test script (e.g., hello.py):
from locust import HttpUser, task, between

class QuickstartUser(HttpUser):
    wait_time = between(1, 5)

    @task
    def hello_world(self):
        self.client.get("/hello")
        self.client.get("/world")

    @task(3)
    def view_items(self):
        for item_id in range(10):
            self.client.get(f"/item?id={item_id}", name="/item")
            time.sleep(1)

    def on_start(self):
        self.client.post("/login", json={"username":"foo", "password":"bar"})
  1. Configure the MCP server using the below specs in your favorite MCP client (Claude Desktop, Cursor, Windsurf and more):
{
  "mcpServers": {
    "locust": {
      "command": "/Users/naveenkumar/.local/bin/uv",
      "args": [
        "--directory",
        "/Users/naveenkumar/Gits/locust-mcp-server",
        "run",
        "locust_server.py"
      ]
    }
  }
}
  1. Now ask the LLM to run the test e.g. run locust test for hello.py. The Locust MCP server will use the following tool to start the test:
  • run_locust: Run a test with configurable options for headless mode, host, runtime, users, and spawn rate

📝 API Reference

Run Locust Test

run_locust(
    test_file: str,
    headless: bool = True,
    host: str = "http://localhost:8089",
    runtime: str = "10s",
    users: int = 3,
    spawn_rate: int = 1
)

Parameters:

  • test_file: Path to your Locust test script
  • headless: Run in headless mode (True) or with UI (False)
  • host: Target host to load test
  • runtime: Test duration (e.g., “30s”, “1m”, “5m”)
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "locust": { "command": "/Users/naveenkumar/.local/bin/uv", "args": [ "--directory", "/Users/naveenkumar/Gits/locust-mcp-server", "run", "locust_server.py" ] } } }