Skip to main content
Glama

🚀 JMeter MCP 服务器

这是一个模型上下文协议 (MCP) 服务器,允许通过 MCP 兼容客户端执行 JMeter 测试。

[!重要] 📢 正在寻找 JMeter 中的 AI 助手?🚀 看看Feather Wand

人择光标风帆冲浪

📋 功能

  • 📊 以非 GUI 模式执行 JMeter 测试

  • 🖥️ 以 GUI 模式启动 JMeter

  • 📝 捕获并返回执行输出

Related MCP server: MCP Server

🛠️ 安装

本地安装

  1. 安装uv :

  2. 确保 JMeter 已安装在您的系统上并可通过命令行访问。

⚠️重要提示:请确保 JMeter 可执行。你可以运行以下命令来执行此操作:

chmod +x /path/to/jmeter/bin/jmeter
  1. 配置.env文件,具体参考.env.example文件。

# JMeter Configuration
JMETER_HOME=/path/to/apache-jmeter-5.6.3
JMETER_BIN=${JMETER_HOME}/bin/jmeter

# Optional: JMeter Java options
JMETER_JAVA_OPTS="-Xms1g -Xmx2g"

💻 MCP 使用

  1. 使用 MCP 兼容客户端(例如 Claude Desktop、Cursor、Windsurf)连接到服务器

  2. 向服务器发送提示:

Run JMeter test /path/to/test.jmx
  1. MCP 兼容客户端将使用可用的工具:

    • execute_jmeter_test :以 GUI 模式启动 JMeter,但不按照 JMeter 设计执行测试

    • execute_jmeter_test_non_gui :以非 GUI 模式执行 JMeter 测试(默认模式可获得更好的性能)

🏗️ MCP 配置

将以下配置添加到您的 MCP 客户端配置中:

{
    "mcpServers": {
      "jmeter": {
        "command": "/path/to/uv",
        "args": [
          "--directory",
          "/path/to/jmeter-mcp-server",
          "run",
          "jmeter_server.py"
        ]
      }
    }
}

✨ 用例

LLM 支持的结果分析:收集和分析测试结果。

调试:以非 GUI 模式执行测试进行调试。

🛑 错误处理

服务器将:

  • 验证测试文件是否存在

  • 检查文件是否具有 .jmx 扩展名

  • 捕获并返回任何执行错误

Available Tools

6 tools
analyze_jmeter_resultsC

Analyze JMeter test results and provide a summary of key metrics and insights.

Args: jtl_file: Path to the JTL file containing test results detailed: Whether to include detailed analysis (default: False)

Returns: str: Analysis results in a formatted string

Inputs: jtl_file (required), detailed. Returns: result

execute_jmeter_testB

Execute a JMeter test.

Args: test_file: Path to the JMeter test file (.jmx) gui_mode: Whether to run in GUI mode (default: False) properties: Dictionary of JMeter properties to pass with -J (default: None)

Inputs: test_file (required), gui_mode, properties. Returns: result

execute_jmeter_test_non_guiB

Execute a JMeter test in non-GUI mode - supports JMeter properties.

Args: test_file: Path to the JMeter test file (.jmx) properties: Dictionary of JMeter properties to pass with -J (default: None) generate_report: Whether to generate report dashboard after load test (default: False) report_output_dir: Output folder for report dashboard (default: None) log_file: Name of JTL file to log sample results to (default: None)

Inputs: test_file (required), generate_report, log_file, properties, +1 more. Returns: result

generate_visualizationC

Generate visualizations of JMeter test results.

Args: jtl_file: Path to the JTL file containing test results visualization_type: Type of visualization to generate (time_series, distribution, comparison, html_report) output_file: Path to save the visualization

Returns: str: Path to the generated visualization file

Inputs: jtl_file (required), output_file (required), visualization_type (required). Returns: result

get_performance_insightsC

Get insights and recommendations for improving performance based on JMeter test results.

Args: jtl_file: Path to the JTL file containing test results

Returns: str: Performance insights and recommendations in a formatted string

Inputs: jtl_file (required). Returns: result

identify_performance_bottlenecksB

Identify performance bottlenecks in JMeter test results.

Args: jtl_file: Path to the JTL file containing test results

Returns: str: Bottleneck analysis results in a formatted string

Inputs: jtl_file (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 6 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between analyze_jmeter_results, get_performance_insights, and identify_performance_bottlenecks, as all three analyze JTL files and provide insights. However, their descriptions differentiate them enough to avoid major confusion.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with clear verb_noun structure, such as analyze_jmeter_results and execute_jmeter_test. The naming is uniform and predictable throughout the set.

    Tool Count5/5

    With 6 tools, the count is well-scoped for a JMeter server, covering key operations like test execution, result analysis, and visualization. Each tool serves a clear purpose without redundancy.

    Completeness4/5

    The toolset covers core JMeter workflows including test execution, result analysis, and visualization, but lacks tools for test creation or modification. This minor gap does not severely hinder typical agent tasks.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers