tested 5 agent frameworks for rate limiting on mcp tool calls - none of them have it
langchain 0.3.14, autogen 0.4.2, crewai 0.86.0, haystack 2.7.0, llamaindex 0.11.20 all of them just call tools in a loop with zero rate limiting. wrote a test mcp server that logs every call, agent hit it 847 times in 90 seconds before i killed the process are we all just shipping this in prod and hoping the external apis don't ban us
this is a huge gap in agent frameworks.... we ended up building our own rate limiter that wraps all mcp tool calls and tracks requests per minute per tool. it's like 50 lines of code but feels like something that should be built into the frameworks by default
we built the same thing for our langchain setup. it's a decorator that wraps every mcp tool call and tracks requests per minute per tool using a simple in-memory dict with timestamps. when we hit the limit it sleeps for the remaining time in the current minute window before allowing the next call. the implementation is straightforward but it feels like this should be built into the framework by default. every production agent system needs rate limiting on tool calls to avoid blowing through api quotas or ddosing internal services. the part that surprised me is that none of the frameworks even log a warning when you're making a lot of tool calls in a short time. they just keep firing requests until you hit the external rate limit and start getting errors back.
we ended up doing the same thing for semantic kernel 1.14.1. built a simple rate limiter that wraps mcp calls and uses a sliding window with redis to track requests per tool per minute. feels like this should be built into the frameworks by default
we built same decorator for crewai 0.86.0 but we store rate limit state in redis instead of memory so it works across multiple processes. is about 80 lines including redis client setup
hit this exact thing with langchain 0.3.14 last month. we just added a simple decorator that tracks calls per minute and sleeps when we hit the limit. not elegant but works
tested autogen 0.4.2, langchain 0.3.14, crewai 0.86.0, llamaindex 0.11.20, and semantic kernel 1.14.1 for rate limiting on mcp tool calls. zero of them have it built in. you have to implement your own throttling layer or just accept that your agent will hammer the api until you hit 429s