Amazon Q Developer CLI: Model Context Protocol(MCP) 활용
1. 개요
Model Context Protocol (MCP)는 LLM이 다양한 도구 및 시스템과 통합되도록 해주는 표준 인터페이스입니다. 마치 USB-C가 다양한 장치 간 연결을 통합하듯, MCP는 LLM이 외부 도구 및 데이터를 표준 방식으로 활용할 수 있게 해줍니다.
Amazon Q Developer CLI는 현재 MCP를 베타로 지원하며, Kubernetes API 및 Playwright 기반 브라우저 제어를 예제로 소개합니다.
준비 조건
/quit # 기존 세션 종료
#python3.11 설치
sudo dnf install python3.11 python3.11-pip python3.11-devel -y
# uv 설치
curl -LsSf https://astral.sh/uv/install.sh | sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
# nodejs 설치
sudo dnf install -y nodejs20 # MCP 서버 실행을 위한 Node.js 설치
amazon q cli는 기본 agent가 q_cli_default로 설정되어 있습니다.
q_cli_default는 ~/.amazonq/rules/**/*.md 또는 chat session이 활성화 되는 디렉토리의 README.md , AmazonQ.md 의 Context를 호출해서 사용합니다.
아래와 같이 q_cli_default agent를 위한 context를 생성합니다.
2. MCP 서버 구성
Amazon Q Developer CLI는 kubectl 없이도 Kubernetes API에 직접 접근할 수 있도록 지원합니다. 이 기능은 MCP 서버를 통해 활성화되며, 실시간으로 클러스터 상태를 파악하거나 명령을 실행할 수 있는 기반이 됩니다.
MCP 서버란?
MCP(Model Context Protocol)는 LLM이 외부 시스템과 표준화된 방식으로 상호작용할 수 있도록 해주는 오픈 프로토콜입니다.
Amazon Q CLI에서는 ~/.aws/amazonq/mcp.json 파일을 통해 MCP 서버를 설정합니다.
$ q chat
To learn more about MCP safety, see https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-mcp-security.html
✓ kubernetes loaded in 8.00 s
✓ 1 of 1 mcp servers initialized
Welcome to
█████╗ ███╗ ███╗ █████╗ ███████╗ ██████╗ ███╗ ██╗ ██████╗
██╔══██╗████╗ ████║██╔══██╗╚══███╔╝██╔═══██╗████╗ ██║ ██╔═══██╗
███████║██╔████╔██║███████║ ███╔╝ ██║ ██║██╔██╗ ██║ ██║ ██║
██╔══██║██║╚██╔╝██║██╔══██║ ███╔╝ ██║ ██║██║╚██╗██║ ██║▄▄ ██║
██║ ██║██║ ╚═╝ ██║██║ ██║███████╗╚██████╔╝██║ ╚████║ ╚██████╔╝
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚══▀▀═╝
╭───────────────────────── Did you know? ─────────────────────────╮
│ │
│ You can execute bash commands by typing ! followed by │
│ the command │
│ │
╰─────────────────────────────────────────────────────────────────╯
/help all commands • ctrl + j new lines • ctrl + k fuzzy search
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
All tools are now trusted (!). Amazon Q will execute tools without asking for confirmation.
Agents can sometimes do unexpected things so understand the risks.
Learn more at https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-chat-security.html#command-line-chat-trustall-safety
kube-system 네임스페이스에서 실행 중인 파드들은 무엇인가요?
결과는 표 형태로 출력하고, 각 구성 요소가 무엇인지 설명도 함께 제공해 주세요.
kube-system 네임스페이스의 파드 분석이 완료되었습니다!
## 주요 결과 요약
총 42개의 파드가 6가지 주요 구성 요소로 실행되고 있습니다:
| 구성 요소 | 파드 수 | 역할 |
|----------|--------|------|
| aws-node | 12개 | VPC CNI 네트워킹 |
| coredns | 2개 | DNS 서비스 |
| ebs-csi-controller | 2개 | EBS 볼륨 관리 |
| ebs-csi-node | 12개 | 노드별 볼륨 드라이버 |
| kube-proxy | 12개 | 네트워크 프록시 |
| metrics-server | 2개 | 리소스 메트릭 수집 |
모든 파드가 Running 상태로 정상 동작하고 있으며, 12개의 워커 노드를 가진 안정적인 EKS 클러스터임을 확인할 수 있습니다.
상세한 분석 결과는 ~/output/kube-system-pods-analysis.md 파일에 저장되었습니다. 각 구성 요소의 역할과 기능에 대한 자세한 설명이 포함되어 있습니다.
/tools
/tools
Tool Permission
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔Built-in:
- execute_bash * trusted
- fs_read * trusted
- fs_write * trusted
- report_issue * trusted
- use_aws * trusted
awslabs.eks-mcp-server (MCP):
- add_inline_policy * not trusted
- apply_yaml * not trusted
- generate_app_manifest * not trusted
- get_cloudwatch_logs * not trusted
- get_cloudwatch_metrics * not trusted
- get_eks_metrics_guidance * not trusted
- get_k8s_events * not trusted
- get_pod_logs * not trusted
- get_policies_for_role * not trusted
- list_api_versions * not trusted
- list_k8s_resources * trusted
- manage_eks_stacks * not trusted
- manage_k8s_resource * not trusted
- search_eks_troubleshoot_guide * not trusted