본문으로 건너뛰기
AWS ML Blog조회 2

Amazon Quick에 AgentCore MCP 서버 연결하기

AgentCore Runtime의 MCP 서버를 Gateway와 인증 계층을 거쳐 Amazon Quick의 Action으로 연결하는 절차입니다.

이 요약은 AI가 원문을 분석해 생성했습니다. 정확한 내용은 원문 기준으로 확인하세요.

TL;DR

이 글은 기존 MCP 서버를 Amazon Bedrock AgentCore Runtime에 배포하고 Amazon Quick의 채팅 에이전트와 Flows에서 재사용하는 연결 절차를 안내합니다. FastMCP 서버는 stateless_http=True와 streamable-http로 실행하며, AgentCore Gateway가 Amazon Quick의 MCP 요청을 받아 AgentCore Runtime으로 전달합니다. 사용자 요청에는 Amazon Cognito 기반 Inbound Auth를 적용하고 Gateway에서 MCP 서버로 나가는 호출에는 AgentCore Identity와 OAuth 2.0 기반 Outbound Auth를 적용한 뒤, Amazon Quick Connector에서 Gateway 엔드포인트를 Action으로 등록합니다. 이 구조는 도구를 애플리케이션마다 다시 구현하지 않고 조직 내 여러 에이전트와 고객 경험에서 같은 MCP 서버를 사용하게 하지만, AWS 리소스와 인증 계층을 모두 설정하고 사용 후 의존성 역순으로 정리해야 합니다.

섹션별 상세

01
Amazon Quick은 외부 데이터와 도구를 활용하는 MCP 통합을 지원하므로, 기존 MCP 서버를 별도 커넥터 없이 채팅 에이전트와 Flows에서 사용할 수 있습니다. 이 글의 구조에서는 Amazon Quick Connector가 MCP 클라이언트 역할을 맡고 AgentCore Gateway가 요청을 중계하며 AgentCore Runtime이 도구를 실행합니다. 같은 MCP 서버에 전문 도구와 하위 에이전트 기능을 모아두면 여러 고객과 팀이 공통 기능을 재사용할 수 있다는 점이 핵심입니다.
text
mcp_server_project/
├── mcp_server.py # Main MCP server code
├── requirements.txt # Dependencies
└── __init__.py # Python package marker

File: requirements.txt
mcp>=1.10.0
boto3
bedrock-agentcore
bedrock-agentcore-starter-toolkit>=0.1.21
strands-agents

uv venv sample-venv # Create Virtual Environment
source sample-venv/bin/activate # Activate Virtual Environment
uv pip install -r requirements.txt # Install the dependencies

MCP 서버 프로젝트의 기본 파일 구조와 의존성을 정의한 뒤 uv로 가상 환경을 만들고 패키지를 설치합니다.

python
from mcp.server.fastmcp import FastMCP

mcp = FastMCP(host="0.0.0.0", stateless_http=True)

@mcp.tool()
def getOrder() -> int:
    """Get an order"""
    return 123

@mcp.tool()
def updateOrder(orderId: int) -> int:
    """Update existing order"""
    return 456

if __name__ == "__main__":
    mcp.run(transport="streamable-http")

FastMCP로 getOrder와 updateOrder 도구를 등록하고 무상태 HTTP 기반 streamable-http 전송으로 MCP 서버를 실행합니다.

bash
# Configure your AgentCore project
agentcore configure --entrypoint mcp_server.py --name simple_mcp_server

agentcore launch

AgentCore starter kit으로 진입점과 런타임 이름을 설정한 뒤 MCP 서버를 AgentCore Runtime에 배포합니다.

02
연결 경로는 사용자 또는 Amazon Quick에서 Gateway로 들어오는 Inbound Auth와 Gateway에서 MCP 서버로 나가는 Outbound Auth로 나뉩니다. Inbound Auth에서는 Amazon Cognito 같은 Identity Provider가 JWT 기반 요청을 검증하고, Outbound Auth에서는 AgentCore Identity가 OAuth 2.0 자격 증명을 관리해 Gateway의 서버 간 호출을 인증합니다. MCP 프로토콜이 현재 OAuth 2.0을 요구하므로 대상 등록에서 OAuth Client를 선택해야 하며, 이 분리는 사용자 접근 제어와 서비스 간 호출 권한을 각각 관리하게 합니다.
json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "MCPServerRuntimePermissions",
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:InvokeAgentRuntime",
        "bedrock-agentcore:InvokeRegistryMcp",
        "secretsmanager:GetSecretValue"
      ],
      "Resource": [
        "arn:aws:bedrock-agentcore:::runtime/",
        "arn:aws:bedrock-agentcore:::runtime//runtime-endpoint/*"
      ]
    }
  ]
}

AgentCore Gateway가 MCP 서버 런타임을 호출하고 Secrets Manager 값을 읽도록 IAM 권한을 부여합니다.

text
https://bedrock-agentcore.us-east-1.amazonaws.com/runtimes/{encoded_agentcore_runtime_mcp_server_arn}/invocations?qualifier=DEFAULT

URL로 인코딩한 AgentCore Runtime MCP 서버 ARN을 사용해 Gateway의 MCP 대상 엔드포인트를 구성합니다.

AWS IAM 역할 생성 화면에서 AWS service와 Amazon Bedrock Agentcore가 사용 사례로 선택된 모습입니다.
Screenshot화면은 Gateway가 맡을 서비스 역할을 IAM에서 생성할 때 AWS service 신뢰 주체와 Amazon Bedrock Agentcore 사용 사례를 선택하는 단계를 보여줍니다. 본문에서 이어지는 bedrock-agentcore:InvokeAgentRuntime, bedrock-agentcore:InvokeRegistryMcp, secretsmanager:GetSecretValue 권한 설정의 시작점에 해당합니다.
Amazon Cognito user pool의 이름과 User pool ID, Token signing key URL이 표시된 정보 화면입니다.
ScreenshotCognito user pool 생성 후 확인할 수 있는 식별자와 서명 키 URL을 보여주며, Gateway의 JWT 검증에 필요한 Identity Provider 정보를 확인하는 장면입니다. 본문은 이 값과 별도로 App Client의 Client ID·Client Secret 및 OpenID configuration Discovery URL을 Inbound Auth 설정에 사용하도록 안내합니다.
Inbound authorization용 Amazon Cognito resource server에서 Gateway 호출을 위한 invoke custom scope를 설정한 화면입니다.
Screenshotresource server에 invoke라는 custom scope와 설명을 입력해 액세스 토큰의 권한 범위를 정의합니다. 이 scope는 Amazon Quick에서 AgentCore Gateway로 들어오는 요청이 보호된 리소스를 호출할 수 있는지 확인하는 Inbound Auth 구성과 연결됩니다.
Outbound authorization용 Amazon Cognito resource server에서 invoke custom scope를 설정한 화면입니다.
Screenshot두 번째 Cognito user pool에도 invoke scope를 생성해 Gateway가 AgentCore Runtime의 MCP 서버를 호출할 때 사용할 권한 범위를 마련합니다. Inbound user pool과 별도인 Outbound user pool을 사용하므로 사용자 요청 검증과 Gateway의 기계 간 인증 경계를 분리합니다.
AgentCore Identity의 Add OAuth Client 화면에 Outbound Cognito app client의 Client ID, Client Secret, Discovery URL을 입력하는 모습입니다.
ScreenshotAgentCore Identity에서 Custom provider와 Discovery URL 방식을 선택하고 Outbound Cognito의 세 가지 자격 증명 정보를 등록합니다. 이 OAuth Client가 Gateway의 MCP target 호출에 사용할 토큰 발급·관리 구성을 제공하므로 본문의 Outbound Auth 절차를 콘솔 화면으로 확인할 수 있습니다.
AgentCore Gateway 생성 화면에서 JSON Web Tokens (JWT) 방식과 기존 Identity Provider 설정 사용이 선택된 모습입니다.
ScreenshotGateway의 Inbound Auth 유형으로 JWT를 선택하고 기존 Identity Provider 설정을 가져오는 화면입니다. 본문에서 Amazon Cognito의 Discovery URL과 Client ID를 입력해 Amazon Quick에서 들어오는 토큰을 Gateway가 검증하도록 만드는 단계와 직접 연결됩니다.
AgentCore Gateway의 JWT schema configuration에서 Cognito Discovery URL과 허용 Client ID를 입력하는 화면입니다.
ScreenshotDiscovery URL은 로그인·토큰·검증 설정을 자동으로 가져오는 기준점이며, Clients 항목은 Gateway 접근을 허용할 Client ID를 제한하는 데 쓰입니다. 따라서 화면은 단순한 JWT 유형 선택을 넘어 Inbound Auth에서 어떤 발급자와 클라이언트를 신뢰할지 구체화하는 설정을 보여줍니다.
AgentCore Gateway Permissions 섹션에서 기존 IAM service role인 agentcore-sample-mcpgateway-role을 선택한 화면입니다.
ScreenshotGateway에 새 역할을 만들거나 기존 service role을 선택할 수 있으며, 화면은 본문에서 생성한 agentcore-sample-mcpgateway-role을 연결한 상태를 보여줍니다. 이 역할의 AgentCore Runtime 호출과 MCP 관련 권한이 Gateway가 등록된 Runtime target에 접근할 수 있는 AWS 측 실행 권한을 형성합니다.
03
MCP 서버는 FastMCP의 stateless_http=True 설정과 streamable-http 전송을 사용해 AgentCore Runtime 호환 형태로 실행해야 합니다. 기본 예제는 getOrder가 123을 반환하고 updateOrder가 orderId를 받은 뒤 456을 반환하는 두 도구를 등록하며, 서버 엔드포인트는 0.0.0.0:8000/mcp 경로를 사용합니다. 이후 agentcore configure로 Dockerfile과 .bedrock_agentcore.yaml을 생성하고 agentcore launch를 실행해 런타임에 배포합니다.
04
AgentCore Gateway를 만들기 전 Gateway가 맡을 IAM 역할과 두 개의 Amazon Cognito user pool을 구성합니다. IAM 정책에는 bedrock-agentcore:InvokeAgentRuntime, bedrock-agentcore:InvokeRegistryMcp, secretsmanager:GetSecretValue 권한을 넣고, 첫 번째 user pool은 Amazon Quick의 Inbound Auth에, 두 번째 user pool은 MCP 서버 호출을 위한 Outbound Auth에 사용합니다. Outbound user pool의 Client ID, Client Secret, Discovery URL은 AgentCore Identity의 OAuth Client에 등록하고, Inbound user pool의 Discovery URL과 Client ID는 Gateway의 JWT 설정에 입력합니다.
05
Gateway 생성 단계에서는 MCP 서버의 URL 인코딩된 ARN을 포함한 Runtime 호출 URL을 Target으로 등록하고 Outbound Auth에 앞서 만든 OAuth Client를 연결합니다. Amazon Quick에서는 Connectors에서 Model Context Protocol (MCP) 통합을 만들고 Gateway의 Resource URL을 MCP Server Endpoint로 입력한 뒤 User authentication 또는 Service authentication을 선택합니다. 동기화가 Available 또는 Ready 상태가 되면 listTools가 표시되고, 해당 Action을 채팅 에이전트에 연결해 Test Action APIs와 실제 대화로 도구 호출을 확인할 수 있습니다.
06
이 패턴은 실행 시간이 길고 세션 격리, 영구 파일 시스템, 인증, 관찰성, 향상된 payload, 양방향 스트리밍, 평가 기능이 필요한 MCP 서버를 AgentCore Runtime에서 관리하도록 구성합니다. Amazon Quick은 등록된 MCP 도구를 Action으로 노출하므로 각 사용 사례마다 REST API나 AI 도구용 커스텀 연결을 새로 만들 필요가 줄어듭니다. 다만 비용을 막으려면 Amazon Quick chat agent 또는 Flow, Action, Gateway, AgentCore Identity 리소스, 두 Cognito user pool, Runtime, IAM 역할을 생성 역순으로 삭제해야 합니다.

이미지 분석

Amazon Quick의 Chat agents와 Connectors가 AgentCore Gateway를 거쳐 AgentCore Runtime의 MCP Server와 Tool #1·Tool #2에 연결되는 구조도입니다.
Diagram

사용자 요청은 Amazon Quick 내부의 MCP Client에서 시작해 AgentCore Gateway로 전달되고, Gateway에서 AgentCore Runtime의 MCP Server로 이어집니다. Amazon Cognito는 Inbound Auth를, AgentCore Identity는 Outbound Auth를 맡으며 Runtime 쪽에는 Observability가 배치되어 글에서 설명한 사용자 인증·기계 간 인증·도구 실행 흐름을 한 화면에 연결합니다.

Amazon Quick의 Chat agents와 Connectors가 AgentCore Gateway를 거쳐 AgentCore Runtime의 MCP Server와 Tool #1·Tool #2에 연결되는 구조도입니다.

MCP Client가 OAuth token과 AWS IAM을 사용해 AgentCore Gateway에 도구 목록 조회와 도구 호출을 요청하고, Gateway가 Outbound OAuth token으로 MCP Server target을 호출하는 흐름도입니다.
Diagram

왼쪽 요청 경로에는 /mcp, OAuth token, AWS IAM, streamable-http connection이 표시되어 MCP 클라이언트와 Gateway 사이의 접근 방식을 나타냅니다. Gateway는 AgentCore Identity의 secure token vault와 token caching 등을 활용한 뒤 MCP server target에 Outbound OAuth token을 전달하므로, 글의 Inbound Auth와 Outbound Auth 분리를 구체화합니다.

MCP Client가 OAuth token과 AWS IAM을 사용해 AgentCore Gateway에 도구 목록 조회와 도구 호출을 요청하고, Gateway가 Outbound OAuth token으로 MCP Server target을 호출하는 흐름도입니다.

용어 해설

Model Context Protocol (MCP)
Model Context Protocol (MCP)는 Foundation Model이나 AI 에이전트가 외부 데이터와 도구에 표준 방식으로 접근하도록 만드는 프로토콜입니다. 파일, 데이터베이스, API를 연결하고 도구 호출 규격을 통일해 여러 클라이언트가 동일한 MCP 서버를 재사용하도록 합니다.
AgentCore Gateway
AgentCore Gateway는 Amazon Quick과 AgentCore Runtime에 배포된 MCP 서버 사이에서 요청을 전달하는 관리형 연결 계층입니다. Inbound Auth로 클라이언트 요청을 검증하고 Outbound Auth로 MCP 서버를 호출하며, IAM 역할과 OAuth 2.0 설정을 통해 접근 범위를 통제합니다.
인바운드 인증(Inbound Auth)
Inbound Auth는 Amazon Quick에서 AgentCore Gateway로 들어오는 요청의 사용자 인증과 접근 권한 확인을 담당합니다. 이 글에서는 Amazon Cognito의 Discovery URL과 Client ID를 Gateway에 등록하고 JWT를 검증하는 방식으로 구성합니다.
아웃바운드 인증(Outbound Auth)
Outbound Auth는 AgentCore Gateway가 AgentCore Runtime의 MCP 서버를 호출할 때 사용하는 서버 간 인증과 권한 부여 흐름입니다. AgentCore Identity에 Amazon Cognito의 OAuth Client 정보를 등록하고 OAuth 2.0 토큰을 발급받아 MCP 서버 요청에 전달합니다.
무상태 HTTP(stateless_http)
stateless_http=True는 MCP 서버가 요청 사이의 세션 상태를 서버에 유지하지 않는 실행 방식입니다. AgentCore Runtime에서 MCP 서버를 호환시키기 위해 FastMCP 생성 시 이 옵션을 켜고 streamable-http 전송으로 0.0.0.0:8000/mcp 경로를 제공합니다.

기술

  • Amazon Quick
  • Amazon Bedrock AgentCore
  • AgentCore Gateway
  • AgentCore Runtime
  • Amazon Cognito
  • AgentCore Identity
  • OAuth 2.0
  • IAM
  • Amazon CloudWatch
  • Python
  • AWS CLI
  • Amazon Bedrock
  • Anthropic models
  • Docker
  • FastMCP
  • MCP library
  • boto3
  • bedrock-agentcore-starter-toolkit
  • strands-agents
  • uv

활용 사례

  • Amazon Quick chat agents에서 주문 조회와 주문 변경 같은 MCP 도구 호출
  • Amazon Quick Flows에서 외부 데이터와 전문 하위 에이전트 기능 사용
  • 조직 내 여러 AI 에이전트가 공통 MCP 서버의 도구를 재사용
  • 고객이 별도 커넥터 구축 없이 Amazon Quick 안에서 기존 제품 기능 사용
AI 분석 전체 내용 보기

AI 요약 · 북마크 · 개인 피드 설정 — 무료

출처 · 인용 안내

원문 발행 2026. 09. 01.수집 2026. 09. 01.출처 타입 RSS

인용 시 "요약 출처: AI Trends (aitrends.kr)"를 표기하고, 사실 확인은 원문 보기 기준으로 진행해 주세요. 자세한 기준은 운영 정책을 참고해 주세요.