jmeter-mcp-server
A powerful MCP server for automated JMeter test generation and execution with Docker integration and comprehensive performance analysis.
README
π― JMeter MCP Server
A powerful Model Context Protocol (MCP) server for automated JMeter test generation and execution with Docker integration and comprehensive performance analysis.
π Overview
The JMeter MCP Server is a streamlined, production-ready testing solution that integrates with MCP-compatible clients (like Claude Desktop, VS Code) to generate sophisticated JMeter test plans and execute them automatically via Docker with comprehensive performance analysis.
π Key Features:
- 2 Essential Tools: Streamlined for maximum efficiency
- Complete Docker Automation: Zero manual intervention required
- Multi-Format Reports: HTML, Markdown, and JSON outputs
- Interactive Visualizations: Chart.js powered performance charts
- Professional Analysis: Trend detection and bottleneck identification
- API & UI Testing: Support for both API and web interface testing
- Real-time Execution: Containerized JMeter with live results
π οΈ Core Tools
1. π generate_jmeter_script - Advanced Test Generation
Create comprehensive JMeter test plans with modern features:
Features:
- Multi-threaded load simulation with configurable patterns
- CSV data parameterization for data-driven testing
- Response correlation and extraction (JSON Path, Regex)
- Multiple timer types and realistic load patterns
- Custom headers, authentication, and session management
- Response assertions and comprehensive validations
- Automatic file generation to
output/directory
Example:
{
"testName": "API Performance Test",
"baseUrl": "https://api.example.com",
"threadGroup": {
"numThreads": 50,
"rampUpTime": 120,
"loops": 10
},
"requests": [
{
"name": "Login",
"method": "POST",
"path": "/auth/login",
"headers": { "Content-Type": "application/json" },
"body": "{\"username\":\"${username}\",\"password\":\"${password}\"}",
"extractors": [
{
"variableName": "authToken",
"jsonPath": "$.token"
}
],
"assertions": [
{
"type": "responseCode",
"value": "200"
}
]
}
],
"csvDataSet": {
"fileName": "users.csv",
"variableNames": "username,password",
"delimiter": ","
}
}
2. π³ execute_jmeter_script - Docker Execution Engine
Automatically execute JMeter tests in a containerized environment with comprehensive analysis:
Features:
- Docker Automation: Uses
justb4/jmeter:latestfor consistent execution - Volume Mounting: Seamless data exchange between host and container
- Resource Management: Configurable CPU and memory limits
- Performance Analysis: Multi-dimensional performance metrics
- HTML Reports: Interactive dashboards with Chart.js visualizations
- Trend Analysis: Automatic bottleneck detection and recommendations
- Multiple Formats: HTML, Markdown, and JSON reports
Example:
{
"jmxFile": "API_Performance_Test.jmx",
"generateReports": true,
"resourceAnalysis": true,
"cpuLimit": "2",
"maxMemory": "2g"
}
π Performance Analysis Features
The execution engine provides comprehensive performance analysis:
π― Key Metrics
- Response time statistics (min, max, average, percentiles)
- Throughput analysis (requests/second, bytes/second)
- Error rate tracking and categorization
- Resource utilization monitoring
- Load pattern analysis
π Interactive Reports
- HTML Dashboard: Interactive charts with Chart.js
- Trend Analysis: Performance trends over time
- Bottleneck Detection: Automatic issue identification
- Recommendations: AI-powered optimization suggestions
- Raw Data: JTL files for custom analysis
π¨ Visualization Types
- Line charts for response times over time
- Bar charts for throughput metrics
- Pie charts for error distribution
- Histograms for response time distribution
β‘ Quick Start
π₯οΈ Installation
# Clone the repository
git clone https://github.com/chandanvars/jmeter-mcp-server.git
cd jmeter-mcp-server
# Install dependencies
npm install
# Start the MCP server
npm start
π³ Docker Requirements
Ensure Docker is installed and running on your system:
# Verify Docker installation
docker --version
docker pull justb4/jmeter:latest
π Basic Usage
Generate a JMeter Test:
# Using the MCP tool
generate_jmeter_script({
"testName": "API Load Test",
"baseUrl": "https://httpbin.org",
"requests": [
{
"name": "Get Request",
"method": "GET",
"path": "/get"
}
]
})
Execute the Test:
# Using the MCP tool
execute_jmeter_script({
"jmxFile": "API_Load_Test.jmx",
"generateReports": true
})
ποΈ Architecture
graph TB
subgraph "User Layer"
USER[π€ User]
CLAUDE[π€ Claude Desktop]
VSCODE[π VS Code]
API[π API Client]
end
subgraph "MCP Server"
SERVER[ποΈ MCP Server]
TOOL1[β‘ generate_jmeter_script]
TOOL2[π³ execute_jmeter_script]
HANDLER[π― JMeter Handler]
end
subgraph "Docker Engine"
DOCKER[π³ Docker]
JMETER[βοΈ JMeter Runtime]
VOLUMES[π Volume Mounts]
end
subgraph "Analysis Engine"
PARSER[π JTL Parser]
ANALYZER[π Stats Analyzer]
GENERATOR[π Report Generator]
end
subgraph "Report Outputs"
HTML[π HTML Report]
MD[π Markdown]
JSON[π JSON Data]
DASHBOARD[π JMeter Dashboard]
end
USER --> SERVER
SERVER --> TOOL1
SERVER --> TOOL2
TOOL2 --> DOCKER
DOCKER --> JMETER
JMETER --> PARSER
PARSER --> ANALYZER
ANALYZER --> GENERATOR
GENERATOR --> HTML
GENERATOR --> MD
GENERATOR --> JSON
JMETER --> DASHBOARD
π Project Structure
jmeter-mcp-server/
βββ π src/ # Source code
β βββ π index.js # MCP server entry point
β βββ π handlers/ # Request handlers
β β βββ π― jmeterHandler.js # Core JMeter logic
β βββ π utils/ # Utility functions
β βββ π fileWriter.js # File operations
β βββ π promptGenerator.js # Prompt utilities
βββ π output/ # Generated JMX files
βββ π sample_data/ # Test data files
βββ π jmeter-results/ # Test execution results
β βββ π performance-analysis.html
β βββ π performance-analysis.md
β βββ π performance-analysis.json
β βββ π reports/ # JMeter dashboards
βββ π³ docker-entrypoint.sh # Docker execution script
βββ π ARCHITECTURE.mermaid # System architecture
βββ π package.json # Project configuration
βββ π README.md # This file
π§ Configuration
Environment Variables
NODE_ENV=production # Environment mode
PORT=3000 # HTTP server port
DEBUG=true # Enable verbose logging
Docker Configuration
The server automatically configures Docker execution with:
- Image:
justb4/jmeter:latest - Volume Mounts: Automatic mapping of test files and results
- Resource Limits: Configurable CPU and memory allocation
- Network: Bridge networking for external API access
π Generated Reports
HTML Interactive Dashboard
- Real-time Charts: Response times, throughput, errors
- Interactive Navigation: Drill-down capabilities
- Performance Trends: Time-based analysis
- Export Options: PNG, CSV, PDF
Markdown Documentation
- Executive Summary: Key performance indicators
- Detailed Analysis: Comprehensive metrics breakdown
- Recommendations: Performance optimization suggestions
- Historical Comparison: Trend analysis over time
JSON Machine Data
- Raw Metrics: All performance data in JSON format
- API Integration: Easy integration with monitoring tools
- Custom Analysis: Data for custom reporting tools
- Automation: Machine-readable for CI/CD pipelines
π Advanced Examples
API Testing with Authentication
{
"testName": "Authenticated API Test",
"baseUrl": "https://api.github.com",
"threadGroup": {
"numThreads": 10,
"rampUpTime": 30,
"loops": 5
},
"requests": [
{
"name": "Get User Profile",
"method": "GET",
"path": "/user",
"headers": {
"Authorization": "Bearer ${token}",
"Accept": "application/vnd.github+json"
},
"assertions": [
{
"type": "responseCode",
"value": "200"
},
{
"type": "jsonPath",
"value": "$.login"
}
]
}
],
"csvDataSet": {
"fileName": "github_tokens.csv",
"variableNames": "token"
}
}
UI Testing Workflow
{
"testName": "E-commerce UI Flow",
"baseUrl": "https://demo.opencart.com",
"threadGroup": {
"numThreads": 5,
"rampUpTime": 60,
"loops": 3
},
"requests": [
{
"name": "Homepage",
"method": "GET",
"path": "/",
"assertions": [
{
"type": "containsText",
"value": "OpenCart"
}
]
},
{
"name": "Product Search",
"method": "GET",
"path": "/index.php?route=product/search&search=macbook",
"assertions": [
{
"type": "responseTime",
"value": "3000"
}
]
}
]
}
π§ Development
Setup for Development
# Clone and install
git clone https://github.com/chandanvars/jmeter-mcp-server.git
cd jmeter-mcp-server
npm install
# Run in development mode
npm run dev
# Run tests
npm test
Available Scripts
npm start # Start MCP server
npm run dev # Development mode with debugging
npm test # Run test suite
npm run clean # Clean output directories
π Examples & Documentation
- Basic Usage: Simple API testing examples
- Advanced Scenarios: Complex multi-step workflows
- Performance Testing: Load testing best practices
- UI Testing: Web application testing patterns
- Authentication: Various auth method examples
π€ Contributing
We welcome contributions! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π Support
For support and questions:
- π Report Issues
- π¬ Discussions
- π§ Email Support
πΊοΈ Roadmap
Current Version Features
- β Streamlined Architecture: 2 essential tools
- β Complete Docker Automation: Zero manual intervention
- β Multi-Format Reports: HTML, Markdown, JSON
- β Interactive Dashboards: Chart.js visualizations
- β Performance Analysis: Comprehensive metrics
- β Architecture Documentation: Mermaid diagrams
Future Enhancements
- [ ] WebSocket Testing: Real-time connection testing
- [ ] GraphQL Support: Native GraphQL test generation
- [ ] Database Testing: SQL performance testing
- [ ] Cloud Integration: AWS/Azure monitoring
- [ ] CI/CD Templates: Pipeline integration examples
- [ ] Mobile Testing: Mobile app performance testing
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Apache JMeter Team - For the incredible testing framework
- Model Context Protocol - For the communication standard
- Docker Community - For containerization technology
- Chart.js Team - For beautiful visualizations
- Testing Community - For feedback and contributions
π― Made with β€οΈ for the testing community by Chandan Varshney
Automated JMeter testing with Docker integration and professional performance analysis!
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.