jmeter-mcp-server
MCP server for generating, validating, running, and reporting Apache JMeter API performance tests from structured API sources.
README
JMeter MCP Server
An MCP server for generating, validating, running, and reporting Apache JMeter API performance tests from structured API sources.
The project is designed for SDETs and automation engineers who want LLM-assisted test-plan creation without letting the LLM write arbitrary JMX. The LLM supplies structured MCP tool arguments; TypeScript code validates the input, applies deterministic load policies, renders JMX, and validates the generated file.
Features
- Generate JMeter
.jmxplans from OpenAPI files or explicit endpoint details. - Deterministic test profiles:
smoke,baseline,load,spike,stress,soak, andcustom. - Zod-validated MCP tool inputs.
- Guardrails for aggressive load, documented rate limits, and profile mismatch.
- Runtime parameterization for credentials with JMeter properties such as
${__P(API_KEY,)}. - OS-agnostic JMeter binary resolution through
JMETER_BIN,JMETER_HOME, orjmeteronPATH. - TypeScript runner scripts for individual JMX files, suites, and JTL summary reports.
- GitHub Actions CI for strict TypeScript build and guardrail tests.
Prerequisites
- Node.js
>=22 - npm
- Apache JMeter
5.6.xor compatible - Java supported by your JMeter installation
JMeter can be discovered in one of three ways:
export JMETER_BIN=/absolute/path/to/jmeter
or:
export JMETER_HOME=/absolute/path/to/apache-jmeter
or by having jmeter available on PATH.
Install
npm ci
npm run build:all
npm test
MCP Usage
Build the server:
npm run build
Configure your MCP client to run:
node /absolute/path/to/jmeter-mcp-server/build/index.js
Or use a short command after linking the package locally:
npm link
jmeter-mcp-server
See docs/MCP_CLIENTS.md for Claude, Claude Code, VS Code/Copilot-style, Continue-style, and generic MCP client examples.
Use the high-level tool for deterministic generation:
create_test_plan_from_api_source
Prefer this high-level tool over step-by-step JMX edits. It validates inputs, applies load-profile policy, renders a complete plan, and validates the generated JMX.
Test Profiles
| Profile | Users | Ramp-up | Loops | Duration | Notes |
|---|---|---|---|---|---|
smoke |
1 | 1s | 1 | none | Minimal validation |
baseline |
5 | 5s | 1 | none | Safe default |
load |
10 | 30s | 3 | none | Moderate load |
spike |
25 | 1s | 1 | none | Requires allowAggressiveLoad=true |
stress |
50 | 60s | 5 | none | Requires allowAggressiveLoad=true |
soak |
5 | 60s | forever | 1800s | Requires allowAggressiveLoad=true |
custom |
required | optional | optional | optional | Fully explicit |
Deterministic profiles reject mismatched overrides. For example, testProfile=baseline with users=6 fails. Use testProfile=custom when you need custom values.
Guardrails
The generation path is intentionally constrained:
LLM request
-> MCP tool schema
-> Zod validation
-> deterministic profile policy
-> source parsing
-> normalized test plan model
-> JMX renderer
-> generated JMX validation
-> output file
The MCP rejects:
- missing
usersforcustomprofiles - deterministic profile overrides that do not match policy
- aggressive profiles without
allowAggressiveLoad=true - estimated request rates above a documented OpenAPI rate limit unless explicitly allowed
- malformed headers, placeholder hosts, unsupported protocols, and incomplete request body metadata
Generated JMX validation checks required JMeter components, thread settings, loop settings, duration settings, endpoint target, headers, variables, assertions, and result collectors.
Credentials And Variables
Do not commit .env.
Copy the example locally:
cp .env.example .env
Generated JMX files use JMeter properties and do not need secrets embedded:
${__P(API_KEY,)}
${__P(OAUTH_CLIENT_ID,)}
${__P(OAUTH_CLIENT_SECRET,)}
At runtime, pass values through JMeter properties or set JMETER_ENV_FILE:
JMETER_ENV_FILE=.env npm run jmeter:run -- jmeter/API_Test_Plan_4th_API.jmx results/local-run
Scripts
Build:
npm run build:all
Run guardrail tests:
npm test
Generate JMX suite from OpenAPI:
npm run generate:jmeter:suite -- openapi.yaml jmeter 5
Run one JMX:
npm run jmeter:run -- jmeter/API_Test_Plan_1st_API.jmx results/local-run
Run a suite:
npm run jmeter:suite -- jmeter results/suite
Generate a suite report from JTL files:
npm run jmeter:report -- results/suite/<run-directory>
Rate Limits And Public APIs
Do not run aggressive tests against public or third-party APIs unless the API owner explicitly allows it.
For public practice APIs, prefer smoke or baseline. Profiles such as spike, stress, and soak require explicit opt-in through allowAggressiveLoad=true.
Repository Hygiene
Ignored by default:
.env,.env.*.continue/,.vscode/node_modules/build/results/*.log*.jtl
Commit-worthy files are source, configuration, docs, workflows, OpenAPI examples, and intentional JMX examples.
Development
npm ci
npm run build:all
npm test
CI runs:
npm run ci
which performs a strict TypeScript build and guardrail tests.
Status
This project is suitable for early public adoption by SDETs who are comfortable with MCP, JMeter, and TypeScript. The core guardrails are deterministic and tested. Additional API source adapters such as Postman collections, HAR files, or GraphQL schemas can be added behind the existing adapter interfaces.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。