Usage instructions (AMI with CloudFormation delivery)

EDB Postgres AI Agent Factory is EDB Postgres Advanced Server 18 with the AIDB extension, Vector Plus and the AIDB MCP server, delivered as one CloudFormation stack that also creates an Amazon Bedrock AgentCore Gateway and registers the MCP server on it. Agents call the gateway; the gateway reaches the instance over a private VPC Lattice connection. No port is opened to the internet and no SSH key is used.

Launch

  1. Choose Launch CloudFormation template on the product page and pick the region (us-east-1).
  2. Fill in the parameters:
Parameter Value
AmiId Filled by AWS Marketplace. Leave as is.
VpcId A VPC with outbound access (NAT gateway, transit gateway or VPC endpoints) to Secrets Manager, Systems Manager and Bedrock AgentCore.
SubnetId A subnet in that VPC. The instance and the gateway's private connection both land here.
InstanceType m6i.large, m6i.xlarge (default) or m6i.2xlarge. The embeddings model runs on the CPU; 4 vCPU / 16 GiB or more is recommended.
GatewayName Name for the AgentCore Gateway (default edb-aidb). Must be unique among AgentCore gateways in this account and region.
DataVolumeSize Size in GiB of the EBS volume that holds the Postgres data (default 50).
ExistingDataVolumeId Optional. The DataVolumeId output of a deleted stack, to start with that data. Leave empty for a new empty volume. The volume must be in the same Availability Zone as the subnet and not attached to any instance.
  1. Acknowledge that the stack creates IAM resources and create the stack. It takes 10 to 15 minutes: the instance boots, generates its TLS certificate, creates the mcp_agent Postgres role, publishes its CA certificate, and a Lambda-backed custom resource registers the MCP target on the gateway and waits for it to become READY.

Stack outputs

Output Use
GatewayUrl The MCP endpoint your agent connects to.
GatewayId AgentCore Gateway identifier.
DataVolumeId The EBS volume that holds the Postgres data. It is kept when the stack is deleted.
InstanceId For a shell: aws ssm start-session --target <InstanceId>.
McpEndpoint The private MCP URL on the instance (https://<private-dns>:8765/mcp). Only the gateway can reach it.
CredentialsSecretArn Secrets Manager secret with the generated login for the mcp_agent database role. Only the gateway and the instance role can read it.
CaCertificateSecretArn Secrets Manager secret holding the instance's private CA certificate.

First call: tools/list

The gateway uses IAM authorization (SigV4). Calls are signed with the IAM role the caller already runs under: the instance profile of the EC2 instance or the execution role of the Lambda function hosting your agent, or your own signed-in role when testing from a workstation. Grant that role bedrock-agentcore:InvokeGateway on the gateway ARN. Nothing is typed into the product.

The example below runs anywhere an IAM role is present (EC2 instance profile, Lambda execution role, ECS task role, or a signed-in AWS CLI session). The AWS SDK picks up that role on its own:

import json, boto3
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
import urllib.request

gateway_url = boto3.client("cloudformation").describe_stacks(StackName="<stack>")["Stacks"][0]["Outputs"]
gateway_url = next(o["OutputValue"] for o in gateway_url if o["OutputKey"] == "GatewayUrl")

body = json.dumps({"jsonrpc": "2.0", "id": 1, "method": "tools/list"})
req = AWSRequest(method="POST", url=gateway_url, data=body, headers={"Content-Type": "application/json"})
SigV4Auth(boto3.Session().get_credentials(), "bedrock-agentcore", "us-east-1").add_auth(req)
print(urllib.request.urlopen(urllib.request.Request(gateway_url, data=body.encode(), headers=dict(req.headers), method="POST")).read().decode())

From an agent framework, point the MCP client at GatewayUrl with SigV4 signing for service bedrock-agentcore; every major SDK signs with the same IAM role lookup. The AIDB tools (semantic_kb_search, SQL and schema tools) appear in the tool list. If you prefer JWT, add a Cognito or OIDC authorizer to the gateway after creation; the template creates it with AuthorizerType: AWS_IAM.

What is inside

Security group recommendations

None required. The template creates two security groups: the gateway connection group (no inbound) and the instance group, which accepts TCP 8765 only from the gateway connection group.

Data and updates

The Postgres data directory is on a separate EBS volume, encrypted with the AWS managed key. The volume is kept when the stack is deleted, and it keeps costing money until you delete it.

Remove

Delete the stack. The custom resource removes the gateway target and its AgentCore Identity entry; the gateway, instance, secrets and IAM roles are deleted with the stack. The data volume stays. Delete it in the EC2 console (Volumes) when you no longer need the data.

Version 1.2. Listing: AWS Marketplace. Support: techsupport.enterprisedb.com.