-
Notifications
You must be signed in to change notification settings - Fork 368
feat/agentcore improvement (Faster MCP Load, AgentCore Gateway Support, etc) #1378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
docs/ja/DEPLOY_OPTION.md
Outdated
| 詳細は[こちら](https://awslabs.github.io/mcp/)のドキュメントをご参照ください。 | ||
| MCP サーバーを追加する場合は上述の `mcp.json` に追記してください。 | ||
| ただし、`uvx` 以外で起動する MCP サーバーは Dockefile の書き換え等開発が必要です。 | ||
| MCP サーバーを追加する場合は上述の `generic.json` に追記してください。 |
There was a problem hiding this comment.
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チャットのユースケースと競合しないように分けている
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ThreadPoolExecutor にあまり詳しくないのですが、ひょっとすると mcp サーバーの数が増えていくと懸念するポイントは発生するでしょうか?
現時点での対応は不要ですが、私の手元でも今後検証してみようと思います。
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linter/Formatter が効いていなかった・・?
There was a problem hiding this comment.
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 配下で実行していたので対象外でした。
| - name: Run ruff check |
次のバージョンで Deprecate する予定なので一旦 CI には追加せずこのままでいいかなと。
docs/ja/DEPLOY_OPTION.md
Outdated
|
|
||
| ユーザーがシステムプロンプトと任意の MCP を設定することでユースケースごとの Agent を自由に作成できるユースケースです。(Experimental: 予告なく破壊的変更を行うことがあります) | ||
|
|
||
| AgentCore ユースケースと同様に [agent-builder.json](packages/cdk/lambda-python/generic-agent-core-runtime/mcp-configs/agent-builder.json) にて管理者がわで MCP を事前に登録します。管理者が登録したものからユーザーが好きな MCP を選択式で利用できます。 |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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>"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "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"
]
}
Description of Changes
aws-bedrock-agentcore-alpha<2.227.0-alpha.0)Checklist
npm run cdk:testand if there are snapshot differences, executenpm run cdk:test:update-snapshotto update snapshotsRelated Issues
Please list related issues as much as possible.