Analyze best practices with the managing-amazon-msk skill
The managing-amazon-msk skill is an open-source Agent Skill
Capabilities
The skill covers the following areas, each of which maps to best practices documented in this guide.
| Best practice area | What the skill helps you do | |
|---|---|---|
| 1 | Best practices for Standard brokers (Standard) | Assess partition counts per broker, recommend instance sizes, evaluate num.io.threads and num.network.threads tuning for m5.4xl+ and m7g.4xl+ instances |
| 2 | Best practices for Express brokers (Express) | Calculate required broker count based on per-broker throughput limits, recommend Express instance types for target ingress/egress, evaluate partition counts against Express quotas |
| 3 | Monitor CPU usage | Diagnose broker resource saturation, differentiate between broker-side and client-side root causes and misconfigurations, and determine when scaling is needed |
| 4 | Monitor disk space | Assess storage usage for Standard brokers, identify high-growth topics, recommend EBS expansion or retention adjustments. For Express, monitor storage utilization (storage is fully managed) for cost optimization |
| 5 | Connect to an Amazon MSK Provisioned cluster | Audit producer/consumer settings, configure authentication, tune for high availability and fault tolerance |
| 6 | Build highly available clusters | Verify high availability configurations and multi-AZ deployment for Standard brokers, and client failover configuration |
| 7 | Monitor an Amazon MSK Provisioned cluster | Create CloudWatch dashboards and alarms for key metrics critical to Amazon MSK observability and operations |
| 8 | Amazon MSK key features and concepts | Assess cluster readiness for updates, understand patching behavior between Standard and Express, understand broker restart impact on clients |
How it works
When you ask your AI coding agent a question about Amazon MSK — such as "Why is my MSK cluster CPU high?" or "Help me set up monitoring for my Express cluster" — the skill activates and provides the agent with:
-
Diagnostic workflows — Structured troubleshooting steps that check the most likely root causes first (for example, verifying
linger.msbefore recommending broker scaling for CPU issues). -
Broker-type-aware guidance — The skill determines whether your cluster uses Standard or Express brokers and applies the correct metrics, thresholds, and recommendations for that broker type.
-
AWS CLI commands — Ready-to-run commands for describing clusters, expanding storage, creating configurations, and querying CloudWatch metrics.
-
Best practice validation — Checks your cluster configuration against documented recommendations and flags deviations.
Installation
Option 1: AWS CLI
Requires AWS CLI version 2.35.0 or later.
# Interactive setup (installs default skills + configures AWS MCP Server) aws configure agent-toolkit # Or install the skill individually aws agent-toolkit add-skill --skill-name managing-amazon-msk
For full CLI documentation, see Managing skills with the AWS CLI.
Option 2: AWS MCP Server
Connect your AI coding agent to the AWS MCP Server, which provides the skill along with sandboxed AWS API execution capabilities.
{ "mcpServers": { "aws-mcp": { "command": "uvx", "args": [ "mcp-proxy-for-aws==1.6.2", "https://aws-mcp.us-east-1.api.aws/mcp", "--metadata", "AWS_REGION=us-east-1" ] } } }
For full setup instructions, see Setting up the AWS MCP Server.
Use cases and examples
Assess Standard broker best practices
Prompt: "I have an MSK Standard cluster using kafka.m5.2xlarge brokers with 2,500 partitions per broker. Am I following best practices?"
The skill:
-
Check your partition count against the recommended limit of 2,000 partitions per broker for m5.2xlarge.
-
Warn that you exceed the recommended count and are approaching the 3,000 maximum that supports update operations.
-
Recommend either reducing partitions or upgrading to m5.4xlarge (which supports 4,000 partitions per broker).
-
Check your
num.io.threadsandnum.network.threadssettings and recommend tuning if undersized.
Diagnose Express broker performance
Prompt: "My Express cluster has 3 express.m7g.large brokers and I'm seeing throttling. What's wrong?"
The skill:
-
Identify that
express.m7g.largesupports 15.6 MBps ingress and 31.2 MBps egress per broker. -
Ask about your current throughput or run a CloudWatch query to check
BytesInPerSecandBytesOutPerSec. -
If throughput exceeds per-broker limits, recommend scaling to
express.m7g.xlargeor adding brokers. -
Check
ProduceThrottleTimeandFetchThrottleTimemetrics.
Audit client configuration
Prompt: "Review my Kafka producer configuration for best practices on MSK"
The skill:
-
Check critical configurations such as
linger.ms,acks,batch.size,buffer.memory, and more for performance and durability considerations. -
Provide recommendations for your scenario to tune configurations, improve performance, and ensure high availability.
Set up monitoring and alarms
Prompt: "Help me set up CloudWatch monitoring for my MSK cluster following best practices"
The skill:
-
Create alarms for critical metrics like CPU utilization (
CpuUser + CpuSystem),RequestHandlerAvgIdlePercent, and others to monitor broker saturation. -
For Standard: add
KafkaDataLogsDiskUsed > 85%alarm andUnderReplicatedPartitions > 0alarm. -
For Express: add
StorageUsedmonitoring for cost optimization. -
Set up per-broker, per-topic, and per-consumer-group dashboards.
Source code and contributions
The managing-amazon-msk skill is open source. You can review the source code, suggest improvements, or contribute new features.
-
GitHub: aws/agent-toolkit-for-aws
on GitHub
Feedback on additional best practice scenarios, new use cases, or corrections is welcome via GitHub issues or pull requests.