Chaos Mesh MCP Server
An MCP server that enables AI agents to perform chaos engineering through Chaos Mesh on EKS clusters.
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ AI Agent │───▶│ MCP Server │───▶│ EKS Cluster │
│ │ │ │ │ │
│ - Failure │ │ - OIDC Auth │ │ - Chaos Mesh │
│ Scenarios │ │ - K8s API Calls │ │ - Workloads │
│ - Experiment │ │ - Experiment │ │ - Monitoring │
│ Planning │ │ Management │ │ - Resource Info │
│ - Result │ │ - Resource Query │ │ │
│ Analysis │ │ │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
Key Features
1. Authentication and Authorization Management
- OIDC-based EKS cluster authentication
- RBAC permission validation
- Token renewal and management
2. Chaos Mesh Experiment Management
- Experiment creation and execution
- Experiment status monitoring
- Experiment termination and cleanup
3. Chaos Engineering Tools
- Pod failure injection
- Network failure simulation
- Storage failure testing
- Time and stress testing
4. EKS Cluster Resource Management
- Node information retrieval
- Namespace listing and details
- Deployment status monitoring
- Service discovery
- Pod status and health checks
- Cluster summary information
Available MCP Tools
Cluster Management
add_remote_cluster- Add EKS cluster to managementlist_remote_clusters- List all managed clustersinstall_chaos_mesh- Install Chaos Mesh on cluster
Resource Information
get_cluster_nodes- Get detailed node informationget_cluster_namespaces- Get namespace informationget_cluster_deployments- Get deployment status (all or specific namespace)get_cluster_services- Get service information (all or specific namespace)get_cluster_pods- Get pod information (all or specific namespace)get_cluster_resource_summary- Get cluster resource overview and summary
Chaos Experiments
create_pod_chaos_experiment- Create pod failure experimentscreate_network_chaos_experiment- Create network failure experimentscreate_stress_chaos_experiment- Create stress testing experimentscreate_io_chaos_experiment- Create I/O failure experimentscreate_dns_chaos_experiment- Create DNS failure experimentscreate_time_chaos_experiment- Create time manipulation experiments
Installation and Setup
- Install Chaos Mesh on EKS cluster
- Configure OIDC provider
- Set up RBAC permissions
- Deploy MCP server
Security Considerations
- Apply principle of least privilege
- Limit experiment scope
- Record audit logs
- Implement safety mechanisms
Usage
Before setting the cluster, you should add IAM Role to cluster RBAC group to access your cluster with system:managers permission. You can add it with Kubernets RBAC configuration You also add a mapping between an IAM role to a Kubernetes user and groups. With AWS CDK, see Masters Role and addRoleMapping
You can initialize your cluster with env or manually add with add_remote_cluter tool.
*.json file
{
"mcpServers": {
"sequential-thinking": {
"command": "uvx",
"args": ["chaos-mesh-mcp-server@latest"],
"env": {
"CLUSTERS_CONFIG": "{my-cluster-name}:{my-cluster-region},{my-cluster-2-name}:{my-cluster-2-region}"
"AWS_ACCESS_KEY": "KEY",
"AWS_SECRET_ID": "SECRET",
}
}
}
}
Strands Agent SDK
chaos_mesh_mcp_client = MCPClient(
lambda: stdio_client(
StdioServerParameters(
command="uvx",
args=["chaos-mesh-mcp-server@latest"],
env={
"CLUSTERS_CONFIG": "{my-cluster-name}:{my-cluster-region},{my-cluster-2-name}:{my-cluster-2-region}",
"AWS_ACCESS_KEY": "KEY",
"AWS_SECRET_ID": "SECRET",
},
)
)
)
chaos_mesh_mcp_client.start()
agent = Agent(
model,
system_prompt,
tools=[chaos_mesh_mcp_client.list_tools_sync()],
)
Example Usage
Get Cluster Information
# Get cluster summary
cluster_summary = await get_cluster_resource_summary("my-cluster")
# Get specific resource information
nodes = await get_cluster_nodes("my-cluster")
namespaces = await get_cluster_namespaces("my-cluster")
deployments = await get_cluster_deployments("my-cluster", "default")
Create Chaos Experiments
# Create pod chaos experiment
result = await create_pod_chaos_experiment(
cluster_name="my-cluster",
namespace="default",
target_app="my-app",
action="pod-kill",
duration="30s"
)
Metadata
Release files for chaos-mesh-mcp-server 6.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chaos_mesh_mcp_server-6.2.0.tar.gz | 43.8 kB | Without provenance | Details for chaos_mesh_mcp_server-6.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chaos_mesh_mcp_server-6.2.0-py3-none-any.whl | Python 3 | none | any | Details for chaos_mesh_mcp_server-6.2.0-py3-none-any.whl |
Total release size: 95.6 kB
Release files / chaos_mesh_mcp_server-6.2.0.tar.gz
| Download URL | chaos_mesh_mcp_server-6.2.0.tar.gz |
|---|---|
| Size | 43.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c03a408c0cc61b6742ea264c83d9ae7914e32a2926e224c1ff4a92e5723318b
|
|
BLAKE2b-256 checksum How to use checksums |
cefc607e4647bc6d37900db024a617934181187b5e7b5b333bd32b8ab505dc43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.4
|
Release files / chaos_mesh_mcp_server-6.2.0-py3-none-any.whl
| Download URL | chaos_mesh_mcp_server-6.2.0-py3-none-any.whl |
|---|---|
| Size | 51.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c45b86467275049fc09fae8fb683826e8945c410ba3aa6fbeaa7b2c6ec2f2e8d
|
|
BLAKE2b-256 checksum How to use checksums |
9dbc261eea043a07b25c361e93697246cb74ac543ac6b2824481df9d3d49a929
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.4
|
Security for chaos-mesh-mcp-server 6.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.