View a markdown version of this page

AgentCore Gateway를 통한 Coinbase Bazaar - Amazon Bedrock AgentCore

AgentCore Gateway를 통한 Coinbase Bazaar

AgentCore Gateway를 사용하면 유료 MCP 서버 및 API 엔드포인트에 연결할 수 있습니다. Coinbase x402 Bazaar MCP 서버를 게이트웨이의 대상으로 추가하여 x402 마이크로트랜잭션을 지원하는 10,000개 이상의 기존 유료 MCP 도구를 검색할 수 있습니다.

  • 서버 URL - https://api.cdp.coinbase.com/platform/v2/x402/discovery/mcp

  • 아웃바운드 인증 유형 수락됨 - 권한 없음(기본값)

Coinbase x402 Bazaar MCP 서버를 게이트웨이에 추가

Console
  1. 대상 섹션으로 이동합니다.

  2. (선택 사항) 생성된 대상 이름을 변경합니다.

  3. (선택 사항) 대상 설명을 제공합니다.

  4. 대상 유형에서 통합을 선택합니다.

  5. Coinbase x402 Bazaar를 선택합니다.

  6. 아웃바운드 인증 구성을 건너뜁니다. "권한 부여 없음"이 유일하게 지원되는 옵션이며 기본적으로 선택됩니다.

AgentCore CLI
agentcore add gateway-target \ --name CoinbaseTarget \ --type mcp-server \ --endpoint https://api.cdp.coinbase.com/platform/v2/x402/discovery/mcp \ --gateway MyGateway agentcore deploy
AWS SDK
import boto3 agentcore_client = boto3.client('bedrock-agentcore-control') target = agentcore_client.create_gateway_target( gatewayIdentifier="your-gateway-id", name="Coinbasex402BazaarTarget", description="Coinbase x402 Bazaar MCP server for paid API discovery", targetConfiguration={ "mcp": { "mcpServer": { "endpoint": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/mcp" } } } )
Strands SDK

에이전트와 함께 Coinbase x402 Bazaar Gateway 대상을 사용합니다.

from strands import Agent from strands.models import BedrockModel from strands.tools.mcp.mcp_client import MCPClient from mcp.client.streamable_http import streamablehttp_client from bedrock_agentcore.payments.integrations.config import AgentCorePaymentsPluginConfig from bedrock_agentcore.payments.integrations.strands.plugin import AgentCorePaymentsPlugin GATEWAY_URL = "https://<your-gateway-id>.gateway.bedrock-agentcore.<region>.amazonaws.com/mcp" ACCESS_TOKEN = "<your-inbound-auth-token>" mcp_client = MCPClient( lambda: streamablehttp_client(GATEWAY_URL, headers={"Authorization": f"Bearer {ACCESS_TOKEN}"}) ) # Configure the Payment plugin config = AgentCorePaymentsPluginConfig( payment_manager_arn="arn:aws:bedrock-agentcore:us-west-2:123456789012:payment-manager/pm-abc123", user_id="test-user-123", payment_instrument_id="payment-instrument-XJU4RSQP9VO0ler", payment_session_id="payment-session-xuzrnUCd7RT725G", region="us-west-2", ) # Create the plugin plugin = AgentCorePaymentsPlugin(config=config) with mcp_client: tools = mcp_client.list_tools_sync() agent = Agent( model=BedrockModel(inference_profile_id="us.anthropic.claude-sonnet-4-20250514-v1:0", streaming=True), tools=tools, plugins=[plugin], # enables automatic payments ) response = agent("Search for available x402 paid APIs related to weather data") print(response)
LangGraph

Coinbase x402 Bazaar Gateway 대상을 LangGraph 에이전트와 함께 사용합니다.

import asyncio from langchain.agents import create_agent from langchain_openai import ChatOpenAI from langchain_mcp_adapters.client import MultiServerMCPClient from bedrock_agentcore.payments.integrations.langgraph import ( AgentCorePaymentsConfig, AgentCorePaymentsMiddleware, ) GATEWAY_URL = "https://<your-gateway-id>.gateway.bedrock-agentcore.<region>.amazonaws.com/mcp" ACCESS_TOKEN = "<your-inbound-auth-token>" async def main(): client = MultiServerMCPClient({ "bazaar": { "transport": "streamable_http", "url": GATEWAY_URL, "headers": {"Authorization": f"Bearer {ACCESS_TOKEN}"}, } }) mcp_tools = await client.get_tools() config = AgentCorePaymentsConfig( payment_manager_arn="arn:aws:bedrock-agentcore:us-west-2:123456789012:payment-manager/pm-abc123", user_id="test-user-123", payment_instrument_id="payment-instrument-XJU4RSQP9VO0ler", region="us-west-2", auto_session=True, ) payments = AgentCorePaymentsMiddleware(config) agent = create_agent( model=ChatOpenAI(model="gpt-4o-mini"), tools=mcp_tools, middleware=[payments], ) result = await agent.ainvoke( {"messages": [{"role": "user", "content": "Search for available x402 paid APIs related to weather data"}]} ) print(result["messages"][-1].content) asyncio.run(main())

Bazaar 대상이 구성되면 에이전트는 게이트웨이를 통해 유료 x402 엔드포인트를 검색하고 호출할 수 있습니다. 엔드포인트가 HTTP 402를 반환하면 에이전트에서 결제 플러그인(스트랜드) 또는 미들웨어(LangGraph)를 구성한 경우 AgentCore 결제가 결제 흐름을 자동으로 처리합니다. 자세한 내용은 프레임워크 통합을 참조하세요.

결제 처리에 필요한 Payment Manager 및 커넥터를 설정하려면 Payment Manager 및 커넥터 생성을 참조하세요.