jmeter-mcp
Integrates Apache JMeter with AI assistants to run and manage load tests through natural language. It enables users to execute test plans, parse results, inspect test structures, and compare performance metrics across different runs.
README
jmeter-mcp
An MCP (Model Context Protocol) server that integrates Apache JMeter with AI assistants like Claude Code. Run load tests, parse results, inspect test plans, and compare performance — all through natural language.
Prerequisites
- Node.js >= 18
- Apache JMeter installed locally (download)
Installation
git clone https://github.com/chung-ta1/jmeter-mcp.git
cd jmeter-mcp
npm install
npm run build
Configuration
Set the JMETER_HOME environment variable to your JMeter installation path:
export JMETER_HOME=/usr/local/opt/jmeter
Or create a .env file in the project root (see .env.example):
JMETER_HOME=/usr/local/opt/jmeter
Usage
Adding to Claude Code
There are three ways to register this MCP server with Claude Code:
Option 1: CLI command (recommended)
claude mcp add jmeter -e JMETER_HOME=/usr/local/opt/jmeter -- node /absolute/path/to/jmeter-mcp/dist/index.js
This adds the server to your project-level config (.claude/mcp.json). To add it globally (available in all projects):
claude mcp add --scope user jmeter -e JMETER_HOME=/usr/local/opt/jmeter -- node /absolute/path/to/jmeter-mcp/dist/index.js
Option 2: Edit settings file manually
Add to ~/.claude.json (global) or .claude/mcp.json (project-level):
{
"mcpServers": {
"jmeter": {
"command": "node",
"args": ["/absolute/path/to/jmeter-mcp/dist/index.js"],
"env": {
"JMETER_HOME": "/usr/local/opt/jmeter"
}
}
}
}
Option 3: From within Claude Code
Run the /mcp slash command inside a Claude Code session, then follow the prompts to add a new stdio server.
Verify it works
After adding, restart Claude Code and run:
claude mcp list
You should see jmeter listed with status connected. Then ask Claude things like:
- "Run the load test at ~/tests/api-test.jmx with 50 threads"
- "Show me the results from /tmp/jmeter-results.jtl"
- "Compare the baseline and current test results"
- "List all test plans in my project"
- "Inspect the structure of my test plan"
Standalone
JMETER_HOME=/usr/local/opt/jmeter node dist/index.js
The server communicates over stdio using the MCP protocol.
MCP Tools
| Tool | Description |
|---|---|
run_test_plan |
Execute a .jmx test plan in non-GUI mode and return a results summary |
get_test_results |
Parse and summarize a .jtl or .csv results file |
list_test_plans |
Find all .jmx files in a directory (optionally recursive) |
inspect_test_plan |
Parse a .jmx file and return its structure (thread groups, samplers, assertions) |
compare_results |
Compare two result files and show performance metric differences |
Tool Examples
Run a test plan with custom parameters:
{
"tool": "run_test_plan",
"arguments": {
"testPlanPath": "/home/user/tests/api-load-test.jmx",
"threads": 100,
"duration": 60,
"rampUp": 10,
"properties": {
"server": "api.example.com",
"port": "8080"
}
}
}
Get detailed test results:
{
"tool": "get_test_results",
"arguments": {
"resultsPath": "/tmp/jmeter-results-1234567890.jtl",
"detailed": true
}
}
Compare two test runs:
{
"tool": "compare_results",
"arguments": {
"baselinePath": "/tmp/baseline-results.jtl",
"currentPath": "/tmp/current-results.jtl"
}
}
Tech Stack
| Library | Version | Purpose |
|---|---|---|
| TypeScript | ^5.7 | Language — strict mode, ES2022 target, ESM modules |
| @modelcontextprotocol/sdk | ^1.12 | MCP server SDK — McpServer high-level API with stdio transport |
| Zod | ^3.24 | Schema validation for MCP tool parameters |
| csv-parse | ^5.6 | Parse JMeter .jtl / .csv result files |
| fast-xml-parser | ^4.5 | Parse JMeter .jmx test plan XML files |
| dotenv | ^17.3 | Load environment variables from .env files |
| Vitest | ^4.0 | Test framework (dev dependency) |
Development
npm run dev # Watch mode — recompiles on changes
npm run build # One-time TypeScript compilation
npm test # Run all tests
npx vitest run src/test/services/JMeterService.test.ts # Run a single test file
Project Structure
src/
├── index.ts # Entry point: config → server → stdio transport
├── server.ts # McpServer creation + tool registration wiring
├── config.ts # Environment config loader (JMETER_HOME)
├── types/index.ts # Shared interfaces (JtlRecord, OverallStats, AppConfig)
├── tools/
│ ├── testPlan.ts # run_test_plan, list_test_plans, inspect_test_plan
│ └── results.ts # get_test_results, compare_results
├── services/
│ └── JMeterService.ts # Business logic: CLI execution, JTL/XML parsing
├── utils/
│ └── stats.ts # percentile(), diffPercent() helpers
└── test/
├── config.test.ts
└── services/
└── JMeterService.test.ts
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。