Skip to content

Add EKS Node Diagnostics MCP server - #41

Open
shyamkulkarni wants to merge 4 commits into
aws-samples:mainfrom
shyamkulkarni:eks-mcp-collection-approval
Open

Add EKS Node Diagnostics MCP server#41
shyamkulkarni wants to merge 4 commits into
aws-samples:mainfrom
shyamkulkarni:eks-mcp-collection-approval

Conversation

@shyamkulkarni

Copy link
Copy Markdown

Description

Adds the AWS EKS Node Diagnostics MCP server (mcp/aws-eks-node-diagnostics-mcp): a CDK-deployed MCP server that lets the DevOps Agent collect and analyze EKS worker node logs via SSM Automation (the AWS-managed AWSSupport-CollectEKSInstanceLogs document), with 19 tools across four tiers (core operations, log analysis, cluster-level diagnostics, and 41 structured SOP runbooks).

Key design points:

  • Human-in-the-loop collection approval (on by default): the only mutating tools, collect and batch_collect, run through wrapper SSM Automation documents whose first step is the native aws:approve action. The execution pauses in SSM until a designated approver (IAM principals fixed at deploy time via APPROVAL_APPROVER_ARNS) approves in the Systems Manager console. Decisions are IAM-authenticated and CloudTrail-audited; the MCP Lambda has no ssm:SendAutomationSignal permission, so an agent cannot approve its own request. The agent just polls status() and collection proceeds automatically on approval.
  • Fail-closed security defaults: cluster allowlist required at synth time, region restriction, SSM document restriction, per-tool client ACLs, per-caller rate limiting, presigned URL expiry caps, and response redaction.
  • Auth and transport: Cognito OAuth2 in front of a BedrockAgentCore Gateway MCP endpoint; optional VPC deployment with S3/KMS endpoints.

Type of change

  • New skill
  • New custom agent
  • Update to an existing skill or agent
  • Documentation or infrastructure change (new MCP server)

Testing

  • npm run build (tsc) — passes
  • npm test — 12/12 jest tests passed (fast-check property tests for construct IAM and KMS/S3 policies), 44/44 pytest tests passed (approval workflow, region validation, tool validation wiring)
  • Manually deployed via deploy.sh and exercised the approval flow end to end: collect returns pending_approval with an SSM console deep link, approval in the console resumes collection, and status() reports the approval state and collection progress

License confirmation

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0.

Port the sample-eks-node-diagnostics-mcp project into
mcp/aws-eks-node-diagnostics-mcp/, including CDK infrastructure,
Lambda sources, diagnostic runbooks, CNI semantics, the packaged
skill, and tests.

The skill archive (skills/eks-node-diagnostics.zip) is force-added
because the repo's root .gitignore (*.zip) would otherwise exclude
it.
Drop skills/eks-node-diagnostics.zip and its README section per review
feedback; the skill is not required for the MCP server to function.
…proval

Remove the restricted tcpdump_capture/tcpdump_analyze tools and
gate the two mutating tools (collect, batch_collect) behind an
out-of-band human approval flow instead:

- Approval Lambda + Function URL with capability-URL tokens
  (SHA-256 stored server-side, single-use, DynamoDB TTL expiry)
- SNS topic notifies approvers with approve/deny links
- batch_collect defaults to dry-run
- Stricter EKS instance validation: user-settable
  kubernetes.io/cluster/* tag rejected unless
  ALLOW_SELF_MANAGED_NODES=true
- ReDoS-safe search regex validation and log-key path checks
- Update README, architecture docs, and runbooks accordingly
- Add pytest coverage for the approval flow
Replace the custom DynamoDB + Lambda Function URL approval flow with
SSM Automation wrapper documents whose first step is the native
aws:approve action. Approvers are fixed IAM principals set at deploy
time (APPROVAL_APPROVER_ARNS) and approve/deny in the Systems Manager
console; decisions are IAM-authenticated and CloudTrail-audited. The
agent polls status() and collection proceeds automatically on
approval, so no approvalId re-call is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant