Build1 publisher3 min readPublished
The default MCP deployment buys a Kubernetes operational surface for request/response traffic
A dev.to writeup makes the case for trying Bedrock Agents or AgentCore Runtime before containers, and for putting real limits on the gateway, because a looping agent spends money without ever raising an error.
The Engineer · Build desk

What happened
- The default production path for an MCP server is a container on ECS or EKS, which brings autoscaling tuning and per-agent-session IAM role assumption to a workload that is mostly request/response.
- A dev.to writeup puts two AWS managed options ahead of that default, Amazon Bedrock Agents and the newer Bedrock AgentCore suite.
- AgentCore Runtime hosts agent or MCP server code without containers, while AgentCore Gateway turns existing APIs, Lambda functions and OpenAPI or Smithy specs into MCP-compatible tools.
- An agent that retries, re-checks its own output or loops the same tool call never throws an error, so the overspend surfaces when the invoice lands about a month later.
- The post's recommended controls are a gateway burst limit of 20 with a sustained 10 requests per second, IAM roles scoped per tool, and Cognito in front of the MCP endpoint.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- cost With no exception to page on, the first alarm for a runaway agent is the bill, and it reaches the account owner a month after the run that caused it.
- decision Runtime does not help if the actual problem is ten ungoverned internal APIs, so work out which problem you have before you pick a service.
- exposure Once a tool can write, the reach of a successful prompt injection is set by whatever role the tool borrowed, not by what the tool was built to do.
Take the rate limit first, since it is the one recommendation in the dev.to post with numbers attached. It asks for a burst of 20 and a sustained 10 requests per second on the gateway in front of the MCP server [12]. It says an agent stuck in a loop hits that ceiling four seconds into a session [13]. For the loop to trip at four seconds, it has to be calling faster than ten times a second. On a bucket refilling at the sustained rate, roughly 60 calls get through in that window: 20 from the burst allowance plus 10 a second for four seconds [19]. The other way to learn about the loop is the invoice, about a month later [10].
Choosing between the two AgentCore pieces is a question about which problem you have. Ten internal APIs that need to look like one governed MCP endpoint is a Gateway job, and Gateway fronts what already runs without hosting anything new [7]. Not wanting to manage containers for your own server code is a Runtime job [6]. The post says the pair is easy to mix up on a first read, and that the naming gets muddled in most blog posts written about it [8].
For the managed path to be the cheaper first try, your tool calls have to fit compute the post describes as mostly request/response with an occasional long-running call in the middle [3]. That occasional long call is the part serverless hosting either accommodates or does not, and the post does not include cost figures, latency numbers or Runtime execution limits for either option [20]. The case against ECS and EKS is argued on operating surface: autoscaling tuned for traffic with no predictable pattern, plus IAM role assumption per agent session [2].
Write access changes what a scoping mistake costs. A wrong read produces bad output; a wrong write modifies infrastructure [15]. The post's rule is one role per tool rather than one per agent. Reuse a role across five tools to save setup time and the tool that queries a single table gets a path to S3 and security groups [16]. Cognito goes in front of the endpoint before any of that fires [17]. A guardrail layer, Bedrock Guardrails or an equivalent, sits between the model and anything sensitive, and the post names prompt injection aimed at leaking data or pushing an unauthorized change as the case it is there for [18].
Per-service tags cannot say which customer or which run spent the money, so the post wants tags at the session or tenant level, with cost per agent decision as the unit [11]. X-Ray and CloudWatch return latency numbers and error rates, neither of which explains why the agent called tool B right after tool A [14]. And the reason to put the whole thing in Terraform is the question you get six months out, once whoever set it up has moved teams. Which IAM role got attached to which agent in which environment [9].
What to watch
- A measured cost and cold-start comparison of AgentCore Runtime against an EKS-hosted MCP server would settle which default fits long tool calls.
- Session-level and tenant-level cost tags becoming first-class in AWS billing instead of something each team wires up itself.
- Whether runaway agent spend gets its own alarm primitive, since a rate limit is a poor cost alarm.