Coinbase Bazaar via AgentCore Gateway
AgentCore Gateway lets you connect to paid MCP servers and API endpoints. You can add the Coinbase x402 Bazaar MCP server as a target in a Gateway to discover 10,000+ existing paid MCP tools that support x402 microtransactions.
Add Coinbase x402 Bazaar MCP server to a Gateway
Example
- Console
-
-
Navigate to the Target section.
-
(Optional) Change the generated Target name.
-
(Optional) Provide a Target description.
-
For Target type, choose Integrations.
-
Select Coinbase x402 Bazaar.
-
Skip Outbound Auth configurations. "No Authorization" is the only supported option and is selected by default.
- 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
-
Use the Coinbase x402 Bazaar Gateway Target with your agent:
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)
Once the Bazaar target is configured, your agents can discover and call paid x402 endpoints through the Gateway. When an endpoint returns HTTP 402, AgentCore payments handles the payment flow automatically if you have configured a payments plugin or PaymentManager in your agent. To learn more about payments plugin or PaymentManager, see Process a payment.
To set up the Payment Manager and Connector required for processing payments, see Create a Payment Manager and Connector.