에이전트 문제 해결을 위한 설정 - Amazon EMR

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

에이전트 문제 해결을 위한 설정

참고

Apache Spark 문제 해결 에이전트는 리전 간 추론을 사용하여 자연어 요청을 처리하고 응답을 생성합니다. 자세한 내용은 단원을 참조하십시오Apache Spark 문제 해결 에이전트의 리전 간 처리. Amazon SageMaker Unified Studio MCP 서버는 미리 보기 중이며 변경될 수 있습니다.

사전 조건

Kiro CLI와의 통합을 위한 설정 프로세스를 시작하기 전에 워크스테이션에 다음이 설치되어 있는지 확인합니다.

리소스 설정

AWS CloudFormation 템플릿을 사용하여 MCP 서버의 리소스를 설정할 수 있습니다. 이 템플릿은 요구 사항에 맞게 수정해야 하는 샘플입니다. 템플릿은 문제 해결 프로세스를 위해 다음 리소스를 생성합니다.

  1. MCP Server를 호출할 수 있는 권한과 선택한 플랫폼의 문제 해결 프로세스에 필요한 권한이 있는 IAM 역할입니다.

다음 표에서 스택 시작 버튼 중 하나를 선택하십시오. 그러면 해당 리전의 AWS CloudFormation 콘솔에서 스택이 시작됩니다.

리전 시작
미국 동부(오하이오)
미국 동부(버지니아 북부)
미국 서부(오레곤)
아시아 태평양(도쿄)
유럽(아일랜드)
아시아 태평양(싱가포르)
아시아 태평양(시드니)
캐나다(중부)
남아메리카(상파울루)
유럽(프랑크푸르트)
유럽(스톡홀름)
유럽(런던)
유럽(파리)
아시아 태평양(서울)
아시아 태평양(뭄바이)

스택 세부 정보 지정 페이지로 이동하여 스택 이름을 입력합니다. 파라미터(Parameters) 아래에 추가 정보를 입력합니다. 다음 정보를 제공하고 스택 생성을 진행합니다.

  • TroubleshootingRoleName - 문제 해결을 위해 생성할 IAM 역할의 이름입니다.

  • EnableEMREC2 - EMR-EC2 문제 해결 권한 활성화(기본값: true)

  • EnableEMRServerless - EMR-Serverless 문제 해결 권한 활성화(기본값: true)

  • EnableGlue - Glue 문제 해결 권한 활성화(기본값: true)

  • CloudWatchKmsKeyArn - (선택 사항) CloudWatch Logs 암호화를 위한 기존 KMS 키의 ARN(EMR Serverless만 해당, 기본 암호화를 위해 비워둠)

CloudFormation 템플릿을 다운로드 및 검토하고, 위의 옵션을 지정하고, CloudFormation CLI 명령을 사용하여 템플릿을 직접 시작할 수도 있습니다. 아래 예제를 참조하세요.

# deploy the stack with CloudFormation CLI commands aws cloudformation deploy \ --template-file spark-troubleshooting-mcp-setup.yaml \ --stack-name spark-troubleshooting-mcp-setup \ --region <your Spark MCP server launch region> \ --capabilities CAPABILITY_NAMED_IAM \ --parameter-overrides \ TroubleshootingRoleName=spark-troubleshooting-role # retrieve the 1-line instruction to set the local environment variables, which will be used for the following MCP server configuration aws cloudformation describe-stacks \ --stack-name spark-troubleshooting-mcp-setup \ --region <your Spark MCP server launch region> \ --query "Stacks[0].Outputs[?OutputKey=='ExportCommand'].OutputValue" \ --output text

출력 탭을 열고(또는 위의 CloudFormation describe-stacks CLI 명령에서 검색) CloudFormation 출력에서 1줄 명령을 복사하여 환경 변수를 설정한 다음 로컬 환경에서 실행합니다. 1줄 지침의 예:

export SMUS_MCP_REGION=<your mcp server launch region> && export IAM_ROLE=arn:aws:iam::111122223333:role/spark-troubleshooting-role-xxxxxx

그런 다음 로컬에서 다음 명령을 실행하여 IAM 프로파일 및 MCP 서버 구성을 설정합니다.

# Step 1: Configure AWS CLI Profile aws configure set profile.smus-mcp-profile.role_arn ${IAM_ROLE} aws configure set profile.smus-mcp-profile.source_profile <AWS CLI Profile to assume the IAM role - ex: default> aws configure set profile.smus-mcp-profile.region ${SMUS_MCP_REGION} # Step 2: if you are using kiro CLI, use the following command to add the MCP configuration # Add Spark Troubleshooting MCP Server kiro-cli-chat mcp add \ --name "sagemaker-unified-studio-mcp-troubleshooting" \ --command "uvx" \ --args "[\"mcp-proxy-for-aws@latest\",\"https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-troubleshooting/mcp\", \"--service\", \"sagemaker-unified-studio-mcp\", \"--profile\", \"smus-mcp-profile\", \"--region\", \"${SMUS_MCP_REGION}\", \"--read-timeout\", \"180\"]" \ --timeout 180000 \ --scope global # Add Spark Code Recommendation MCP Server kiro-cli-chat mcp add \ --name "sagemaker-unified-studio-mcp-code-rec" \ --command "uvx" \ --args "[\"mcp-proxy-for-aws@latest\",\"https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-code-recommendation/mcp\", \"--service\", \"sagemaker-unified-studio-mcp\", \"--profile\", \"smus-mcp-profile\", \"--region\", \"${SMUS_MCP_REGION}\", \"--read-timeout\", \"180\"]" \ --timeout 180000 \ --scope global

MCP 서버 구성을 ~/.kiro/settings/mcp.json 포함하도록 아래와 같이 업데이트해야 합니다.

{ "mcpServers": { "sagemaker-unified-studio-mcp-troubleshooting": { "type": "stdio", "command": "uvx", "args": [ "mcp-proxy-for-aws@latest", "https://sagemaker-unified-studio-mcp.us-east-1.api.aws/spark-troubleshooting/mcp", "--service", "sagemaker-unified-studio-mcp", "--profile", "smus-mcp-profile", "--region", "us-east-1", "--read-timeout", "180" ], "timeout": 180000, "disabled": false }, "sagemaker-unified-studio-mcp-code-rec": { "type": "stdio", "command": "uvx", "args": [ "mcp-proxy-for-aws@latest", "https://sagemaker-unified-studio-mcp.us-east-1.api.aws/spark-code-recommendation/mcp", "--service", "sagemaker-unified-studio-mcp", "--profile", "smus-mcp-profile", "--region", "us-east-1", "--read-timeout", "180" ], "timeout": 180000, "disabled": false } } }

Kiro, Cline 및 GitHub CoPilot과 같은 다양한 MCP 클라이언트에 대한 구성 지침은 섹션을 참조지원되는 인터페이스하세요.