Uses Helm for installing and managing Chaos Mesh deployment on Kubernetes clusters.
Provides AI-driven chaos engineering and resilience testing capabilities for Kubernetes clusters through Chaos Mesh, enabling creation and management of network disruptions, pod failures, I/O faults, stress tests, and other chaos experiments via natural language.
Chaos Mesh MCP Server
Model Context Protocol (MCP) server for Chaos Mesh chaos engineering operations.
This MCP server provides AI assistants like Claude with direct access to Chaos Mesh for automated chaos engineering and resilience testing. Create, manage, and validate chaos experiments through natural language conversations.
Features
Chaos Types (24 tools)
NetworkChaos (4 tools): Simulate network delays, packet loss, partitions, and corruption
StressChaos (3 tools): Apply CPU and memory stress to containers
PodChaos (3 tools): Kill pods, fail pods, or kill specific containers
IOChaos (4 tools): Inject I/O latency, faults, attribute changes, and data corruption
HTTPChaos (4 tools): Abort connections, inject delays, replace/patch HTTP content
DNSChaos (2 tools): Return DNS errors or random IPs for specified domains
PhysicalMachineChaos (5 tools): Inject chaos on physical/virtual machines (requires Chaosd)
Management & Validation (9 tools)
Environment Validation (3 tools): Check prerequisites, verify component status, get chaos-specific requirements
Experiment Management (6 tools): Query status, list experiments, delete, pause, resume, get events
Tested Environment
This package has been tested and verified with:
Chaos Mesh: v2.8.0
Kubernetes: v1.27+ (tested with v1.27.6)
kubectl: v1.27.6+
Python: 3.10, 3.11, 3.12
Prerequisites
Before using this MCP server, ensure you have:
kubectl installed and configured
Kubernetes cluster accessible via kubectl (v1.15+)
Chaos Mesh installed in the cluster (v2.6+ recommended)
Component-Specific Requirements
DNSChaos: Requires
chaos-dns-serverpod running in chaos-mesh namespacePhysicalMachineChaos: Requires Chaosd agent on target physical/virtual machines
Other chaos types: Only require standard Chaos Mesh components (controller-manager, daemon)
Tip: Use the validate_environment tool to check your setup!
Installation
Step 1: Install Chaos Mesh
If Chaos Mesh is not already installed on your cluster:
Step 2: Install MCP Server
Option 1: Install from GitHub (Recommended)
Option 2: Install from Source
Quick Start
1. Configure Claude Desktop
Edit ~/.config/claude/claude_desktop_config.json (Linux/Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
2. Restart Claude Desktop
Restart Claude Desktop to load the MCP server.
3. Validate Your Environment
In Claude Desktop, ask:
4. Start Using Chaos Engineering
Example conversations:
Architecture
Environment Validation
This MCP includes comprehensive environment validation:
Troubleshooting
DNSChaos Not Working
PhysicalMachineChaos Not Working
PhysicalMachineChaos requires Chaosd agent on target machines:
Setup Instructions
Install Chaosd on Target Machine (physical or virtual):
wget https://mirrors.chaos-mesh.org/chaosd-latest-linux-amd64.tar.gz tar -xzf chaosd-latest-linux-amd64.tar.gz sudo cp chaosd-latest-linux-amd64/chaosd /usr/local/bin/ sudo apt-get install -y stress-ng # Required for CPU/Memory stressStart Chaosd Server:
sudo chaosd server --port 31767Use the Correct Address Format (⚠️ Important):
# ✓ CORRECT - No protocol prefix await create_physical_stress_cpu( namespace="default", address=["192.168.1.100:31767"], # IP:PORT only duration="60s", workers=2, load=80 ) # ✗ WRONG - Including http:// causes HTTPS error await create_physical_stress_cpu( namespace="default", address=["http://192.168.1.100:31767"], # Don't do this! duration="60s" )
Important Notes
Address format: Use
IP:PORTorhostname:PORTwithouthttp://orhttps://prefixChaosd can run on localhost: The machine can inject chaos on itself
TLS: For production, configure Chaosd with HTTPS (optional for testing)
Clock action: Requires
pidparameter to target specific process
See: Chaosd Documentation
Permission Errors
Ensure your Kubernetes user has appropriate RBAC permissions:
Documentation
Based on Chaos Mesh official documentation:
Available Tools (33 total)
NetworkChaos (4 tools)
create_network_delay- Inject network latency to simulate slow connectionscreate_network_loss- Simulate packet loss for unreliable networkscreate_network_partition- Create network splits to test split-brain scenarioscreate_network_corrupt- Corrupt network packets to test data integrity
StressChaos (3 tools)
create_stress_cpu- Apply CPU load to test performance under stresscreate_stress_memory- Apply memory pressure to test OOM scenarioscreate_stress_combined- Apply both CPU and memory stress simultaneously
PodChaos (3 tools)
create_pod_kill- Kill pods to test recovery mechanismscreate_pod_failure- Make pods temporarily unavailable without killingcreate_container_kill- Kill specific containers within pods
IOChaos (4 tools)
create_io_latency- Inject I/O delays to simulate slow diskscreate_io_fault- Return error codes for file operations (ENOSPC, EIO, etc.)create_io_attr_override- Modify file attributes (permissions, size)create_io_mistake- Inject data corruption into read/write operations
HTTPChaos (4 tools)
create_http_abort- Abort HTTP connections to simulate network failurescreate_http_delay- Inject latency into HTTP requests/responsescreate_http_replace- Replace HTTP message content (headers, body)create_http_patch- Add content to HTTP messages
DNSChaos (2 tools)
create_dns_error- Return DNS errors for specified domain patternscreate_dns_random- Return random IP addresses for DNS queries
PhysicalMachineChaos (5 tools)
create_physical_stress_cpu- Inject CPU stress on physical/virtual machinescreate_physical_stress_memory- Inject memory stress on physical/virtual machinescreate_physical_disk_fill- Fill disk space on physical/virtual machinescreate_physical_process_kill- Kill processes on physical/virtual machinescreate_physical_clock_skew- Skew system clock on physical/virtual machines
Environment Validation (3 tools)
validate_environment- Comprehensive environment validation (kubectl, cluster, Chaos Mesh, CRDs, components)check_chaos_type_requirements- Check requirements for specific chaos typeget_chaos_requirements- Get detailed requirements for a chaos type
Experiment Management (6 tools)
get_experiment_status- Get detailed status of a chaos experimentlist_active_experiments- List all active experiments in clusterdelete_experiment- Delete a chaos experimentpause_experiment- Pause a running experimentresume_experiment- Resume a paused experimentget_experiment_events- Get Kubernetes events for debugging
License
MIT License - see LICENSE file for details.
Contributing
This is part of the chaos-agents project. Issues and pull requests are welcome!
Credits
Built on top of:
Chaos Mesh - Cloud-native chaos engineering platform
Model Context Protocol (MCP) - Protocol for AI model context management