JmeterDemoUsingMCP

vjgit-369/JmeterDemoUsingMCP

3.1

If you are the rightful owner of JmeterDemoUsingMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Model Context Protocol (MCP) server facilitates communication between JMeter and MCP-compatible clients for performance testing.

JMeter Demo Using MCP

This project demonstrates how to use JMeter with Model Context Protocol (MCP) for automated performance testing.

Prerequisites

  • Python 3.x
  • Apache JMeter
  • MCP-compatible client (e.g., Cursor)

Project Structure

JmeterDemoUsingMCP/
ā”œā”€ā”€ jmeter/                  # JMeter installation directory
ā”œā”€ā”€ jmeter-mcp-server/      # MCP server for JMeter integration
│   ā”œā”€ā”€ test_mcp.py         # Test execution script
│   └── jmeter_server.py    # JMeter MCP server implementation
└── AutomationExercise_Test.jmx  # Sample JMeter test plan

Setup

  1. Install JMeter and set up the environment:
# Set JMETER_HOME environment variable
JMETER_HOME=/path/to/apache-jmeter
  1. Install Python dependencies:
pip install mcp pydantic

Usage

  1. Run tests in GUI mode:
python test_mcp.py
  1. Run tests with increased users:
# Modify test_mcp.py parameters:
'-Jthreads=10'  # Number of users
'-Jrampup=20'   # Ramp-up period
'-Jduration=60' # Test duration

Features

  • GUI and Non-GUI test execution
  • Configurable thread count and test duration
  • Automated HTML report generation
  • Real-time test monitoring

Test Results

Results are saved in:

  • JTL files: results*.jtl
  • HTML reports: report*/index.html

Contributing

Feel free to submit issues and enhancement requests!