jmeter-mcp-server
v0.4.5Stdio 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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Human-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.
| Parameter | Type | Description |
|---|---|---|
planId * | string |
add_thread_group
Add a Thread Group (virtual users) under the given parent node (usually the TestPlan root).
| Parameter | Type | Description |
|---|---|---|
name * | string | |
numThreads * | integer | Number of concurrent virtual users |
parentId * | string | Id of the node to attach this thread group under |
planId * | string | |
rampTimeSeconds * | number | Seconds to reach full thread count |
delaySeconds | number | Startup 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. |
durationSeconds | number | If set, run on a scheduler for this many seconds instead of a fixed loop count |
loops | integer | Number 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.
| Parameter | Type | Description |
|---|---|---|
method * | string | |
name * | string | |
parentId * | string | |
path * | string | Request path, e.g. /v1/users |
planId * | string | |
bodyJson | string | Raw JSON request body, if any |
domain | string | Host name, e.g. api.example.com. Omit to inherit from HTTP Request Defaults |
port | integer | Omit to inherit from HTTP Request Defaults |
protocol | string | Omit 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.
| Parameter | Type | Description |
|---|---|---|
jsonPathExpr * | string | JSONPath expression, e.g. $.data.id |
name * | string | |
parentId * | string | Id of the HTTP sampler node this extractor applies to |
planId * | string | |
referenceName * | string | JMeter variable name to store the extracted value in |
defaultValue | string | Value 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).
| Parameter | Type | Description |
|---|---|---|
headers * | array | |
parentId * | string | |
planId * | string | |
name | string |
add_response_assertion
Add a Response Assertion under an HTTP sampler, to fail the sample if the response doesn't match.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
patterns * | array | |
planId * | string | |
matchType | string | |
name | string | |
not | boolean | Negate the match (assert the pattern does NOT match) |
testField | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
filename | string | Filename kept in the .jmx for portability; ignored at execution time |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
filename | string | Filename kept in the .jmx for portability; ignored at execution time |
name | string |
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).
| Parameter | Type | Description |
|---|---|---|
filename * | string | Absolute path to the CSV file |
parentId * | string | |
planId * | string | |
delimiter | string | |
ignoreFirstLine | boolean | Set true if the CSV's first line is a header row |
name | string | |
recycle | boolean | Start over from the first line once the last row is used |
stopThread | boolean | Stop the thread once the file is exhausted (instead of recycling) |
variableNames | string | Comma-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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
variables * | array | |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
delayMs * | integer | Milliseconds to pause before each sample |
parentId * | string | |
planId * | string | |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | Id of the HTTP sampler node this extractor applies to |
planId * | string | |
referenceName * | string | JMeter variable name to store the extracted value in |
regex * | string | Regular expression with at least one capture group |
defaultValue | string | Value to use if the regex doesn't match |
matchNumber | integer | Which match to use (1 = first); 0 = random match; negative = all matches |
name | string | |
template | string | Which 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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Name of the transaction, e.g. 'Checkout Flow' |
parentId * | string | |
planId * | string | |
includeTimers | boolean | Whether 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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
loops | integer | Number of iterations, or -1 to loop forever |
name | string |
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"'.
| Parameter | Type | Description |
|---|---|---|
condition * | string | JavaScript boolean expression evaluated after ${var} substitution, e.g. '${count} < 10' |
parentId * | string | |
planId * | string | |
evaluateAll | boolean | Evaluate the condition for every iteration, not just the first |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
dataSource * | string | Pool name that JDBC Request samplers will reference |
dbUrl * | string | JDBC URL, e.g. jdbc:postgresql://host:5432/dbname |
driver * | string | JDBC driver class, e.g. org.postgresql.Driver |
parentId * | string | |
planId * | string | |
checkQuery | string | |
connectionAge | integer | |
name | string | |
password | string | |
poolMax | integer | Max pool size, 0 = unlimited |
timeout | integer | |
trimInterval | integer | |
username | string |
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.
| Parameter | Type | Description |
|---|---|---|
dataSource * | string | |
parentId * | string | |
planId * | string | |
query * | string | |
name | string | |
queryType | string | |
resultVariable | string | Variable name to store the whole result set under |
variableNames | string | Comma-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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
script * | string | |
name | string | |
parameters | string | |
scriptLanguage | string |
add_ftp_request
Add an FTP Request sampler under the given parent (usually a Thread Group).
| Parameter | Type | Description |
|---|---|---|
filename * | string | Remote file path to download/upload |
parentId * | string | |
planId * | string | |
server * | string | |
binaryMode | boolean | |
inputData | string | Literal data to upload, instead of a local file |
localFilename | string | Local file path, for download destination or upload source |
name | string | |
password | string | |
port | integer | |
saveResponse | boolean | |
upload | boolean | |
username | string |
add_tcp_sampler
Add a TCP Sampler under the given parent (usually a Thread Group), opening a raw TCP connection and sending request data.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
port * | integer | |
request * | string | Data to send over the connection |
server * | string | |
classname | string | TCP client handler class (short name resolves under org.apache.jmeter.protocol.tcp.sampler) |
closeConnection | boolean | |
connectTimeoutMs | integer | |
name | string | |
noDelay | boolean | |
reUseConnection | boolean | |
timeoutMs | integer |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
connectTimeoutMs | integer | |
domain | string | |
name | string | |
path | string | |
port | integer | |
protocol | string | |
responseTimeoutMs | integer |
add_cookie_manager
Add an HTTP Cookie Manager under the given parent (usually a Thread Group), so samplers in scope share cookies automatically.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
clearEachIteration | boolean | |
name | string | |
policy | string |
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'.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
condition | string | |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
ignoreSubControllerBlocks | boolean | If true, interleaves across every leaf sampler recursively instead of one-per-direct-child |
name | string |
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).
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
name | string |
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).
| Parameter | Type | Description |
|---|---|---|
numThreads * | integer | |
parentId * | string | |
planId * | string | |
rampTimeSeconds * | number | |
delaySeconds | number | Startup 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. |
durationSeconds | number | If set, run on a scheduler for this many seconds instead of a fixed loop count |
loops | integer | Number of loop iterations per thread, -1 for infinite |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
numThreads * | integer | |
parentId * | string | |
planId * | string | |
rampTimeSeconds * | number | |
delaySeconds | number | Startup 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. |
durationSeconds | number | If set, run on a scheduler for this many seconds instead of a fixed loop count |
loops | integer | Number of loop iterations per thread, -1 for infinite |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | Id of the HTTP sampler node this extractor applies to |
planId * | string | |
referenceName * | string | JMeter variable name to store the extracted value in |
xpathQuery * | string | |
defaultValue | string | |
matchNumber | integer | Which match to use (1 = first) |
name | string | |
tolerant | boolean | Use 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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
script * | string | |
name | string | |
parameters | string | |
scriptLanguage | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
script * | string | |
name | string | |
parameters | string | |
scriptLanguage | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
valueSets * | array | One array per thread/user slot; each inner array must have exactly one value per variableNames entry, in order |
variableNames * | array | |
name | string | |
perIteration | boolean | Re-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.
| Parameter | Type | Description |
|---|---|---|
jsonPath * | string | JSONPath expression, e.g. $.value |
parentId * | string | |
planId * | string | |
expectNull | boolean | |
expectedValue | string | Value to compare against, only checked if jsonValidation is true |
invert | boolean | Negate the assertion |
isRegex | boolean | Treat expectedValue as a regular expression |
jsonValidation | boolean | Whether to check expectedValue at all |
name | string |
add_duration_assertion
Add a Duration Assertion under an HTTP sampler, failing the sample if it takes longer than maxDurationMs.
| Parameter | Type | Description |
|---|---|---|
maxDurationMs * | integer | |
parentId * | string | |
planId * | string | |
name | string |
add_size_assertion
Add a Size Assertion under an HTTP sampler, comparing a response field's byte size against a threshold.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
size * | integer | Size in bytes to compare against |
name | string | |
operator | string | |
testField | string |
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.
| Parameter | Type | Description |
|---|---|---|
delayMs * | number | Base/minimum delay in milliseconds |
parentId * | string | |
planId * | string | |
rangeMs * | number | Maximum extra random delay added on top of delayMs |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
targetSamplesPerMinute * | number | |
calcMode | string | |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
captureFullData | boolean | Currently has no effect under this server's CSV-only execution model - see tool description |
filename | string | Filename kept in the .jmx for portability; ignored at execution time |
name | string |
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.
| Parameter | Type | Description |
|---|---|---|
parentId * | string | |
planId * | string | |
args | array | |
classname | string | |
name | string |
remove_element
Remove an element (and its subtree) from a test plan. The root TestPlan node cannot be removed.
| Parameter | Type | Description |
|---|---|---|
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).
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | |
planId * | string | |
props * | object | Patch to apply to the node's props |
mode | string |
rename_element
Rename an element (its testname in the generated .jmx).
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
newParentId * | string | |
nodeId * | string | |
planId * | string | |
index | integer |
reorder_children
Reorder a node's direct children. orderedChildIds must be an exact permutation of that node's current children ids.
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | |
nodeId * | string | |
planId * | string |
get_test_plan_xml
Serialize a test plan to its JMeter .jmx XML, without running JMeter.
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Absolute path to the .jmx file to import |
name | string | Plan 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.
| Parameter | Type | Description |
|---|---|---|
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…
| Parameter | Type | Description |
|---|---|---|
executionId * | string |
stop_execution
Stop a running test execution (sends SIGTERM to the JMeter process).
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
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…
| Parameter | Type | Description |
|---|---|---|
maxThreads * | integer | Safety ceiling - the search never runs more threads than this. |
planId * | string | |
threadGroupNodeId * | string | Node id of the thread group whose thread count the search will drive. |
cooldownSeconds | number | Pause between rounds so the system under test recovers (default 5). |
errorPct | number | Fail a round when the overall error rate exceeds this percentage. |
maxIterations | integer | Hard cap on rounds, so a slow search still ends (default 8). |
p95Ms | number | Fail a round when overall p95 latency exceeds this many milliseconds. |
plateauDurationSeconds | number | Seconds to hold full load after ramp-up; only these samples count toward the SLA (default 60). |
rampSecondsPerThread | number | Ramp-up seconds per thread, so every round adds load at the same rate (default 0.1). |
startThreads | integer | Thread count for the first round; doubles from there while the SLA holds (default 50). |
toleranceThreads | integer | Stop 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…
| Parameter | Type | Description |
|---|---|---|
searchId * | string |
stop_breaking_point_search
Stop a running capacity search. Terminates the round in flight, restores the thread group's original settings, and keeps whatever bounds the search had established so far.
| Parameter | Type | Description |
|---|---|---|
searchId * | string |