Repository navigation
Description
Description
agentcore export harness in 1.0.1 doesn't export agentcore_gateway tools. The export mapper (src/core/project/templates/export.ts) adds a GATEWAY_TOOL_NOTE_CATEGORY note for every gateway tool, for both --name and --arn exports, and the generated agent gets tools = [] and an empty mcp_client/client.py.
0.31.x exports the same tool. For a gateway tool with outboundAuth: { awsIam: {} } it generates a client in mcp_client/client.py that reads the gateway URL from GATEWAY_GATEWAY_<ID>_URL and connects with mcp_proxy_for_aws.client.aws_iam_streamablehttp_client(url, aws_service="bedrock-agentcore", ...), and main.py adds it to the agent's tools.
We build container images from exported harnesses in CI and treat the generated code as a build artifact, so a manual follow-up per agent doesn't work for us. The new local export (--name, no deployed harness) would simplify that flow a lot, but without gateway tools we can't move to 1.x.
Repro with 1.0.1:
agentcore create --name repro --skip-install --skip-git
cd repro
agentcore add harness --name demo \
--model '{"provider":"bedrock","modelId":"us.anthropic.claude-sonnet-4-6"}' \
--system-prompt "Use the tools."
# then add to app/demo/harness.yaml:
# tools:
# - name: tools
# type: agentcore_gateway
# config:
# agentCoreGateway:
# gatewayArn: arn:aws:bedrock-agentcore:us-east-1:123456789012:gateway/example-abc123
# outboundAuth:
# awsIam: {}
# allowedTools: ["@tools"]
agentcore export harness --name demo --jsonThe notes list the gateway tool as not exported, and app/demoAgent/main.py has tools = [].
Acceptance Criteria
- Exporting a harness with an
agentcore_gatewaytool generates a client for it inmcp_client/client.pyand adds it to the agent's tools inmain.py, for--nameand--arnexports. - With
outboundAuth.awsIam, requests are SigV4-signed forbedrock-agentcore, as 0.31.x does withmcp-proxy-for-aws. - The gateway URL comes from an environment variable at runtime. Naming it after the tool rather than the gateway id would let the same code run against a different gateway than the one in the harness config.
allowedToolspatterns such as@tools/*filter that client's tools, as they do for remote MCP tools.- No gateway-tool note in
EXPORT_NOTES.mdfor that case.
Additional Context
We're on 0.31.2 (v0-latest) until this lands.
Activity
fix(export): export agentcore_gateway tools from harnesses (aws#2768)