jmeter-mcp-server

v0.4.5
jmeter-mcp-server Checked 5 days ago Published 2 months ago

Stdio MCP server to build, run and read reports for JMeter test plans

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_test_plan

Create a new JMeter test plan. Returns the planId and the id of its root TestPlan node, which you'll use as parentId for the first thread group.

ParameterTypeDescription
name *stringHuman-readable name for the test plan

list_test_plans

List all test plans in the workspace.

get_test_plan

Get the full element tree of a test plan, including every node's id (needed as parentId for add_* tools) and type.

ParameterTypeDescription
planId *string

add_thread_group

Add a Thread Group (virtual users) under the given parent node (usually the TestPlan root).

ParameterTypeDescription
name *string
numThreads *integerNumber of concurrent virtual users
parentId *stringId of the node to attach this thread group under
planId *string
rampTimeSeconds *numberSeconds to reach full thread count
delaySecondsnumberStartup delay: seconds to wait before this thread group starts (enables the scheduler). Use it to stage thread groups, e.g. a second group that begins 5s after the first.
durationSecondsnumberIf set, run on a scheduler for this many seconds instead of a fixed loop count
loopsintegerNumber of loop iterations per thread, -1 for infinite

add_http_sampler

Add an HTTP Request sampler under the given parent node (usually a Thread Group). To inherit protocol, domain or port from an HTTP Request Defaults config element in scope (add_http_request_defaults), leave that argument out of the call - do not pass an empty string or a placeholder, because those fields have no default of their own. Passing an explicit value always overrides the Defaults for that field.

ParameterTypeDescription
method *string
name *string
parentId *string
path *stringRequest path, e.g. /v1/users
planId *string
bodyJsonstringRaw JSON request body, if any
domainstringHost name, e.g. api.example.com. Omit to inherit from HTTP Request Defaults
portintegerOmit to inherit from HTTP Request Defaults
protocolstringOmit to inherit from HTTP Request Defaults

add_json_extractor

Add a JSON Extractor post-processor under an HTTP sampler, to save a value from the JSON response into a variable.

ParameterTypeDescription
jsonPathExpr *stringJSONPath expression, e.g. $.data.id
name *string
parentId *stringId of the HTTP sampler node this extractor applies to
planId *string
referenceName *stringJMeter variable name to store the extracted value in
defaultValuestringValue to use if the JSONPath doesn't match

add_header_manager

Add an HTTP Header Manager under an HTTP sampler (or a Thread Group, to apply to every sampler in it).

ParameterTypeDescription
headers *array
parentId *string
planId *string
namestring

add_response_assertion

Add a Response Assertion under an HTTP sampler, to fail the sample if the response doesn't match.

ParameterTypeDescription
parentId *string
patterns *array
planId *string
matchTypestring
namestring
notbooleanNegate the match (assert the pattern does NOT match)
testFieldstring

add_aggregate_report_listener

Add an Aggregate Report listener under the given parent (Thread Group or TestPlan). Its output is what get_execution_report reads after a run.

ParameterTypeDescription
parentId *string
planId *string
filenamestringFilename kept in the .jmx for portability; ignored at execution time
namestring

add_summary_report_listener

Add a Summary Report listener under the given parent (Thread Group or TestPlan). Its output is what get_execution_report reads after a run.

ParameterTypeDescription
parentId *string
planId *string
filenamestringFilename kept in the .jmx for portability; ignored at execution time
namestring

add_csv_data_set

Add a CSV Data Set Config under the given parent (a Thread Group to feed every sampler in it, or a single sampler to scope it there). Each thread reads one row per iteration, exposing each column as a JMeter variable. The filename must be an absolute path readable on the machine that will run the test (execute_test_plan runs JMeter from a fresh per-execution directory, so relative paths won't resolve).

ParameterTypeDescription
filename *stringAbsolute path to the CSV file
parentId *string
planId *string
delimiterstring
ignoreFirstLinebooleanSet true if the CSV's first line is a header row
namestring
recyclebooleanStart over from the first line once the last row is used
stopThreadbooleanStop the thread once the file is exhausted (instead of recycling)
variableNamesstringComma-separated column names, e.g. 'username,password'. Omit if the CSV has a header row.

add_user_defined_variables

Add a User Defined Variables config element under the given parent (TestPlan root for global variables, or a Thread Group to scope them there). Values are set once, before the test starts.

ParameterTypeDescription
parentId *string
planId *string
variables *array
namestring

add_constant_timer

Add a Constant Timer under the given parent to pace requests. Under a Thread Group it delays every sampler in it; under a single sampler it delays only that one, before it fires.

ParameterTypeDescription
delayMs *integerMilliseconds to pause before each sample
parentId *string
planId *string
namestring

add_regex_extractor

Add a Regular Expression Extractor under an HTTP sampler, to save a value from its response (body, headers, etc.) into a variable using a regex capture group. Use this instead of add_json_extractor for non-JSON (HTML/XML/plain-text) responses.

ParameterTypeDescription
parentId *stringId of the HTTP sampler node this extractor applies to
planId *string
referenceName *stringJMeter variable name to store the extracted value in
regex *stringRegular expression with at least one capture group
defaultValuestringValue to use if the regex doesn't match
matchNumberintegerWhich match to use (1 = first); 0 = random match; negative = all matches
namestring
templatestringWhich capture group(s) to store, e.g. '$1$'

add_transaction_controller

Add a Transaction Controller under the given parent (usually a Thread Group). Samplers added under it (as its children) are timed and reported as a single named transaction instead of separately.

ParameterTypeDescription
name *stringName of the transaction, e.g. 'Checkout Flow'
parentId *string
planId *string
includeTimersbooleanWhether to include timer/pre-processor delays in the transaction's reported time

add_loop_controller

Add a Loop Controller under the given parent (usually a Thread Group). Samplers added under it (as its children) repeat for the given number of loops each time the controller is reached.

ParameterTypeDescription
parentId *string
planId *string
loopsintegerNumber of iterations, or -1 to loop forever
namestring

add_if_controller

Add an If Controller under the given parent (usually a Thread Group). Samplers added under it (as its children) only run when the condition evaluates truthy. condition is evaluated as a real JavaScript (Rhino) expression after JMeter substitutes any ${var} references, so comparisons work directly, e.g. '${count} < 10' or '"${status}" == "ok"'.

ParameterTypeDescription
condition *stringJavaScript boolean expression evaluated after ${var} substitution, e.g. '${count} < 10'
parentId *string
planId *string
evaluateAllbooleanEvaluate the condition for every iteration, not just the first
namestring

add_jdbc_connection_configuration

Add a JDBC Connection Configuration (pooled datasource) under the given parent, usually the Thread Group or TestPlan root. A JDBC Request references this element's dataSource name.

ParameterTypeDescription
dataSource *stringPool name that JDBC Request samplers will reference
dbUrl *stringJDBC URL, e.g. jdbc:postgresql://host:5432/dbname
driver *stringJDBC driver class, e.g. org.postgresql.Driver
parentId *string
planId *string
checkQuerystring
connectionAgeinteger
namestring
passwordstring
poolMaxintegerMax pool size, 0 = unlimited
timeoutinteger
trimIntervalinteger
usernamestring

add_jdbc_request

Add a JDBC Request sampler under the given parent (usually a Thread Group). dataSource must match a JDBC Connection Configuration's dataSource name added elsewhere in the same plan.

ParameterTypeDescription
dataSource *string
parentId *string
planId *string
query *string
namestring
queryTypestring
resultVariablestringVariable name to store the whole result set under
variableNamesstringComma-separated variable names to store each result column under

add_jsr223_sampler

Add a JSR223 Sampler under the given parent (usually a Thread Group), running a script as the sample itself. Scripts default to Groovy, which only works when JMeter runs on a compatible Java (17 is the safe choice; the Groovy bundled with JMeter 5.6.x fails on very new Java such as 25+, killing each virtual user on its first script run) - the result carries a "warning" field when this server detects a mismatch. For unique or random data, prefer the built-in functions ${__UUID}, ${__RandomString} and ${__Random}, which need no script at all.

ParameterTypeDescription
parentId *string
planId *string
script *string
namestring
parametersstring
scriptLanguagestring

add_ftp_request

Add an FTP Request sampler under the given parent (usually a Thread Group).

ParameterTypeDescription
filename *stringRemote file path to download/upload
parentId *string
planId *string
server *string
binaryModeboolean
inputDatastringLiteral data to upload, instead of a local file
localFilenamestringLocal file path, for download destination or upload source
namestring
passwordstring
portinteger
saveResponseboolean
uploadboolean
usernamestring

add_tcp_sampler

Add a TCP Sampler under the given parent (usually a Thread Group), opening a raw TCP connection and sending request data.

ParameterTypeDescription
parentId *string
planId *string
port *integer
request *stringData to send over the connection
server *string
classnamestringTCP client handler class (short name resolves under org.apache.jmeter.protocol.tcp.sampler)
closeConnectionboolean
connectTimeoutMsinteger
namestring
noDelayboolean
reUseConnectionboolean
timeoutMsinteger

add_http_request_defaults

Add HTTP Request Defaults under the given parent (usually a Thread Group or TestPlan root). Any field left blank on a later add_http_sampler call under the same scope falls back to these values.

ParameterTypeDescription
parentId *string
planId *string
connectTimeoutMsinteger
domainstring
namestring
pathstring
portinteger
protocolstring
responseTimeoutMsinteger

add_while_controller

Add a While Controller under the given parent (usually a Thread Group). Samplers added under it (as its children) repeat while condition holds. Leave condition blank (or 'LAST') to loop while the last sampler in the loop succeeded; otherwise it's a JMeter expression re-evaluated each pass, looping until it evaluates to the literal string 'false'.

ParameterTypeDescription
parentId *string
planId *string
conditionstring
namestring

add_random_controller

Add a Random Controller under the given parent (usually a Thread Group). On each pass it runs exactly one randomly chosen child (added under it) instead of all of them.

ParameterTypeDescription
parentId *string
planId *string
namestring

add_interleave_controller

Add an Interleave Controller under the given parent (usually a Thread Group). Runs one child (added under it) per pass, alternating through them in order instead of running them all.

ParameterTypeDescription
parentId *string
planId *string
ignoreSubControllerBlocksbooleanIf true, interleaves across every leaf sampler recursively instead of one-per-direct-child
namestring

add_once_only_controller

Add a Once Only Controller under the given parent (usually a Thread Group). Its children run only on each thread's first iteration and are skipped on every later one - use it for a login before a looping scenario (or in a Thread Group that loops forever / runs on a scheduler, as find_breaking_point does).

ParameterTypeDescription
parentId *string
planId *string
namestring

add_setup_thread_group

Add a setUp Thread Group under the TestPlan root. Runs once, before all normal Thread Groups start, regardless of where it sits in the tree - typically used for one-time setup (e.g. login, seeding data).

ParameterTypeDescription
numThreads *integer
parentId *string
planId *string
rampTimeSeconds *number
delaySecondsnumberStartup delay: seconds to wait before this thread group starts (enables the scheduler). Use it to stage thread groups, e.g. a second group that begins 5s after the first.
durationSecondsnumberIf set, run on a scheduler for this many seconds instead of a fixed loop count
loopsintegerNumber of loop iterations per thread, -1 for infinite
namestring

add_teardown_thread_group

Add a tearDown Thread Group under the TestPlan root. Runs once, after all normal Thread Groups finish, regardless of where it sits in the tree - typically used for one-time cleanup.

ParameterTypeDescription
numThreads *integer
parentId *string
planId *string
rampTimeSeconds *number
delaySecondsnumberStartup delay: seconds to wait before this thread group starts (enables the scheduler). Use it to stage thread groups, e.g. a second group that begins 5s after the first.
durationSecondsnumberIf set, run on a scheduler for this many seconds instead of a fixed loop count
loopsintegerNumber of loop iterations per thread, -1 for infinite
namestring

add_xpath_extractor

Add an XPath Extractor under an HTTP sampler, to save a value from an XML/HTML response into a variable using an XPath expression. Set tolerant=true for real-world (non-strict) HTML.

ParameterTypeDescription
parentId *stringId of the HTTP sampler node this extractor applies to
planId *string
referenceName *stringJMeter variable name to store the extracted value in
xpathQuery *string
defaultValuestring
matchNumberintegerWhich match to use (1 = first)
namestring
tolerantbooleanUse a lenient HTML parser instead of a strict XML parser

add_jsr223_preprocessor

Add a JSR223 PreProcessor under an HTTP sampler (or a Thread Group, to apply to every sampler in it), running a script before the sample. Scripts default to Groovy, which only works when JMeter runs on a compatible Java (17 is the safe choice; the Groovy bundled with JMeter 5.6.x fails on very new Java such as 25+, killing each virtual user on its first script run) - the result carries a "warning" field when this server detects a mismatch. For unique or random data, prefer the built-in functions ${__UUID}, ${__RandomString} and ${__Random}, which need no script at all.

ParameterTypeDescription
parentId *string
planId *string
script *string
namestring
parametersstring
scriptLanguagestring

add_jsr223_postprocessor

Add a JSR223 PostProcessor under an HTTP sampler (or a Thread Group, to apply to every sampler in it), running a script after the sample. Scripts default to Groovy, which only works when JMeter runs on a compatible Java (17 is the safe choice; the Groovy bundled with JMeter 5.6.x fails on very new Java such as 25+, killing each virtual user on its first script run) - the result carries a "warning" field when this server detects a mismatch. For unique or random data, prefer the built-in functions ${__UUID}, ${__RandomString} and ${__Random}, which need no script at all.

ParameterTypeDescription
parentId *string
planId *string
script *string
namestring
parametersstring
scriptLanguagestring

add_user_parameters

Add a User Parameters pre-processor under a Thread Group, assigning each thread a different set of variable values (cycled by thread number), set once at thread start unless perIteration is true. Different from add_user_defined_variables, which sets the same values for every thread.

ParameterTypeDescription
parentId *string
planId *string
valueSets *arrayOne array per thread/user slot; each inner array must have exactly one value per variableNames entry, in order
variableNames *array
namestring
perIterationbooleanRe-apply values every loop iteration instead of once at thread start

add_json_assertion

Add a JSON Assertion under an HTTP sampler, to validate a JSONPath expression exists (and optionally matches a value) in the response.

ParameterTypeDescription
jsonPath *stringJSONPath expression, e.g. $.value
parentId *string
planId *string
expectNullboolean
expectedValuestringValue to compare against, only checked if jsonValidation is true
invertbooleanNegate the assertion
isRegexbooleanTreat expectedValue as a regular expression
jsonValidationbooleanWhether to check expectedValue at all
namestring

add_duration_assertion

Add a Duration Assertion under an HTTP sampler, failing the sample if it takes longer than maxDurationMs.

ParameterTypeDescription
maxDurationMs *integer
parentId *string
planId *string
namestring

add_size_assertion

Add a Size Assertion under an HTTP sampler, comparing a response field's byte size against a threshold.

ParameterTypeDescription
parentId *string
planId *string
size *integerSize in bytes to compare against
namestring
operatorstring
testFieldstring

add_uniform_random_timer

Add a Uniform Random Timer under the given parent to pace requests with a randomized delay: delayMs +/- a random amount up to rangeMs, picked fresh before each sample.

ParameterTypeDescription
delayMs *numberBase/minimum delay in milliseconds
parentId *string
planId *string
rangeMs *numberMaximum extra random delay added on top of delayMs
namestring

add_constant_throughput_timer

Add a Constant Throughput Timer under the given parent, pacing requests to hit a target rate rather than a fixed per-sample delay.

ParameterTypeDescription
parentId *string
planId *string
targetSamplesPerMinute *number
calcModestring
namestring

add_view_results_tree_listener

Add a View Results Tree listener under the given parent (Thread Group or TestPlan). Its output is readable via get_execution_report when there's no Aggregate/Summary Report listener present. NOTE: captureFullData currently has no effect - execute_test_plan always runs JMeter with CSV output, and JMeter's CSV writer never emits response body/header columns regardless of this flag (only its XML output format can carry those); this option is a no-op until this server supports XML-format runs.

ParameterTypeDescription
parentId *string
planId *string
captureFullDatabooleanCurrently has no effect under this server's CSV-only execution model - see tool description
filenamestringFilename kept in the .jmx for portability; ignored at execution time
namestring

add_backend_listener

Add a Backend Listener under the given parent (Thread Group or TestPlan), streaming live metrics to an external backend (InfluxDB by default) instead of a JTL file. If args is omitted, a ready-to-edit InfluxDB argument set is used - at minimum, edit influxdbUrl before running.

ParameterTypeDescription
parentId *string
planId *string
argsarray
classnamestring
namestring

remove_element

Remove an element (and its subtree) from a test plan. The root TestPlan node cannot be removed.

ParameterTypeDescription
nodeId *string
planId *string

update_element

Update an element's props with a shallow merge (or full replace). A prop value of null in props removes that key. When the node's type is one of the modeled types, the resulting props are validated against that type's schema (check the type first via get_test_plan).

ParameterTypeDescription
nodeId *string
planId *string
props *objectPatch to apply to the node's props
modestring

rename_element

Rename an element (its testname in the generated .jmx).

ParameterTypeDescription
name *string
nodeId *string
planId *string

move_element

Move an element (and its subtree) to a new parent, optionally at a specific index among the new parent's children (default: appended last). Rejects moving a node into its own subtree.

ParameterTypeDescription
newParentId *string
nodeId *string
planId *string
indexinteger

reorder_children

Reorder a node's direct children. orderedChildIds must be an exact permutation of that node's current children ids.

ParameterTypeDescription
orderedChildIds *array
parentId *string
planId *string

set_element_enabled

Enable or disable an element without removing it. A disabled element is skipped by JMeter at run time.

ParameterTypeDescription
enabled *boolean
nodeId *string
planId *string

get_test_plan_xml

Serialize a test plan to its JMeter .jmx XML, without running JMeter.

ParameterTypeDescription
planId *string

import_test_plan

Import an externally authored .jmx file (e.g. exported from the JMeter GUI) as a new test plan. Element types this server doesn't model are kept as opaque UnknownElement nodes (their original XML is preserved and re-emitted as-is) instead of being dropped - check unknownElementCount/unknownElementTypes in the response to see what wasn't fully understood.

ParameterTypeDescription
filePath *stringAbsolute path to the .jmx file to import
namestringPlan name to use; defaults to the imported TestPlan element's name

execute_test_plan

Start running a test plan with JMeter in non-GUI mode. Returns immediately with an executionId; the run continues in the background. Poll get_execution_status to know when it's done, then call get_execution_report to read the results.

ParameterTypeDescription
planId *string

get_execution_status

Check the status of a test run started with execute_test_plan (running/completed/failed), how long it has been running, and - while it runs - a `progress` block computed from the results file so far: samples, error rate, avg/p95 latency, overall and recent (last ~10s) throughput, and the same per label. Poll this tool rather than tailing stdout.log. The logTail is JMeter's console output with JVM startup warnings filtered out; JMeter only prints a summary line there about every 30 seconds, so it can stay the same between quick polls. Once the run ends, call get_execution_report for the full ag…

ParameterTypeDescription
executionId *string

stop_execution

Stop a running test execution (sends SIGTERM to the JMeter process).

ParameterTypeDescription
executionId *string

get_execution_report

Read and aggregate the results of a finished (or still-running) execution, computed from its Aggregate Report / Summary Report listener output: per-label and overall count, error rate, avg/min/max/median/p90/p95/p99 latency, throughput and KB/sec.

ParameterTypeDescription
executionId *string

find_breaking_point

Find the concurrency level where a test plan stops meeting its SLA. Runs the plan over and over on its own, driving one thread group's thread count: first doubling the load until the SLA breaks, then binary-searching between the last healthy level and the first broken one. Returns immediately with a searchId; poll get_breaking_point_status for progress and the final breaking point. The thread group is temporarily switched to ramp-up + fixed-plateau (scheduler) mode for the search and its original settings are restored when the search ends. Requires an Aggregate Report, Summary Report, or View…

ParameterTypeDescription
maxThreads *integerSafety ceiling - the search never runs more threads than this.
planId *string
threadGroupNodeId *stringNode id of the thread group whose thread count the search will drive.
cooldownSecondsnumberPause between rounds so the system under test recovers (default 5).
errorPctnumberFail a round when the overall error rate exceeds this percentage.
maxIterationsintegerHard cap on rounds, so a slow search still ends (default 8).
p95MsnumberFail a round when overall p95 latency exceeds this many milliseconds.
plateauDurationSecondsnumberSeconds to hold full load after ramp-up; only these samples count toward the SLA (default 60).
rampSecondsPerThreadnumberRamp-up seconds per thread, so every round adds load at the same rate (default 0.1).
startThreadsintegerThread count for the first round; doubles from there while the SLA holds (default 50).
toleranceThreadsintegerStop bisecting once the healthy and broken bounds are this close (default: 2% of maxThreads, minimum 5).

get_breaking_point_status

Check a capacity search started with find_breaking_point: status (running/completed/failed/stopped), progress (rounds completed out of maxIterations, plus the in-flight round's elapsed time and percent complete), the rounds run so far with each one's load and overall + per-label metrics, and - once it finishes - the breaking point, the last healthy load, and a plain-language conclusion. breakingPoint is the lowest load that was tested and broke the SLA, not necessarily the exact edge: read breakingPointRange (healthyUpTo / brokenAt / exact) for the real precision, since levels between the two…

ParameterTypeDescription
searchId *string