Automating AWS Agent Registry updates with push-based architecture
Use CloudTrail, EventBridge, and Lambda to automatically push updates from MCP servers to the AWS Agent Registry, keeping metadata fresh across single‑ or multi‑account deployments.

Automating AWS Agent Registry Updates with a Push‑Based Architecture
TL;DR: Stale entries in the AWS Agent Registry undermine trust and slow development. By wiring CloudTrail, Amazon EventBridge, and AWS Lambda into an event‑driven pipeline, you can automatically synchronize MCP server changes to the registry, whether the resources live in a single account or span multiple accounts.
---
Why Automation Matters
When a Model Context Protocol (MCP) server publishes a new tool or modifies its schema, the corresponding record in the AWS Agent Registry must reflect that change. Manual updates are error‑prone:
- Developers may forget to edit the catalog after a deployment.
- Consumers end up calling outdated endpoints, leading to runtime failures.
- Teams revert to ad‑hoc knowledge sharing, eroding the catalog’s reliability.
A push‑based, event‑driven approach ensures the registry is always in sync with the source of truth—your MCP servers—without additional human steps.
---
Core Components of the Solution
| Service | Role in the Pipeline | |---------|----------------------| | AWS CloudTrail | Captures `UpdateAgentRuntime` API calls as management events. | | Amazon EventBridge | Filters the CloudTrail stream, routes matching events to a Lambda function, and supports cross‑account forwarding. | | AWS Lambda | Parses the event, authenticates via AgentCore Identity, queries the MCP server for its current tool list, diffs the result against the existing registry entry, and updates the record if needed. | | AWS Agent Registry | Stores the canonical metadata for each MCP server. | | AgentCore Identity | Provides short‑lived OAuth tokens so the Lambda can call the MCP server without persisting secrets. |
The architecture works in two flavors:
- Single‑account – All components reside in the same AWS account (the registry account).
- Multi‑account – Runtime events originate in a source account and are forwarded to the registry account for processing.
---
End‑to‑End Workflow
- Trigger – A developer updates an MCP server (e.g., via `agentcore deploy`). CloudTrail logs the `UpdateAgentRuntime` call.
- Route – An EventBridge rule matches the CloudTrail event and forwards it to the central event bus. In a multi‑account setup, the source account’s bus forwards the event to the registry account’s bus.
- Parse – The Lambda extracts the runtime ARN from the payload and builds the MCP server’s invocation URL.
- Authenticate – Using AgentCore Identity, the Lambda obtains a short‑lived OAuth bearer token.
- Fetch – The Lambda calls the MCP server (`initialize` → `tools/list`) to retrieve the latest tool definitions.
- Sync – The function compares the fetched schema with the existing registry entry. If differences exist, it updates the Agent Registry record.
Because EventBridge invokes Lambda asynchronously, each event is processed independently, allowing the pipeline to scale automatically with the volume of updates.
---
Practical Implementation Steps
1. Enable CloudTrail for Bedrock AgentCore
```json { "TrailName": "AgentCoreTrail", "ManagementEventSources": ["aws.bedrock-agentcore"] } ``` Ensure the trail writes to a centralized S3 bucket accessible by the registry account.
2. Create the EventBridge Rule (Registry Account)
```json { "Name": "MCPUpdateRule", "EventPattern": { "source": ["aws.bedrock-agentcore"], "detail-type": ["API Call via AWS CloudTrail"], "detail": {"eventName": ["UpdateAgentRuntime"]} }, "Targets": [{"Arn": "arn:aws:lambda:REGION:ACCOUNT_ID:function:SyncAgentRegistry"}] } ``` For cross‑account forwarding, add a permission allowing the source account to put events to this rule.
3. Deploy the Sync Lambda
Key responsibilities in the function code:
- Extract ARN – Parse `agentRuntimeArn` from the event.
- Build URL – Encode the ARN and construct the MCP endpoint.
- Obtain Token – Call AgentCore Identity’s token endpoint (`/oauth2/token`).
- Retrieve Tools – Perform a signed HTTP GET to `tools/list`.
- Diff & Update – Compare with the existing registry entry (via `GetRegistryRecord`), then call `UpdateRegistryRecord` if needed.
The function should be idempotent; repeated events for the same state must not cause unnecessary writes.
4. Grant Least‑Privilege Permissions
- Lambda: `bedrock-agentcore:InvokeRuntime`, `agentregistry:UpdateRecord`, `sts:AssumeRole` for cross‑account token exchange.
- EventBridge: `events:PutEvents` on the target account’s bus.
- CloudTrail: `cloudtrail:LookupEvents` if you need to back‑fill missing events.
5. Test the End‑to‑End Flow
- Deploy a new tool to an MCP server.
- Verify a CloudTrail entry appears within 5‑15 minutes.
- Confirm the EventBridge rule fires (CloudWatch Logs).
- Check the Lambda logs for successful fetch and registry update.
- Query the Agent Registry to see the refreshed schema.
---
Closing Thoughts
By embracing an event‑driven, push‑based model, organizations eliminate the manual step of keeping the AWS Agent Registry current. The solution leverages native AWS services—CloudTrail, EventBridge, Lambda, and AgentCore Identity—so you gain reliability, auditability, and fine‑grained security without introducing external dependencies. Whether you operate a single account or a fleet of accounts, the pattern scales cleanly, ensuring that every developer and downstream service always works against the latest, trustworthy metadata.
Source
Read original sourceWhy we picked this
Meaningful AI news: infrastructure tool for updating AWS Agent Registry for AI agents.