AgentCore Gateway: tools/call fails on any credentialed outbound target (mcpServer and OpenAPI), no-auth forward works

未关闭
#2,550 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@tejaskash 已经在做这个了。

开始于 2026年10月19日。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
63/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
aws, typescript
领域
api, backend

调研方向

Start from the outbound tools/call forwarding path for both mcpServer and OpenAPI targets, and locate where a target's credential provider (the API_KEY path) is resolved and injected into the upstream request — the no-auth OpenAPI forward that succeeds is the working baseline to diff against. Then inspect the error handling that collapses all credentialed failures into 'An internal error occurred. Please retry later.', since the identical text for valid and invalid tokens suggests the injection leg throws before reaching upstream. Done means a credentialed forward returns the upstream response (or a faithful upstream error) and is covered by a test exercising API_KEY injection.

由索引模型根据 Issue 内容生成。

描述

Summary

Outbound tools/call forwards fail whenever a credential provider is attached — regardless of target type (mcpServer, OpenAPI) or credential validity. The same calls succeed direct (no gateway). tools/list works in all cases.

Repro (us-west-2, 2026-10-07)

Gateway: CreateGateway (protocol MCP, AWS_IAM authorizer). All calls via SigV4 POST to the gateway /mcp endpoint.

Target Credential provider tools/list via GW tools/call via GW Same call, direct (no GW)
mcpServer → https://api.githubcopilot.com/mcp (static schema, 46 tools) API_KEY (valid GitHub PAT, Authorization: Bearer header) 200, 30 tools isError: true, "An internal error occurred. Please retry later." 200, success
Same API_KEY (fresh GitHub App installation token, ghs_) 200 identical error 200, success
Same API_KEY (deliberately invalid token) 200 identical error 401-class error (different text)
OpenAPI → https://api.github.com (3 REST ops) same API_KEY (valid PAT) 200, ops served as tools identical error 200, success
OpenAPI → https://httpbin.org/get none 200 200, success —

Observations

  • The failure text is identical for valid, rotated, and invalid credentials → the credential does not appear to reach the upstream request (or the injection leg throws before it does).
  • No-auth OpenAPI forward works end-to-end → the outbound network path itself is fine; the failure is isolated to the credential-injection leg.
  • No CloudWatch log group is created for the gateway (only runtime log groups exist), so we could not find server-side diagnostics.
  • Also fails after update-api-key-credential-provider with a freshly rotated key.

Ask

  1. Fix the credentialed outbound forward (API_KEY provider path).
  2. Longer term: a credential provider that mints/refreshes GitHub App installation tokens (JWT → POST /app/installations/{id}/access_tokens, 1h TTL). Current provider set (static API_KEY, 3-legged OAuth, GATEWAY_IAM_ROLE) can't express it — GitHub's OAuth server is authorization-code-only, so there's no gateway-native bot credential for GitHub.

Happy to share exact CLI invocations / account details privately if useful.

主要语言
TypeScript
星标
339
派生
129
平均合并
19 小时 21 分钟
30 天内合并 PR
125

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aws/agentcore-cli 的其他 Issue

查看 aws/agentcore-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。