Ask HN: How do you prevent MCP agents from looping in production?

Posted by aethis 4 hours ago

Counter3Comment2OpenOriginal

I'm building with MCP and starting to run agents with more autonomy — multiple tools, longer sessions, less human oversight. The failure modes I keep hitting aren't the model being wrong, they're the agent making too many calls, retrying things that won't work, or calling tools it shouldn't need for the task. Right now I'm just setting hard iteration limits in my agent code, which feels like a blunt instrument. What are other people doing here — especially anyone running MCP agents in anything close to production?

Comments

Comment by dexwiz 3 hours ago

What is wrong with a blunt tool? Almost every other system ends up with a hard cap of retries.

Comment by verdverm 48 minutes ago

It's all about context management