Skip to content

Conversation

@maekawataiki
Copy link
Collaborator

@maekawataiki maekawataiki commented Dec 9, 2025

Description of Changes

  • New Feature
    • AgentCore Gateway Support (IAM Auth)
  • Improvement
    • Faster MCP Load for AgentCore / Agent Builder use-cases
      • Parallel load mcp (10s → 6s)
      • Pre-install mcp-remote (25s → 3s)
    • Put MCP Config file in AgnetCore Runtime instead of environment variable to bypass 4096 limit.
  • Bug fix
    • AgentCore Permission (Log not exported due to missing permission due to bug in aws-bedrock-agentcore-alpha<2.227.0-alpha.0)
  • Update Documentation for Agent Builder

Checklist

  • Modified relevant documentation
  • Verified operation in local environment
  • Executed npm run cdk:test and if there are snapshot differences, execute npm run cdk:test:update-snapshot to update snapshots

Related Issues

Please list related issues as much as possible.

詳細は[こちら](https://awslabs.github.io/mcp/)のドキュメントをご参照ください。
MCP サーバーを追加する場合は上述の `mcp.json` に追記してください。
ただし、`uvx` 以外で起動する MCP サーバーは Dockefile の書き換え等開発が必要です。
MCP サーバーを追加する場合は上述の `generic.json` に追記してください。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

初期セットアップするユーザーから見ると mcp.json という名前の方が直感的なように感じました。

名前を genetic.json に変更している理由としては以下でしょうか?

  • generic-agent-core-runtime 以外のエージェントが今後追加されることを想定している
  • AgentCore チャット、MCPチャットのユースケースと競合しないように分けている

Copy link
Collaborator Author

@maekawataiki maekawataiki Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!
理由はその通りです。現状 generic-agent-core-runtime は Generic Agent と Agent Builder 両方のランタイムで利用されておりそれぞれ別の MCP を設定できるようにしています。

generic/mcp.json などフォルダで区切ってファイル名は mcp.json の方がわかりやすいですね。修正します。

mcp_clients.append(client)
except Exception as e:
logger.error(f"Error creating MCP client for {server_name}: {e}")
with ThreadPoolExecutor() as executor:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ThreadPoolExecutor にあまり詳しくないのですが、ひょっとすると mcp サーバーの数が増えていくと懸念するポイントは発生するでしょうか?

現時点での対応は不要ですが、私の手元でも今後検証してみようと思います。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

デフォルトのワーカー数は min(32, (os.process_cpu_count() or 1) + 4) で AgentCore Runtime は 1vCPU なので worker は 5 固定になるはずです。それ以上の mcp サーバーが増えていった場合キューで順次実行されるので特別問題は発生しない認識です。

'AWS_ACCESS_KEY_ID': os.environ['AWS_ACCESS_KEY_ID'],
'AWS_SECRET_ACCESS_KEY': os.environ['AWS_SECRET_ACCESS_KEY'],
'AWS_SESSION_TOKEN': os.environ['AWS_SESSION_TOKEN'],
"UV_NO_CACHE": "1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter/Formatter が効いていなかった・・?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generic-agent-core runtime だけ対象範囲でした。
CI で落ちていたのでプロジェクトルートで実行したのですが、元は generic-agent-core runtime 配下で実行していたので対象外でした。

次のバージョンで Deprecate する予定なので一旦 CI には追加せずこのままでいいかなと。


ユーザーがシステムプロンプトと任意の MCP を設定することでユースケースごとの Agent を自由に作成できるユースケースです。(Experimental: 予告なく破壊的変更を行うことがあります)

AgentCore ユースケースと同様に [agent-builder.json](packages/cdk/lambda-python/generic-agent-core-runtime/mcp-configs/agent-builder.json) にて管理者がわで MCP を事前に登録します。管理者が登録したものからユーザーが好きな MCP を選択式で利用できます。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

タイポ:管理者"側"

でしょうか。

When accessing services outside AWS from AgentCore Runtime, use AgentCore Gateway.
By specifying the Gateway ARN in `agentCoreGatewayArns`, an IAM policy following the principle of least privilege will be configured.
After configuration, use `mcp-proxy-for-aws` in the MCP settings to specify the endpoint.
For details, refer to the [mcp-proxy-for-aws documentation](https://github.com/aws-samples/mcp-proxy-for-aws).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/aws/mcp-proxy-for-aws

にリンクが変わっていました!!

},
"tavily-gateway": {
"command": "uvx",
"args": ["mcp-proxy-for-aws", "<AgentCore Gateway Endpoint>"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"args": ["mcp-proxy-for-aws", "<AgentCore Gateway Endpoint>"],
"args": ["mcp-proxy-for-aws", "<AgentCore Gateway resource URL>"],

の方がマネコンと表記が統一できていて親切かもしれません。

また、どこかドキュメントに例を入れてはいかがでしょうか。以下のような JSON が例として記述してあるだけでもわかりやすくなりそうです👍

    "your-gateway": {
      "command": "uvx",
      "args": [
        "mcp-proxy-for-aws",
        "https://<your-gateway-id>.gateway.bedrock-agentcore.<region>.amazonaws.com/mcp"
      ]
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants