AWS Builder Center
How to Set Up an MCP Server with AWS Q Developer for Amazon EKS

How to Set Up an MCP Server with AWS Q Developer for Amazon EKS

How to Set Up an MCP Server with AWS Q Developer for Amazon EKS

DevOps Engineer | AWS & Cloud Infrastructure Specialist | Kubernetes | CI/CD | Automation Expert
AWS Q Developer now supports the Model Context Protocol (MCP), allowing you to connect external tools and services directly to AWS Q. By integrating an MCP server with your Amazon EKS environment, you can enable AWS Q to interact with Kubernetes resources, retrieve cluster information, automate troubleshooting, and assist with operational tasks.

Introduction

Managing Kubernetes clusters often requires switching between multiple tools, dashboards, and command-line interfaces. With AWS Q Developer and MCP, you can provide AI-powered access to your EKS environment through standardized tool integrations.
In this guide, you'll learn how to:
  • Install AWS Q Developer
  • Configure an MCP server
  • Connect AWS Q Developer to the MCP server
  • Enable Kubernetes and EKS access
  • Verify the integrationPrerequisites
Before starting, ensure you have:
  • An active AWS account
  • AWS CLI configured
  • kubectl installed
  • Access to an Amazon EKS cluster
  • Node.js (v18 or later)
  • AWS Q Developer installedVerify EKS Access
1
2
3
4
5
6
7
aws sts get-caller-identity

aws eks update-kubeconfig \
--region us-east-1 \
--name my-eks-cluster

kubectl get nodes
Expected output:
1
2
3
NAME STATUS ROLES AGE
ip-10-0-1-12.ec2.internal Ready <none> 20d
ip-10-0-2-34.ec2.internal Ready <none> 20d

Step 1: Install AWS Q Developer

Install AWS Q CLI:

Linux

1
2
3
4
5
6
7
curl --proto '=https' --tlsv1.2 -sSf \
https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip \
-o q.zip

unzip q.zip

sudo ./q/install.sh
Verify installation:
1
q --version
Login to AWS Q:
1
q login

Step 2: Install an MCP Server

AWS Q Developer supports MCP-compatible servers.
Create a workspace:
1
2
3
4
mkdir eks-mcp-server
cd eks-mcp-server

npm init -y
Install required packages:
1
2
3
npm install \
@modelcontextprotocol/sdk \
@kubernetes/client-node

Step 3: Create the MCP Server

Create:
1
server.js
Example MCP server:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const { Server } = require("@modelcontextprotocol/sdk/server");
const k8s = require("@kubernetes/client-node");

const server = new Server({
name: "eks-mcp-server",
version: "1.0.0"
});

const kc = new k8s.KubeConfig();
kc.loadFromDefault();

const k8sApi = kc.makeApiClient(k8s.CoreV1Api);

server.tool(
"get_pods",
"List all pods in a namespace",
{
namespace: {
type: "string",
description: "Kubernetes namespace"
}
},
async ({ namespace }) => {
const pods = await k8sApi.listNamespacedPod(namespace);

return {
content: [
{
type: "text",
text: JSON.stringify(
pods.body.items.map(p => p.metadata.name),
null,
2
)
}
]
};
}
);

server.listen();

Step 4: Test the MCP Server

Run:
1
node server.js
Expected output:
1
MCP Server running...
Verify Kubernetes access:
1
kubectl get pods -A

Step 5: Configure AWS Q Developer

AWS Q stores MCP configurations in:

Linux

1
~/.aws/amazonq/mcp.json
Example configuration:
1
2
3
4
5
6
7
8
9
10
{
"mcpServers": {
"eks-server": {
"command": "node",
"args": [
"/home/ec2-user/eks-mcp-server/server.js"
]
}
}
}
Restart AWS Q after saving the file.

Step 6: Verify MCP Connection

Launch AWS Q:
1
q chat
Try prompts such as:
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article