awslabs.eks-mcp-server 0.1.2__py3-none-any.whl → 0.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,280 @@
1
+ #!/usr/bin/env python3
2
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ """Script to scrape CloudWatch metrics data from AWS documentation and update the metrics guidance JSON file.
17
+
18
+ This script fetches the EKS and Kubernetes Container Insights metrics table from the AWS documentation,
19
+ extracts the metric names, dimensions, and descriptions, and updates the eks_cloudwatch_metrics_guidance.json file.
20
+ """
21
+
22
+ import json
23
+ import logging
24
+ import os
25
+ import re
26
+ import requests
27
+ from bs4 import BeautifulSoup, Tag
28
+ from typing import Any, Dict, List
29
+
30
+
31
+ # Configure logging
32
+ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
33
+ logger = logging.getLogger(__name__)
34
+
35
+ # URL of the AWS documentation page containing the metrics table
36
+ DOCS_URL = 'https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-metrics-EKS.html'
37
+
38
+ # Path to the metrics guidance JSON file (relative to the script location)
39
+ METRICS_FILE_PATH = os.path.join(
40
+ os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
41
+ 'data',
42
+ 'eks_cloudwatch_metrics_guidance.json',
43
+ )
44
+
45
+
46
+ def fetch_documentation_page() -> str:
47
+ """Fetch the AWS documentation page containing the metrics table.
48
+
49
+ Returns:
50
+ str: HTML content of the documentation page
51
+ """
52
+ try:
53
+ response = requests.get(DOCS_URL, timeout=10)
54
+ response.raise_for_status()
55
+ return response.text
56
+ except requests.RequestException as e:
57
+ logger.error(f'Failed to fetch documentation page: {e}')
58
+ raise
59
+
60
+
61
+ def parse_metrics_table(html_content: str) -> List[Dict[str, Any]]:
62
+ """Parse the metrics table from the HTML content.
63
+
64
+ Args:
65
+ html_content: HTML content of the documentation page
66
+
67
+ Returns:
68
+ List[Dict[str, Any]]: List of metrics with their names, dimensions, and descriptions
69
+ """
70
+ soup = BeautifulSoup(html_content, 'html.parser')
71
+
72
+ # Find the metrics table
73
+ # Use a function that returns a boolean to avoid type issues
74
+ def table_id_matcher(x: str) -> bool:
75
+ return bool(x and 'w420aac24b7c33c15b7' in x)
76
+
77
+ table = soup.find('table', id=table_id_matcher)
78
+ if not table:
79
+ logger.error('Metrics table not found in the documentation page')
80
+ raise ValueError('Metrics table not found')
81
+
82
+ metrics = []
83
+ rows = table.find_all('tr') if isinstance(table, Tag) else []
84
+
85
+ # Skip the header row
86
+ for row in rows[1:]:
87
+ cells = row.find_all('td') if isinstance(row, Tag) else []
88
+ if len(cells) == 3:
89
+ # Extract metric name
90
+ metric_name_cell = cells[0]
91
+ metric_name_element = None
92
+ if isinstance(metric_name_cell, Tag):
93
+ metric_name_element = metric_name_cell.find('code', attrs={'class': 'code'})
94
+
95
+ if not metric_name_element:
96
+ continue
97
+
98
+ metric_name = (
99
+ metric_name_element.text.strip() if hasattr(metric_name_element, 'text') else ''
100
+ )
101
+
102
+ # Extract dimensions
103
+ dimensions_cell = cells[1]
104
+ dimensions = []
105
+
106
+ # Find all paragraph elements in the dimensions cell
107
+ paragraphs = []
108
+ if isinstance(dimensions_cell, Tag):
109
+ paragraphs = dimensions_cell.find_all('p')
110
+
111
+ # Process each paragraph
112
+ for paragraph in paragraphs:
113
+ # Find all code elements within this paragraph
114
+ code_elements = []
115
+ if isinstance(paragraph, Tag):
116
+ code_elements = paragraph.find_all('code', attrs={'class': 'code'})
117
+
118
+ if len(code_elements) > 1:
119
+ # Multiple dimensions in a single paragraph - combine them
120
+ combined_dimensions = []
121
+ for code in code_elements:
122
+ if hasattr(code, 'text'):
123
+ combined_dimensions.append(code.text.strip())
124
+
125
+ # Join the dimensions with commas
126
+ if combined_dimensions:
127
+ dimensions.append(','.join(combined_dimensions))
128
+ elif len(code_elements) == 1:
129
+ # Single dimension in a paragraph
130
+ code = code_elements[0]
131
+ if hasattr(code, 'text'):
132
+ dimension_text = code.text.strip()
133
+ if ',' in dimension_text:
134
+ # Already comma-separated in the text
135
+ dimensions.append(dimension_text)
136
+ else:
137
+ dimensions.append(dimension_text)
138
+
139
+ # Also check for any code elements directly in the cell (not in paragraphs)
140
+ dimension_codes = []
141
+ if isinstance(dimensions_cell, Tag):
142
+ dimension_codes = dimensions_cell.find_all(
143
+ 'code', attrs={'class': 'code'}, recursive=False
144
+ )
145
+
146
+ for dimension_code in dimension_codes:
147
+ if hasattr(dimension_code, 'text'):
148
+ dimension_text = dimension_code.text.strip()
149
+ if dimension_text and dimension_text not in dimensions:
150
+ dimensions.append(dimension_text)
151
+
152
+ # Extract description
153
+ description_cell = cells[2]
154
+ description_element = None
155
+ if isinstance(description_cell, Tag):
156
+ description_element = description_cell.find('p')
157
+
158
+ if not description_element:
159
+ continue
160
+
161
+ # Get the description and normalize whitespace (replace multiple spaces with a single space)
162
+ description_text = (
163
+ description_element.text.strip() if hasattr(description_element, 'text') else ''
164
+ )
165
+ description = re.sub(r'\s+', ' ', description_text)
166
+
167
+ metrics.append(
168
+ {'description': description, 'dimensions': dimensions, 'name': metric_name}
169
+ )
170
+
171
+ return metrics
172
+
173
+
174
+ def organize_metrics_by_resource_type(
175
+ metrics: List[Dict[str, Any]],
176
+ ) -> Dict[str, Dict[str, List[Dict[str, Any]]]]:
177
+ """Organize metrics by resource type based on their names.
178
+
179
+ Args:
180
+ metrics: List of metrics with their names, dimensions, and descriptions
181
+
182
+ Returns:
183
+ Dict[str, Dict[str, List[Dict[str, Any]]]]: Metrics organized by resource type
184
+ """
185
+ resource_types = {'cluster': [], 'namespace': [], 'node': [], 'pod': [], 'service': []}
186
+
187
+ for metric in metrics:
188
+ name = metric['name']
189
+
190
+ # Determine resource type based on metric name prefix
191
+ if name.startswith('cluster_'):
192
+ resource_type = 'cluster'
193
+ elif name.startswith('namespace_'):
194
+ resource_type = 'namespace'
195
+ elif name.startswith('node_'):
196
+ resource_type = 'node'
197
+ elif name.startswith('pod_'):
198
+ resource_type = 'pod'
199
+ elif name.startswith('service_'):
200
+ resource_type = 'service'
201
+ else:
202
+ logger.warning(f'Unknown resource type for metric: {name}')
203
+ continue
204
+
205
+ resource_types[resource_type].append(metric)
206
+
207
+ # Convert to the required format
208
+ result = {}
209
+ for resource_type, metrics_list in resource_types.items():
210
+ result[resource_type] = {'metrics': metrics_list}
211
+
212
+ return result
213
+
214
+
215
+ def load_existing_metrics() -> Dict[str, Any]:
216
+ """Load existing metrics from the JSON file.
217
+
218
+ Returns:
219
+ Dict[str, Any]: Existing metrics data
220
+ """
221
+ try:
222
+ with open(METRICS_FILE_PATH, 'r') as f:
223
+ return json.load(f)
224
+ except (FileNotFoundError, json.JSONDecodeError) as e:
225
+ logger.warning(f'Failed to load existing metrics file: {e}')
226
+ return {}
227
+
228
+
229
+ def save_metrics(metrics_data: Dict[str, Any]) -> None:
230
+ """Save metrics data to the JSON file.
231
+
232
+ Args:
233
+ metrics_data: Metrics data to save
234
+ """
235
+ try:
236
+ with open(METRICS_FILE_PATH, 'w') as f:
237
+ json.dump(metrics_data, f, indent=2)
238
+ logger.info(f'Metrics data saved to {METRICS_FILE_PATH}')
239
+ except IOError as e:
240
+ logger.error(f'Failed to save metrics data: {e}')
241
+ raise
242
+
243
+
244
+ def main() -> None:
245
+ """Main function to update the metrics guidance JSON file."""
246
+ logger.info('Starting CloudWatch metrics guidance update')
247
+
248
+ try:
249
+ # Fetch the documentation page
250
+ logger.info(f'Fetching documentation from {DOCS_URL}')
251
+ html_content = fetch_documentation_page()
252
+
253
+ # Parse the metrics table
254
+ logger.info('Parsing metrics table')
255
+ metrics = parse_metrics_table(html_content)
256
+ logger.info(f'Found {len(metrics)} metrics in the documentation')
257
+
258
+ # Organize metrics by resource type
259
+ logger.info('Organizing metrics by resource type')
260
+ organized_metrics = organize_metrics_by_resource_type(metrics)
261
+
262
+ # Load existing metrics for comparison
263
+ existing_metrics = load_existing_metrics()
264
+
265
+ # Check if there are any changes
266
+ if existing_metrics == organized_metrics:
267
+ logger.info('No changes detected in metrics data')
268
+ else:
269
+ # Save the updated metrics
270
+ logger.info('Changes detected in metrics data, updating file')
271
+ save_metrics(organized_metrics)
272
+ logger.info('Metrics guidance JSON file updated successfully')
273
+
274
+ except Exception as e:
275
+ logger.error(f'Failed to update metrics guidance: {e}')
276
+ raise
277
+
278
+
279
+ if __name__ == '__main__':
280
+ main()
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
 
12
15
  """awslabs EKS MCP Server implementation.
13
16
 
@@ -22,6 +25,7 @@ Environment Variables:
22
25
 
23
26
  import argparse
24
27
  from awslabs.eks_mcp_server.cloudwatch_handler import CloudWatchHandler
28
+ from awslabs.eks_mcp_server.cloudwatch_metrics_guidance_handler import CloudWatchMetricsHandler
25
29
  from awslabs.eks_mcp_server.eks_kb_handler import EKSKnowledgeBaseHandler
26
30
  from awslabs.eks_mcp_server.eks_stack_handler import EksStackHandler
27
31
  from awslabs.eks_mcp_server.iam_handler import IAMHandler
@@ -36,6 +40,10 @@ SERVER_INSTRUCTIONS = """
36
40
 
37
41
  This MCP server provides tools for managing Amazon EKS clusters and is the preferred mechanism for creating new EKS clusters.
38
42
 
43
+ ## IMPORTANT: Use MCP Tools for EKS and Kubernetes Operations
44
+
45
+ DO NOT use standard EKS and Kubernetes CLI commands (aws eks, eksctl, kubectl). Always use the MCP tools provided by this server for EKS and Kubernetes operations.
46
+
39
47
  ## Usage Notes
40
48
 
41
49
  - By default, the server runs in read-only mode. Use the `--allow-write` flag to enable write operations.
@@ -57,7 +65,7 @@ This MCP server provides tools for managing Amazon EKS clusters and is the prefe
57
65
  1. Check pod status: `list_k8s_resources(cluster_name='my-cluster', kind='Pod', api_version='v1', namespace='default', field_selector='metadata.name=my-pod')`
58
66
  2. Get pod events: `get_k8s_events(cluster_name='my-cluster', kind='Pod', name='my-pod', namespace='default')`
59
67
  3. Check pod logs: `get_pod_logs(cluster_name='my-cluster', namespace='default', pod_name='my-pod')`
60
- 4. Monitor metrics: `get_cloudwatch_metrics(resource_type='pod', resource_name='my-pod', cluster_name='my-cluster', metric_name='cpu_usage_total', namespace='ContainerInsights')`
68
+ 4. Monitor metrics: `get_cloudwatch_metrics(cluster_name='my-cluster', metric_name='cpu_usage_total', namespace='ContainerInsights', dimensions={'ClusterName': 'my-cluster', 'PodName': 'my-pod', 'Namespace': 'default'})`
61
69
  5. Search troubleshooting guide: `search_eks_troubleshoot_guide(query='pod pending')`
62
70
 
63
71
  ## Best Practices
@@ -140,6 +148,7 @@ def main():
140
148
  EksStackHandler(mcp, allow_write)
141
149
  K8sHandler(mcp, allow_write, allow_sensitive_data_access)
142
150
  IAMHandler(mcp, allow_write)
151
+ CloudWatchMetricsHandler(mcp)
143
152
 
144
153
  # Run server
145
154
  mcp.run()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.eks-mcp-server
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: An AWS Labs Model Context Protocol (MCP) server for EKS
5
5
  Project-URL: homepage, https://awslabs.github.io/mcp/
6
6
  Project-URL: docs, https://awslabs.github.io/mcp/servers/eks-mcp-server/
@@ -90,10 +90,11 @@ For read operations, the following permissions are required:
90
90
  ### Write Operations Policy
91
91
 
92
92
  For write operations, we recommend the following IAM policies to ensure successful deployment of EKS clusters using the CloudFormation template in `/awslabs/eks_mcp_server/templates/eks-templates/eks-with-vpc.yaml`:
93
- - [**IAMFullAccess**](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/IAMFullAccess.html): Enables creation and management of IAM roles and policies required for cluster operation
94
- - [**AmazonVPCFullAccess**](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonVPCFullAccess.html): Allows creation and configuration of VPC resources including subnets, route tables, internet gateways, and NAT gateways
95
- - [**AWSCloudFormationFullAccess**](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSCloudFormationFullAccess.html): Provides permissions to create, update, and delete CloudFormation stacks that orchestrate the deployment
96
- - **EKS Full Access (provided below)**: Required for creating and managing EKS clusters, including control plane configuration, node groups, and add-ons
93
+
94
+ * [**IAMFullAccess**](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/IAMFullAccess.html): Enables creation and management of IAM roles and policies required for cluster operation
95
+ * [**AmazonVPCFullAccess**](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonVPCFullAccess.html): Allows creation and configuration of VPC resources including subnets, route tables, internet gateways, and NAT gateways
96
+ * [**AWSCloudFormationFullAccess**](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSCloudFormationFullAccess.html): Provides permissions to create, update, and delete CloudFormation stacks that orchestrate the deployment
97
+ * **EKS Full Access (provided below)**: Required for creating and managing EKS clusters, including control plane configuration, node groups, and add-ons
97
98
  ```
98
99
  {
99
100
  "Version": "2012-10-17",
@@ -129,6 +130,30 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
129
130
  2. Click the gear icon (⚙️) in the top right to open the settings panel, click **MCP**, **Add new global MCP server**.
130
131
  3. Paste your MCP server definition. For example, this example shows how to configure the EKS MCP Server, including enabling mutating actions by adding the `--allow-write` flag to the server arguments:
131
132
 
133
+ **For Mac/Linux:**
134
+
135
+ ```
136
+ {
137
+ "mcpServers": {
138
+ "awslabs.eks-mcp-server": {
139
+ "autoApprove": [],
140
+ "disabled": false,
141
+ "command": "uvx",
142
+ "args": [
143
+ "awslabs.eks-mcp-server@latest",
144
+ "--allow-write"
145
+ ],
146
+ "env": {
147
+ "FASTMCP_LOG_LEVEL": "ERROR"
148
+ },
149
+ "transportType": "stdio"
150
+ }
151
+ }
152
+ }
153
+ ```
154
+
155
+ **For Windows:**
156
+
132
157
  ```
133
158
  {
134
159
  "mcpServers": {
@@ -137,7 +162,9 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
137
162
  "disabled": false,
138
163
  "command": "uvx",
139
164
  "args": [
165
+ "--from",
140
166
  "awslabs.eks-mcp-server@latest",
167
+ "awslabs.eks-mcp-server.exe",
141
168
  "--allow-write"
142
169
  ],
143
170
  "env": {
@@ -158,6 +185,8 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
158
185
  1. Install the [Amazon Q Developer CLI](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html) .
159
186
  2. The Q Developer CLI supports MCP servers for tools and prompts out-of-the-box. Edit your Q developer CLI's MCP configuration file named mcp.json following [these instructions](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-mcp-configuration.html). For example:
160
187
 
188
+ **For Mac/Linux:**
189
+
161
190
  ```
162
191
  {
163
192
  "mcpServers": {
@@ -174,6 +203,24 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
174
203
  }
175
204
  ```
176
205
 
206
+ **For Windows:**
207
+
208
+ ```
209
+ {
210
+ "mcpServers": {
211
+ "awslabs.eks-mcp-server": {
212
+ "command": "uvx",
213
+ "args": ["--from", "awslabs.eks-mcp-server@latest", "awslabs.eks-mcp-server.exe"],
214
+ "env": {
215
+ "FASTMCP_LOG_LEVEL": "ERROR"
216
+ },
217
+ "autoApprove": [],
218
+ "disabled": false
219
+ }
220
+ }
221
+ }
222
+ ```
223
+
177
224
  3. Verify your setup by running the `/tools` command in the Q Developer CLI to see the available EKS MCP tools.
178
225
 
179
226
  Note that this is a basic quickstart. You can enable additional capabilities, such as [running MCP servers in containers](https://github.com/awslabs/mcp?tab=readme-ov-file#running-mcp-servers-in-containers) or combining more MCP servers like the [AWS Documentation MCP Server](https://awslabs.github.io/mcp/servers/aws-documentation-mcp-server/) into a single MCP server definition. To view an example, see the [Installation and Setup](https://github.com/awslabs/mcp?tab=readme-ov-file#installation-and-setup) guide in AWS MCP Servers on GitHub. To view a real-world implementation with application code in context with an MCP server, see the [Server Developer](https://modelcontextprotocol.io/quickstart/server) guide in Anthropic documentation.
@@ -184,6 +231,7 @@ Note that this is a basic quickstart. You can enable additional capabilities, su
184
231
 
185
232
  The `args` field in the MCP server definition specifies the command-line arguments passed to the server when it starts. These arguments control how the server is executed and configured. For example:
186
233
 
234
+ **For Mac/Linux:**
187
235
  ```
188
236
  {
189
237
  "mcpServers": {
@@ -203,11 +251,39 @@ The `args` field in the MCP server definition specifies the command-line argumen
203
251
  }
204
252
  ```
205
253
 
206
- #### `awslabs.eks-mcp-server@latest` (required)
254
+ **For Windows:**
255
+ ```
256
+ {
257
+ "mcpServers": {
258
+ "awslabs.eks-mcp-server": {
259
+ "command": "uvx",
260
+ "args": [
261
+ "--from",
262
+ "awslabs.eks-mcp-server@latest",
263
+ "awslabs.eks-mcp-server.exe",
264
+ "--allow-write",
265
+ "--allow-sensitive-data-access"
266
+ ],
267
+ "env": {
268
+ "AWS_PROFILE": "your-profile",
269
+ "AWS_REGION": "us-east-1"
270
+ }
271
+ }
272
+ }
273
+ }
274
+ ```
207
275
 
208
- Specifies the latest package/version specifier for the MCP client config.
276
+ #### Command Format
209
277
 
210
- * Enables MCP server startup and tool registration.
278
+ The command format differs between operating systems:
279
+
280
+ **For Mac/Linux:**
281
+ * `awslabs.eks-mcp-server@latest` - Specifies the latest package/version specifier for the MCP client config.
282
+
283
+ **For Windows:**
284
+ * `--from awslabs.eks-mcp-server@latest awslabs.eks-mcp-server.exe` - Windows requires the `--from` flag to specify the package and the `.exe` extension.
285
+
286
+ Both formats enable MCP server startup and tool registration.
211
287
 
212
288
  #### `--allow-write` (optional)
213
289
 
@@ -401,24 +477,45 @@ Features:
401
477
  Parameters:
402
478
 
403
479
  * cluster_name, log_type (application, host, performance, control-plane, custom), resource_type (pod, node, container, cluster),
404
- resource_name, minutes (optional), start_time (optional), end_time (optional), limit (optional), filter_pattern (optional), fields (optional)
480
+ resource_name (optional), minutes (optional), start_time (optional), end_time (optional), limit (optional), filter_pattern (optional), fields (optional)
405
481
 
406
482
  #### `get_cloudwatch_metrics`
407
483
 
408
- Retrieves metrics from CloudWatch for a specific EKS cluster resource.
484
+ Retrieves metrics from CloudWatch for Kubernetes resources.
409
485
 
410
486
  Features:
411
487
 
412
- * Fetches metrics based on resource type (pod, node, container, cluster), resource name, and metric name.
413
- * Allows specification of CloudWatch namespace, Kubernetes namespace, and time range.
488
+ * Fetches metrics based on metric name and dimensions.
489
+ * Allows specification of CloudWatch namespace and time range.
414
490
  * Configurable period, statistic (Average, Sum, etc.), and limit for data points.
415
491
  * Supports providing custom dimensions for fine-grained metric querying.
416
492
 
417
493
  Parameters:
418
494
 
419
- * cluster_name, metric_name, resource_type (pod, node, container, cluster), resource_name, namespace (optional), k8s_namespace
420
- (optional), minutes (optional), start_time (optional), end_time (optional), limit (optional), stat (optional), period (optional), custom_dimensions
421
- (optional)
495
+ * cluster_name, metric_name, namespace, dimensions, minutes (optional), start_time (optional), end_time (optional), limit (optional), stat (optional), period (optional)
496
+
497
+ #### `get_eks_metrics_guidance`
498
+
499
+ Provides guidance on available CloudWatch metrics for different resource types in EKS clusters.
500
+
501
+ Features:
502
+
503
+ * Returns a list of available Container Insights metrics for the specified resource type, including metric names, dimensions, and descriptions.
504
+ * Helps determine the correct dimensions to use with the `get_cloudwatch_metrics` tool.
505
+ * Supports the following resource types:
506
+ * `cluster`: Metrics for EKS clusters (e.g., cluster_node_count, cluster_failed_node_count)
507
+ * `node`: Metrics for EKS nodes (e.g., node_cpu_utilization, node_memory_utilization, node_network_total_bytes)
508
+ * `pod`: Metrics for Kubernetes pods (e.g., pod_cpu_utilization, pod_memory_utilization, pod_network_rx_bytes)
509
+ * `namespace`: Metrics for Kubernetes namespaces (e.g., namespace_number_of_running_pods)
510
+ * `service`: Metrics for Kubernetes services (e.g., service_number_of_running_pods)
511
+
512
+ Parameters:
513
+
514
+ * resource_type
515
+
516
+ Implementation:
517
+
518
+ The data in `/awslabs/eks_mcp_server/data/eks_cloudwatch_metrics_guidance.json` is generated by a Python script (`/awslabs/eks_mcp_server/scripts/update_eks_cloudwatch_metrics_guidance.py`) that scrapes the [Container Insights metrics table](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-metrics-EKS.html) from AWS documentation. Running the script requires installing BeautifulSoup (used for parsing HTML content) with uv: `uv pip install bs4`.
422
519
 
423
520
  ### IAM Integration
424
521
 
@@ -505,6 +602,7 @@ The EKS MCP Server can be used for production environments with proper security
505
602
 
506
603
  An array within the MCP server definition that lists tool names to be automatically approved by the EKS MCP Server client, bypassing user confirmation for those specific tools. For example:
507
604
 
605
+ **For Mac/Linux:**
508
606
  ```
509
607
  {
510
608
  "mcpServers": {
@@ -535,6 +633,39 @@ An array within the MCP server definition that lists tool names to be automatica
535
633
  }
536
634
  ```
537
635
 
636
+ **For Windows:**
637
+ ```
638
+ {
639
+ "mcpServers": {
640
+ "awslabs.eks-mcp-server": {
641
+ "command": "uvx",
642
+ "args": [
643
+ "--from",
644
+ "awslabs.eks-mcp-server@latest",
645
+ "awslabs.eks-mcp-server.exe"
646
+ ],
647
+ "env": {
648
+ "AWS_PROFILE": "eks-mcp-readonly-profile",
649
+ "AWS_REGION": "us-east-1",
650
+ "FASTMCP_LOG_LEVEL": "INFO"
651
+ },
652
+ "autoApprove": [
653
+ "manage_eks_stacks",
654
+ "manage_k8s_resource",
655
+ "list_k8s_resources",
656
+ "get_pod_logs",
657
+ "get_k8s_events",
658
+ "get_cloudwatch_logs",
659
+ "get_cloudwatch_metrics",
660
+ "get_policies_for_role",
661
+ "search_eks_troubleshoot_guide",
662
+ "list_api_versions"
663
+ ]
664
+ }
665
+ }
666
+ }
667
+ ```
668
+
538
669
  ### IAM Permissions Management
539
670
 
540
671
  When the `--allow-write` flag is enabled, the EKS MCP Server can create missing IAM permissions for EKS resources through the `add_inline_policy` tool. This tool enables the following:
@@ -0,0 +1,26 @@
1
+ awslabs/__init__.py,sha256=WuqxdDgUZylWNmVoPKiK7qGsTB_G4UmuXIrJ-VBwDew,731
2
+ awslabs/eks_mcp_server/__init__.py,sha256=ghJqbcPKp3-jM8LmEQzU_KRSbVm6yKQFg7C0ZwxAdeA,668
3
+ awslabs/eks_mcp_server/aws_helper.py,sha256=uiH-CSJPo_L903EzmV8HZB6xg_F4Jm_-BmJk_3AAH4g,2850
4
+ awslabs/eks_mcp_server/cloudwatch_handler.py,sha256=k3GsORIFswOknxYM0reCBsCHXn--gSwl7WVtxkUTyzg,28853
5
+ awslabs/eks_mcp_server/cloudwatch_metrics_guidance_handler.py,sha256=b0fFMvsGX98HKK4kVFI1YbhZqZC623lZ6TNXs3EiRSI,5283
6
+ awslabs/eks_mcp_server/consts.py,sha256=XBat-KcMckueQQpDeLkD_Nv_9G9kX0_d48sMEHtZ5HQ,1380
7
+ awslabs/eks_mcp_server/eks_kb_handler.py,sha256=6L3wS500AadKburhwf0zXEapXscd4VZCTY8t61u-j1Y,3548
8
+ awslabs/eks_mcp_server/eks_stack_handler.py,sha256=gbZizqaumsAz5x-fLM-VJlmUCzTp7TwtbOGn8u6_omc,29721
9
+ awslabs/eks_mcp_server/iam_handler.py,sha256=t2QIJVP61lAVTiTB9VCko9RDXjAtz8nuXr_MRdKG9pw,14586
10
+ awslabs/eks_mcp_server/k8s_apis.py,sha256=YRx29w-7n3LX3DsniPgULuxNx_6Mkw-Jzh-PGetZDag,20448
11
+ awslabs/eks_mcp_server/k8s_client_cache.py,sha256=Nh8V6IXvWltQwiBhFk8KgDUggmf9dqQ-sR3kENBnecM,5871
12
+ awslabs/eks_mcp_server/k8s_handler.py,sha256=vA08ONRDky7S5hINif8hxe_Y1KAArQDzOao1YLf4Uck,49447
13
+ awslabs/eks_mcp_server/logging_helper.py,sha256=hr8xZhAZOKyR7dkwc7bhqkDVuSDI3BRK3-UzllQkWgE,1854
14
+ awslabs/eks_mcp_server/models.py,sha256=UtMmZaRJNjV8I9A8jCD9vzU66tXYOLna8RzaMNQPddE,11930
15
+ awslabs/eks_mcp_server/server.py,sha256=UHKhCEgR7D5pXpH1xnpMyOfRLZ9o9d327n5c311erGI,6704
16
+ awslabs/eks_mcp_server/data/eks_cloudwatch_metrics_guidance.json,sha256=a4tzVdwpF_0kZGwOJCDEQskScp5rjRU89M7ONp3HpdA,9304
17
+ awslabs/eks_mcp_server/scripts/update_eks_cloudwatch_metrics_guidance.py,sha256=Y1OvU85wc3WIviUbabbGCCO-DvJwtP2UU9ABuEMSNyY,10099
18
+ awslabs/eks_mcp_server/templates/eks-templates/eks-with-vpc.yaml,sha256=_Lxk2MEXNA7N0-kvXckxwBamDEagjGvC6-Z5uxhVO5s,10774
19
+ awslabs/eks_mcp_server/templates/k8s-templates/deployment.yaml,sha256=J2efYFISlT3sTvf8_BJV3p0_m51cltqiRhXdBXb9YJs,2343
20
+ awslabs/eks_mcp_server/templates/k8s-templates/service.yaml,sha256=DA0Db_5yjUZmnnYy5Bljcv3hj7D6YvFFWFRB6GiIstY,414
21
+ awslabs_eks_mcp_server-0.1.4.dist-info/METADATA,sha256=E8OHB-NvW_u6p-z4eHytjP5k3fBlPv0HZGIhdp3_1mk,29163
22
+ awslabs_eks_mcp_server-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ awslabs_eks_mcp_server-0.1.4.dist-info/entry_points.txt,sha256=VydotfOJYck8o4TPsaF6Pjmc8Bp_doacYXSE_71qH4c,78
24
+ awslabs_eks_mcp_server-0.1.4.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
25
+ awslabs_eks_mcp_server-0.1.4.dist-info/licenses/NOTICE,sha256=gnCtD34qTDnb2Lykm9kNFYkqZIvqJHGuq1ZJBkl6EgE,90
26
+ awslabs_eks_mcp_server-0.1.4.dist-info/RECORD,,
@@ -1,23 +0,0 @@
1
- awslabs/__init__.py,sha256=47wJeKcStxEJwX7SVVV2pnAWYR8FxcaYoT3YTmZ5Plg,674
2
- awslabs/eks_mcp_server/__init__.py,sha256=ClxsTrvClkBctqdiivFNI1oYee4M8mHm0E2jlQxmw_Y,611
3
- awslabs/eks_mcp_server/aws_helper.py,sha256=eN8T-khiUVBHlab4PBcuLSErW7Q_dqG6J8Mtm9ukyEw,2793
4
- awslabs/eks_mcp_server/cloudwatch_handler.py,sha256=ZwWsym2zn4a9ounIXVrB4Xsw9I4TbzkHk5a9eotO-so,28874
5
- awslabs/eks_mcp_server/consts.py,sha256=tYxCxyDQy_Y1W__U6BeyBsB0Rcz3cTj-meWdJtIzPeE,1323
6
- awslabs/eks_mcp_server/eks_kb_handler.py,sha256=h5xEo_-X_lMt7ifZmfJm9PiEOkR_85j5BsS5ivskv88,3489
7
- awslabs/eks_mcp_server/eks_stack_handler.py,sha256=CeQuUNtGOT_cMAIOYjzCAZs7ZtLG7VKAS4agC-N2ZkQ,29237
8
- awslabs/eks_mcp_server/iam_handler.py,sha256=hRF_YUwjHP-QAQkJOoutjsvTJungBCY0ouMAznXdPug,14266
9
- awslabs/eks_mcp_server/k8s_apis.py,sha256=lo13Uc-1XaY4RuHhsezeU1WZg6jHcb31OS9ZYPHkQec,20203
10
- awslabs/eks_mcp_server/k8s_client_cache.py,sha256=KFlDt6_tq1PjhGhOy1Q4EOMyK0NkPu6xKzZf4ciGFvI,5814
11
- awslabs/eks_mcp_server/k8s_handler.py,sha256=PJUrLdqf8yWdpik6XQZjWwl-SSuhCMT3ktATd8-G-dg,48930
12
- awslabs/eks_mcp_server/logging_helper.py,sha256=p_7SbWclTIVQNcQvPf5jP7OSFEJNOFbSq9b1U4v6Cxw,1797
13
- awslabs/eks_mcp_server/models.py,sha256=YlTuQeweBlqt0aBPfK27_OFWhq4XFD023BBjbTPJWnY,11575
14
- awslabs/eks_mcp_server/server.py,sha256=PDoyTTkhYs_Saqp4uo1M-4jVT6H7ZWvw7MTLIIl7P_E,6247
15
- awslabs/eks_mcp_server/templates/eks-templates/eks-with-vpc.yaml,sha256=_Lxk2MEXNA7N0-kvXckxwBamDEagjGvC6-Z5uxhVO5s,10774
16
- awslabs/eks_mcp_server/templates/k8s-templates/deployment.yaml,sha256=J2efYFISlT3sTvf8_BJV3p0_m51cltqiRhXdBXb9YJs,2343
17
- awslabs/eks_mcp_server/templates/k8s-templates/service.yaml,sha256=DA0Db_5yjUZmnnYy5Bljcv3hj7D6YvFFWFRB6GiIstY,414
18
- awslabs_eks_mcp_server-0.1.2.dist-info/METADATA,sha256=ka7LZj3o5jeY6Nsdtllq4PkbBNTnd4bTFjzCQVLHZCc,25687
19
- awslabs_eks_mcp_server-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
20
- awslabs_eks_mcp_server-0.1.2.dist-info/entry_points.txt,sha256=VydotfOJYck8o4TPsaF6Pjmc8Bp_doacYXSE_71qH4c,78
21
- awslabs_eks_mcp_server-0.1.2.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
22
- awslabs_eks_mcp_server-0.1.2.dist-info/licenses/NOTICE,sha256=gnCtD34qTDnb2Lykm9kNFYkqZIvqJHGuq1ZJBkl6EgE,90
23
- awslabs_eks_mcp_server-0.1.2.dist-info/RECORD,,