awslabs.eks-mcp-server 0.1.1__tar.gz → 0.1.3__tar.gz

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.
Files changed (49) hide show
  1. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/Dockerfile +11 -8
  2. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/PKG-INFO +170 -34
  3. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/README.md +169 -33
  4. awslabs_eks_mcp_server-0.1.3/awslabs/__init__.py +16 -0
  5. awslabs_eks_mcp_server-0.1.3/awslabs/eks_mcp_server/__init__.py +17 -0
  6. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/aws_helper.py +12 -8
  7. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/cloudwatch_handler.py +75 -77
  8. awslabs_eks_mcp_server-0.1.3/awslabs/eks_mcp_server/cloudwatch_metrics_guidance_handler.py +141 -0
  9. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/consts.py +9 -6
  10. awslabs_eks_mcp_server-0.1.3/awslabs/eks_mcp_server/data/eks_cloudwatch_metrics_guidance.json +287 -0
  11. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/eks_kb_handler.py +9 -6
  12. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/eks_stack_handler.py +38 -8
  13. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/iam_handler.py +14 -6
  14. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/k8s_apis.py +25 -14
  15. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/k8s_client_cache.py +9 -6
  16. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/k8s_handler.py +55 -6
  17. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/logging_helper.py +9 -6
  18. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/models.py +24 -10
  19. awslabs_eks_mcp_server-0.1.3/awslabs/eks_mcp_server/scripts/update_eks_cloudwatch_metrics_guidance.py +280 -0
  20. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/server.py +16 -7
  21. awslabs_eks_mcp_server-0.1.3/docker-healthcheck.sh +26 -0
  22. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/pyproject.toml +1 -1
  23. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_aws_helper.py +14 -9
  24. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_cloudwatch_handler.py +473 -177
  25. awslabs_eks_mcp_server-0.1.3/tests/test_cloudwatch_metrics_guidance_handler.py +135 -0
  26. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_eks_kb_handler.py +9 -6
  27. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_eks_stack_handler.py +89 -6
  28. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_iam_handler.py +9 -6
  29. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_init.py +9 -6
  30. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_k8s_apis.py +69 -66
  31. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_k8s_client_cache.py +9 -6
  32. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_k8s_handler.py +188 -71
  33. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_logging_helper.py +9 -6
  34. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_main.py +9 -6
  35. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_models.py +9 -6
  36. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/tests/test_server.py +9 -6
  37. awslabs_eks_mcp_server-0.1.1/awslabs/__init__.py +0 -13
  38. awslabs_eks_mcp_server-0.1.1/awslabs/eks_mcp_server/__init__.py +0 -14
  39. awslabs_eks_mcp_server-0.1.1/docker-healthcheck.sh +0 -12
  40. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/.gitignore +0 -0
  41. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/.pre-commit-config.yaml +0 -0
  42. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/.python-version +0 -0
  43. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/CHANGELOG.md +0 -0
  44. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/LICENSE +0 -0
  45. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/NOTICE +0 -0
  46. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/templates/eks-templates/eks-with-vpc.yaml +0 -0
  47. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/templates/k8s-templates/deployment.yaml +0 -0
  48. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/awslabs/eks_mcp_server/templates/k8s-templates/service.yaml +0 -0
  49. {awslabs_eks_mcp_server-0.1.1 → awslabs_eks_mcp_server-0.1.3}/uv.lock +0 -0
@@ -1,15 +1,18 @@
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
- FROM public.ecr.aws/sam/build-python3.10@sha256:a40f492a0cd8d76557f8a187fc00e49e8864b3cea683e74718ce317790c1ce61 AS uv
15
+ FROM public.ecr.aws/sam/build-python3.10@sha256:e78695db10ca8cb129e59e30f7dc9789b0dbd0181dba195d68419c72bac51ac1 AS uv
13
16
 
14
17
  # Install the project into `/app`
15
18
  WORKDIR /app
@@ -43,7 +46,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
43
46
  # Make the directory just in case it doesn't exist
44
47
  RUN mkdir -p /root/.local
45
48
 
46
- FROM public.ecr.aws/sam/build-python3.10@sha256:a40f492a0cd8d76557f8a187fc00e49e8864b3cea683e74718ce317790c1ce61
49
+ FROM public.ecr.aws/sam/build-python3.10@sha256:e78695db10ca8cb129e59e30f7dc9789b0dbd0181dba195d68419c72bac51ac1
47
50
 
48
51
  # Place executables in the environment at the front of the path and include other binaries
49
52
  ENV PATH="/app/.venv/bin:$PATH:/usr/sbin"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.eks-mcp-server
3
- Version: 0.1.1
3
+ Version: 0.1.3
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/
@@ -89,30 +89,36 @@ For read operations, the following permissions are required:
89
89
 
90
90
  ### Write Operations Policy
91
91
 
92
- For write operations, the following permissions are required:
93
-
94
- ```
95
- {
96
- "Version": "2012-10-17",
97
- "Statement": [
98
- {
99
- "Effect": "Allow",
100
- "Action": [
101
- "cloudformation:CreateStack",
102
- "cloudformation:UpdateStack",
103
- "cloudformation:DeleteStack",
104
- "iam:PutRolePolicy"
105
- ],
106
- "Resource": "*",
107
- "Condition": {
108
- "StringEquals": {
109
- "aws:RequestTag/CreatedBy": "EksMcpServer"
110
- }
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
+
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
98
+ ```
99
+ {
100
+ "Version": "2012-10-17",
101
+ "Statement": [
102
+ {
103
+ "Effect": "Allow",
104
+ "Action": "eks:*",
105
+ "Resource": "*"
111
106
  }
112
- }
113
- ]
114
- }
115
- ```
107
+ ]
108
+ }
109
+ ```
110
+
111
+
112
+ **Important Security Note**: Users should exercise caution when `--allow-write` and `--allow-sensitive-data-access` modes are enabled with these broad permissions, as this combination grants significant privileges to the MCP server. Only enable these flags when necessary and in trusted environments. For production use, consider creating more restrictive custom policies.
113
+
114
+ ### Kubernetes API Access Requirements
115
+
116
+ All Kubernetes API operations will only work when one of the following conditions is met:
117
+
118
+ 1. The user's principal (IAM role/user) actually created the EKS cluster being accessed
119
+ 2. An EKS Access Entry has been configured for the user's principal
120
+
121
+ If you encounter authorization errors when using Kubernetes API operations, verify that an access entry has been properly configured for your principal.
116
122
 
117
123
  ## Quickstart
118
124
 
@@ -124,6 +130,30 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
124
130
  2. Click the gear icon (⚙️) in the top right to open the settings panel, click **MCP**, **Add new global MCP server**.
125
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:
126
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
+
127
157
  ```
128
158
  {
129
159
  "mcpServers": {
@@ -132,7 +162,9 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
132
162
  "disabled": false,
133
163
  "command": "uvx",
134
164
  "args": [
165
+ "--from",
135
166
  "awslabs.eks-mcp-server@latest",
167
+ "awslabs.eks-mcp-server.exe",
136
168
  "--allow-write"
137
169
  ],
138
170
  "env": {
@@ -153,6 +185,8 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
153
185
  1. Install the [Amazon Q Developer CLI](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html) .
154
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:
155
187
 
188
+ **For Mac/Linux:**
189
+
156
190
  ```
157
191
  {
158
192
  "mcpServers": {
@@ -169,6 +203,24 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
169
203
  }
170
204
  ```
171
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
+
172
224
  3. Verify your setup by running the `/tools` command in the Q Developer CLI to see the available EKS MCP tools.
173
225
 
174
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.
@@ -179,13 +231,36 @@ Note that this is a basic quickstart. You can enable additional capabilities, su
179
231
 
180
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:
181
233
 
234
+ **For Mac/Linux:**
235
+ ```
236
+ {
237
+ "mcpServers": {
238
+ "awslabs.eks-mcp-server": {
239
+ "command": "uvx",
240
+ "args": [
241
+ "awslabs.eks-mcp-server@latest",
242
+ "--allow-write",
243
+ "--allow-sensitive-data-access"
244
+ ],
245
+ "env": {
246
+ "AWS_PROFILE": "your-profile",
247
+ "AWS_REGION": "us-east-1"
248
+ }
249
+ }
250
+ }
251
+ }
252
+ ```
253
+
254
+ **For Windows:**
182
255
  ```
183
256
  {
184
257
  "mcpServers": {
185
258
  "awslabs.eks-mcp-server": {
186
259
  "command": "uvx",
187
260
  "args": [
261
+ "--from",
188
262
  "awslabs.eks-mcp-server@latest",
263
+ "awslabs.eks-mcp-server.exe",
189
264
  "--allow-write",
190
265
  "--allow-sensitive-data-access"
191
266
  ],
@@ -198,11 +273,17 @@ The `args` field in the MCP server definition specifies the command-line argumen
198
273
  }
199
274
  ```
200
275
 
201
- #### `awslabs.eks-mcp-server@latest` (required)
276
+ #### Command Format
277
+
278
+ The command format differs between operating systems:
202
279
 
203
- Specifies the latest package/version specifier for the MCP client config.
280
+ **For Mac/Linux:**
281
+ * `awslabs.eks-mcp-server@latest` - Specifies the latest package/version specifier for the MCP client config.
204
282
 
205
- * Enables MCP server startup and tool registration.
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.
206
287
 
207
288
  #### `--allow-write` (optional)
208
289
 
@@ -396,24 +477,45 @@ Features:
396
477
  Parameters:
397
478
 
398
479
  * cluster_name, log_type (application, host, performance, control-plane, custom), resource_type (pod, node, container, cluster),
399
- 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)
400
481
 
401
482
  #### `get_cloudwatch_metrics`
402
483
 
403
- Retrieves metrics from CloudWatch for a specific EKS cluster resource.
484
+ Retrieves metrics from CloudWatch for Kubernetes resources.
404
485
 
405
486
  Features:
406
487
 
407
- * Fetches metrics based on resource type (pod, node, container, cluster), resource name, and metric name.
408
- * 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.
409
490
  * Configurable period, statistic (Average, Sum, etc.), and limit for data points.
410
491
  * Supports providing custom dimensions for fine-grained metric querying.
411
492
 
412
493
  Parameters:
413
494
 
414
- * cluster_name, metric_name, resource_type (pod, node, container, cluster), resource_name, namespace (optional), k8s_namespace
415
- (optional), minutes (optional), start_time (optional), end_time (optional), limit (optional), stat (optional), period (optional), custom_dimensions
416
- (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`.
417
519
 
418
520
  ### IAM Integration
419
521
 
@@ -500,6 +602,7 @@ The EKS MCP Server can be used for production environments with proper security
500
602
 
501
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:
502
604
 
605
+ **For Mac/Linux:**
503
606
  ```
504
607
  {
505
608
  "mcpServers": {
@@ -530,6 +633,39 @@ An array within the MCP server definition that lists tool names to be automatica
530
633
  }
531
634
  ```
532
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
+
533
669
  ### IAM Permissions Management
534
670
 
535
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:
@@ -55,30 +55,36 @@ For read operations, the following permissions are required:
55
55
 
56
56
  ### Write Operations Policy
57
57
 
58
- For write operations, the following permissions are required:
59
-
60
- ```
61
- {
62
- "Version": "2012-10-17",
63
- "Statement": [
64
- {
65
- "Effect": "Allow",
66
- "Action": [
67
- "cloudformation:CreateStack",
68
- "cloudformation:UpdateStack",
69
- "cloudformation:DeleteStack",
70
- "iam:PutRolePolicy"
71
- ],
72
- "Resource": "*",
73
- "Condition": {
74
- "StringEquals": {
75
- "aws:RequestTag/CreatedBy": "EksMcpServer"
76
- }
58
+ 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`:
59
+
60
+ * [**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
61
+ * [**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
62
+ * [**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
63
+ * **EKS Full Access (provided below)**: Required for creating and managing EKS clusters, including control plane configuration, node groups, and add-ons
64
+ ```
65
+ {
66
+ "Version": "2012-10-17",
67
+ "Statement": [
68
+ {
69
+ "Effect": "Allow",
70
+ "Action": "eks:*",
71
+ "Resource": "*"
77
72
  }
78
- }
79
- ]
80
- }
81
- ```
73
+ ]
74
+ }
75
+ ```
76
+
77
+
78
+ **Important Security Note**: Users should exercise caution when `--allow-write` and `--allow-sensitive-data-access` modes are enabled with these broad permissions, as this combination grants significant privileges to the MCP server. Only enable these flags when necessary and in trusted environments. For production use, consider creating more restrictive custom policies.
79
+
80
+ ### Kubernetes API Access Requirements
81
+
82
+ All Kubernetes API operations will only work when one of the following conditions is met:
83
+
84
+ 1. The user's principal (IAM role/user) actually created the EKS cluster being accessed
85
+ 2. An EKS Access Entry has been configured for the user's principal
86
+
87
+ If you encounter authorization errors when using Kubernetes API operations, verify that an access entry has been properly configured for your principal.
82
88
 
83
89
  ## Quickstart
84
90
 
@@ -90,6 +96,30 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
90
96
  2. Click the gear icon (⚙️) in the top right to open the settings panel, click **MCP**, **Add new global MCP server**.
91
97
  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:
92
98
 
99
+ **For Mac/Linux:**
100
+
101
+ ```
102
+ {
103
+ "mcpServers": {
104
+ "awslabs.eks-mcp-server": {
105
+ "autoApprove": [],
106
+ "disabled": false,
107
+ "command": "uvx",
108
+ "args": [
109
+ "awslabs.eks-mcp-server@latest",
110
+ "--allow-write"
111
+ ],
112
+ "env": {
113
+ "FASTMCP_LOG_LEVEL": "ERROR"
114
+ },
115
+ "transportType": "stdio"
116
+ }
117
+ }
118
+ }
119
+ ```
120
+
121
+ **For Windows:**
122
+
93
123
  ```
94
124
  {
95
125
  "mcpServers": {
@@ -98,7 +128,9 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
98
128
  "disabled": false,
99
129
  "command": "uvx",
100
130
  "args": [
131
+ "--from",
101
132
  "awslabs.eks-mcp-server@latest",
133
+ "awslabs.eks-mcp-server.exe",
102
134
  "--allow-write"
103
135
  ],
104
136
  "env": {
@@ -119,6 +151,8 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
119
151
  1. Install the [Amazon Q Developer CLI](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html) .
120
152
  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:
121
153
 
154
+ **For Mac/Linux:**
155
+
122
156
  ```
123
157
  {
124
158
  "mcpServers": {
@@ -135,6 +169,24 @@ This quickstart guide walks you through the steps to configure the Amazon EKS MC
135
169
  }
136
170
  ```
137
171
 
172
+ **For Windows:**
173
+
174
+ ```
175
+ {
176
+ "mcpServers": {
177
+ "awslabs.eks-mcp-server": {
178
+ "command": "uvx",
179
+ "args": ["--from", "awslabs.eks-mcp-server@latest", "awslabs.eks-mcp-server.exe"],
180
+ "env": {
181
+ "FASTMCP_LOG_LEVEL": "ERROR"
182
+ },
183
+ "autoApprove": [],
184
+ "disabled": false
185
+ }
186
+ }
187
+ }
188
+ ```
189
+
138
190
  3. Verify your setup by running the `/tools` command in the Q Developer CLI to see the available EKS MCP tools.
139
191
 
140
192
  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.
@@ -145,13 +197,36 @@ Note that this is a basic quickstart. You can enable additional capabilities, su
145
197
 
146
198
  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:
147
199
 
200
+ **For Mac/Linux:**
201
+ ```
202
+ {
203
+ "mcpServers": {
204
+ "awslabs.eks-mcp-server": {
205
+ "command": "uvx",
206
+ "args": [
207
+ "awslabs.eks-mcp-server@latest",
208
+ "--allow-write",
209
+ "--allow-sensitive-data-access"
210
+ ],
211
+ "env": {
212
+ "AWS_PROFILE": "your-profile",
213
+ "AWS_REGION": "us-east-1"
214
+ }
215
+ }
216
+ }
217
+ }
218
+ ```
219
+
220
+ **For Windows:**
148
221
  ```
149
222
  {
150
223
  "mcpServers": {
151
224
  "awslabs.eks-mcp-server": {
152
225
  "command": "uvx",
153
226
  "args": [
227
+ "--from",
154
228
  "awslabs.eks-mcp-server@latest",
229
+ "awslabs.eks-mcp-server.exe",
155
230
  "--allow-write",
156
231
  "--allow-sensitive-data-access"
157
232
  ],
@@ -164,11 +239,17 @@ The `args` field in the MCP server definition specifies the command-line argumen
164
239
  }
165
240
  ```
166
241
 
167
- #### `awslabs.eks-mcp-server@latest` (required)
242
+ #### Command Format
243
+
244
+ The command format differs between operating systems:
168
245
 
169
- Specifies the latest package/version specifier for the MCP client config.
246
+ **For Mac/Linux:**
247
+ * `awslabs.eks-mcp-server@latest` - Specifies the latest package/version specifier for the MCP client config.
170
248
 
171
- * Enables MCP server startup and tool registration.
249
+ **For Windows:**
250
+ * `--from awslabs.eks-mcp-server@latest awslabs.eks-mcp-server.exe` - Windows requires the `--from` flag to specify the package and the `.exe` extension.
251
+
252
+ Both formats enable MCP server startup and tool registration.
172
253
 
173
254
  #### `--allow-write` (optional)
174
255
 
@@ -362,24 +443,45 @@ Features:
362
443
  Parameters:
363
444
 
364
445
  * cluster_name, log_type (application, host, performance, control-plane, custom), resource_type (pod, node, container, cluster),
365
- resource_name, minutes (optional), start_time (optional), end_time (optional), limit (optional), filter_pattern (optional), fields (optional)
446
+ resource_name (optional), minutes (optional), start_time (optional), end_time (optional), limit (optional), filter_pattern (optional), fields (optional)
366
447
 
367
448
  #### `get_cloudwatch_metrics`
368
449
 
369
- Retrieves metrics from CloudWatch for a specific EKS cluster resource.
450
+ Retrieves metrics from CloudWatch for Kubernetes resources.
370
451
 
371
452
  Features:
372
453
 
373
- * Fetches metrics based on resource type (pod, node, container, cluster), resource name, and metric name.
374
- * Allows specification of CloudWatch namespace, Kubernetes namespace, and time range.
454
+ * Fetches metrics based on metric name and dimensions.
455
+ * Allows specification of CloudWatch namespace and time range.
375
456
  * Configurable period, statistic (Average, Sum, etc.), and limit for data points.
376
457
  * Supports providing custom dimensions for fine-grained metric querying.
377
458
 
378
459
  Parameters:
379
460
 
380
- * cluster_name, metric_name, resource_type (pod, node, container, cluster), resource_name, namespace (optional), k8s_namespace
381
- (optional), minutes (optional), start_time (optional), end_time (optional), limit (optional), stat (optional), period (optional), custom_dimensions
382
- (optional)
461
+ * cluster_name, metric_name, namespace, dimensions, minutes (optional), start_time (optional), end_time (optional), limit (optional), stat (optional), period (optional)
462
+
463
+ #### `get_eks_metrics_guidance`
464
+
465
+ Provides guidance on available CloudWatch metrics for different resource types in EKS clusters.
466
+
467
+ Features:
468
+
469
+ * Returns a list of available Container Insights metrics for the specified resource type, including metric names, dimensions, and descriptions.
470
+ * Helps determine the correct dimensions to use with the `get_cloudwatch_metrics` tool.
471
+ * Supports the following resource types:
472
+ * `cluster`: Metrics for EKS clusters (e.g., cluster_node_count, cluster_failed_node_count)
473
+ * `node`: Metrics for EKS nodes (e.g., node_cpu_utilization, node_memory_utilization, node_network_total_bytes)
474
+ * `pod`: Metrics for Kubernetes pods (e.g., pod_cpu_utilization, pod_memory_utilization, pod_network_rx_bytes)
475
+ * `namespace`: Metrics for Kubernetes namespaces (e.g., namespace_number_of_running_pods)
476
+ * `service`: Metrics for Kubernetes services (e.g., service_number_of_running_pods)
477
+
478
+ Parameters:
479
+
480
+ * resource_type
481
+
482
+ Implementation:
483
+
484
+ 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`.
383
485
 
384
486
  ### IAM Integration
385
487
 
@@ -466,6 +568,7 @@ The EKS MCP Server can be used for production environments with proper security
466
568
 
467
569
  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:
468
570
 
571
+ **For Mac/Linux:**
469
572
  ```
470
573
  {
471
574
  "mcpServers": {
@@ -496,6 +599,39 @@ An array within the MCP server definition that lists tool names to be automatica
496
599
  }
497
600
  ```
498
601
 
602
+ **For Windows:**
603
+ ```
604
+ {
605
+ "mcpServers": {
606
+ "awslabs.eks-mcp-server": {
607
+ "command": "uvx",
608
+ "args": [
609
+ "--from",
610
+ "awslabs.eks-mcp-server@latest",
611
+ "awslabs.eks-mcp-server.exe"
612
+ ],
613
+ "env": {
614
+ "AWS_PROFILE": "eks-mcp-readonly-profile",
615
+ "AWS_REGION": "us-east-1",
616
+ "FASTMCP_LOG_LEVEL": "INFO"
617
+ },
618
+ "autoApprove": [
619
+ "manage_eks_stacks",
620
+ "manage_k8s_resource",
621
+ "list_k8s_resources",
622
+ "get_pod_logs",
623
+ "get_k8s_events",
624
+ "get_cloudwatch_logs",
625
+ "get_cloudwatch_metrics",
626
+ "get_policies_for_role",
627
+ "search_eks_troubleshoot_guide",
628
+ "list_api_versions"
629
+ ]
630
+ }
631
+ }
632
+ }
633
+ ```
634
+
499
635
  ### IAM Permissions Management
500
636
 
501
637
  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,16 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
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
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
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.
14
+
15
+ # This file is part of the awslabs namespace.
16
+ # It is intentionally minimal to support PEP 420 namespace packages.
@@ -0,0 +1,17 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
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
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
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.
14
+
15
+ """awslabs.eks-mcp-server"""
16
+
17
+ __version__ = '0.1.0'