Kiro IDE MCP Server - 빠른 시작 가이드
얻을 수 있는 것
Kiro IDE에서 자연어로 직접 질문하세요:
- "Which model is consuming the most tokens?"
- "What's the average latency for Claude Haiku?"
- "Estimate my LLM costs for the last hour"
대시보드로 전환하거나 복잡한 쿼리를 작성할 필요가 없습니다!
1단계: Kiro에서 MCP Server 구성
옵션 A: 워크스페이스 구성 사용 (권장)
-
MCP 구성 디렉토리 생성:
mkdir -p .kiro/settings -
MCP 구성 복사:
cp AI-OBS_DEMO/kiro-mcp-config.json .kiro/settings/mcp.json -
구성에서 경로 업데이트 (필요한 경우):
.kiro/settings/mcp.json을 열고cloudwatch_mcp_server.py의 경로가 올바른지 확인하세요:{
"mcpServers": {
"ai-observability": {
"command": "python3",
"args": [
"/path/to/mcp-server/cloudwatch_mcp_server.py"
],
"env": {
"AWS_REGION": "your-aws-region"
},
"disabled": false,
"autoApprove": []
}
}
}
옵션 B: 사용자 수준 구성 사용 (글로벌)
-
사용자 구성 디렉토리 생성:
mkdir -p ~/.kiro/settings -
구성 복사:
cp AI-OBS_DEMO/kiro-mcp-config.json ~/.kiro/settings/mcp.json
2단계: AWS 자격 증명 확인
MCP 서버가 CloudWatch를 쿼리하려면 AWS 자격 증명이 필요합니다:
# AWS 자격 증명이 구성되어 있는지 확인
aws sts get-caller-identity
# 다음과 같이 표시되어야 합니다:
# {
# "UserId": "...",
# "Account": "<your-account-id>",
# "Arn": "arn:aws:iam::<your-account-id>:user/<your-username>"
# }
구성되지 않은 경우, AWS 자격 증명을 설정하세요:
aws configure
# AWS Access Key ID 입력
# AWS Secret Access Key 입력
# Default region: your-aws-region
# Default output format: json
3단계: MCP Server 테스트 (선택사항)
Kiro에서 사용하기 전에 MCP 서버가 작동하는지 확인하세요:
python3 AI-OBS_DEMO/test-mcp-server.py
다음과 같은 출력이 표시됩니다:
Testing CloudWatch MCP Server
==============================
1. Testing get_token_usage...
✅ Success: {
"token_type": "input",
"time_range_hours": 1,
"models": [...]
}
2. Testing get_model_latency...
✅ Success: {...}
4단계: Kiro IDE 재시작
Kiro가 MCP 구성을 로드하려면:
- 모든 작업 저장
- Kiro 완전 종료 (Mac에서 Cmd+Q, 또는 File → Exit)
- Kiro 다시 열기
- 워크스페이스 열기 (
.kiro/settings/mcp.json이 포함된 폴더)
5단계: MCP Server 연결 확인
- Kiro Feature Panel 열기 (왼쪽 사이드바)
- "MCP Servers" 섹션 찾기
- 다음이 표시되어야 합니다:
ai-observability에 녹색 상태 표시기 - 빨간색 표시기가 보이면: 클릭하여 오류 세부 정보 확인
연결 문제 해결
서버가 연결 해제 상태로 표시되는 경우:
- Kiro 왼쪽 패널에서 MCP Server 뷰 확인
- 가능한 경우 "Reconnect" 클릭
- 로그 확인: MCP 서버 출력에서 오류 메시지 확인
- Python 경로 확인:
python3이 PATH에 있는지 확인 - 파일 권한 확인:
cloudwatch_mcp_server.py가 읽기 가능한지 확인
6단계: 자연어 쿼리 사용
Kiro 채팅에서
- Kiro 채팅 열기 (Cmd+L 또는 채팅 아이콘 클릭)
- 일반 영어로 질문 입력:
Which model is consuming the most tokens?
- Kiro가 자동으로:
- Observability 쿼리로 인식
- MCP 서버의
get_token_usage도구 호출 - 구조화된 결과 반환
시도해 볼 쿼리 예시
1. 토큰 사용량
Which model is consuming the most tokens?
예상 응답:
{
"token_type": "input",
"time_range_hours": 1,
"models": [
{
"model": "anthropic.claude-3-haiku-20240307-v1:0",
"total_tokens": 475
},
{
"model": "gpt-4o",
"total_tokens": 312
}
]
}
2. 지연시간 통계
What's the average latency for all models?
예상 응답:
{
"time_range_hours": 1,
"models": [
{
"model": "anthropic.claude-3-sonnet-20240229-v1:0",
"avg_latency_ms": 2567.89
},
{
"model": "gpt-4o",
"avg_latency_ms": 2234.12
}
]
}
3. 비용 추정
Estimate the cost of LLM usage for the last hour
예상 응답:
{
"time_range_hours": 1,
"total_estimated_cost_usd": 0.0142,
"cost_breakdown": [
{
"model": "anthropic.claude-3-haiku-20240307-v1:0",
"input_tokens": 475,
"output_tokens": 8084,
"estimated_cost_usd": 0.0102
}
]
}
4. 요청 볼륨
How many requests have been made in the last hour?
5. 모델 비교
Compare all models by latency and token usage
7단계: 고급 사용법
커스텀 시간 범위
쿼리에서 커스텀 시간 범위를 지정할 수 있습니다:
Show me token usage for the last 2 hours
What was the latency for Claude Haiku in the last 3 hours?
특정 모델 쿼리
전체 모델 ID를 사용하여 특정 모델을 쿼리하세요:
What's the latency for anthropic.claude-3-haiku-20240307-v1:0?
멀티 메트릭 쿼리
포괄적인 분석을 요청하세요:
Give me a complete overview of Claude Haiku performance
문제 해결
"No data" 응답
문제: MCP 서버가 빈 결과를 반환
해결책:
- 메트릭을 생성하기 위해 데모 실행:
python3 AI-OBS_DEMO/multi-cloud-demo.py - CloudWatch가 메트릭을 수집할 때까지 1-2분 대기
- 시간 범위를 늘려보세요: "Show me token usage for the last 2 hours"
MCP Server 응답 없음
문제: 쿼리가 타임아웃되거나 실패
해결책:
- Kiro의 MCP 패널에서 MCP 서버 상태 확인
- AWS 자격 증명 확인:
aws sts get-caller-identity - CloudWatch 권한 확인
- MCP 구성을 다시 로드하기 위해 Kiro 재시작
권한 오류
문제: 응답에서 "AccessDenied" 오류
해결책:
- IAM 권한에 다음이 포함되어 있는지 확인:
cloudwatch:GetMetricStatisticscloudwatch:ListMetrics
- AWS 리전이 올바르게 설정되어 있는지 확인
Python 경로 문제
문제: "python3: command not found"
해결책:
- Python 경로 찾기:
which python3 - MCP 구성에 전체 경로로 업데이트:
"command": "/usr/local/bin/python3"
최상의 결과를 위한 팁
1. 최신 데이터 생성
쿼리 전에 최신 메트릭을 확보하기 위해 데모를 실행하세요:
python3 AI-OBS_DEMO/multi-cloud-demo.py
2. 자연어 사용
MCP 서버는 자연스러운 질문을 이해합니다:
- ✅ "Which model costs the most?"
- ✅ "Show me latency for all models"
- ✅ "How many tokens did Claude use?"