npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chenyingxian/jmeter-mcp

v1.0.2

Published

JMeter MCP(stdio):根据接口文档描述生成和维护 JMeter HTTP 请求组件与场景线程组

Readme

JMeter MCP

English

文档导航:配置说明 | 工具说明 | Configuration | Tools

JMeter MCP 是一个基于 stdio 的 MCP Server,用于根据结构化接口信息生成和维护 JMeter .jmx 中的 HTTP 请求组件。

它适用于 Codex、Cursor 以及其他支持 MCP 的 AI 客户端。AI 只需要提供项目名、接口路径、HTTP 方法、参数名列表以及是否需要签名;MCP 会根据项目配置自动完成 JMX 写入、请求体生成和 JMeter 运行时签名。

功能特性

  • 生成 GenericControllerHTTPSamplerProxy XML 片段。
  • 在配置的 JMeter 线程组中新增或更新基础请求组件。
  • 查询和列出现有可复用请求组件。
  • 基于基础组件生成场景线程组。
  • 根据参数名生成 JSON Raw Body 或 form-data 请求参数。
  • 使用 JMeter 内置 __digest 在运行时计算签名字段。

安装与接入

在 MCP 客户端中可以直接通过 npm 包启动:

{
  "mcpServers": {
    "jmeter-mcp": {
      "command": "npx",
      "args": ["-y", "@chenyingxian/jmeter-mcp"],
      "env": {
        "JMETER_MCP_CONFIG_PATH": "D:\\jmeter\\jmeter-mcp.config.json"
      }
    }
  }
}

本地开发命令:

npm install
npm run build
npm start

项目配置

创建一个 JSON 配置文件,并通过 JMETER_MCP_CONFIG_PATH 指向它。

{
  "projects": {
    "example-api-project": {
      "jmx_dir": "D:\\jmeter\\plans",
      "jmx_file": "example-api-project.jmx",
      "sign_algorithm": "key_equals_value",
      "body_type": "json",
      "thread_group_testname": "基础请求组件",
      "scenario_thread_group_testname": "场景测试"
    }
  }
}

支持的 sign_algorithm

  • key_equals_value:签名源字符串按 key=value 拼接。
  • key_value:签名源字符串按 keyvalue 拼接。

支持的 body_type

  • json:根据 parameter_names 生成 Raw JSON 请求体。
  • form_data:根据 parameter_names 生成 JMeter 表单参数。

常用工具

  • jmeter_list_project_config:检查当前加载的项目配置。
  • jmeter_list_basic_request_components:列出可复用的基础请求组件。
  • jmeter_query_basic_request_component:检查指定组件是否已经存在。
  • jmeter_generate_controller_fragment:只生成 XML,不写入 JMX 文件。
  • jmeter_upsert_basic_request_component:新增或替换基础请求组件。
  • jmeter_upsert_scenario_thread_group:创建或更新单个场景控制器。
  • jmeter_upsert_scenario_suite_thread_group:创建或更新场景套件线程组。

请求示例

{
  "project": "example-api-project",
  "match_by": "api_path",
  "match_value": "/api/example",
  "controller_name": "Example API",
  "need_sign": true,
  "doc_url": "https://docs.example.com/api/example",
  "steps": [
    {
      "http_sampler": {
        "testname": "Example API",
        "method": "POST",
        "path": "/api/example",
        "parameter_names": ["deviceId", "channel"]
      }
    }
  ]
}

注意事项

  • 不要传真实参数值,只传参数名或 JSON 路径。
  • 不要在 parameter_names 中传 signsecret_key
  • 协议、域名、端口、签名密钥建议放在 JMeter 变量或项目级 JMeter 配置中。
  • 详细配置见 CONFIG.zh-CN.md,完整工具行为见 MCP_TOOLS.zh-CN.md