今日已更新 339 条资讯 | 累计 19899 条内容
关于我们

Your AI coding agent will happily ship a breaking API change. I built an MCP server to catch it.

Deepak Satyam 2026年07月11日 02:40 4 次阅读 来源:Dev.to

Last month I watched Cursor confidently rename a field across an entire API, commit it, and open a PR. Clean diff, tests green, looked great. It had also just broken a mobile client and a partner integration that were still reading the old field name — and neither Cursor nor I noticed until much later. That's the thing about AI coding agents and APIs: they're fast, they're fearless, and they have zero awareness of your API contract . An agent will drop an endpoint, make a request field required, or change a response type without any sense that a real consumer out there depends on the old shape. The code compiles. Your tests pass (your tests — not the consumer's). The breakage is completely silent until someone downstream feels it, usually in production, usually from an angry message rather than a failing build. We keep giving agents more power to write API changes and nothing to tell them whether a change is safe to ship . So I built that missing piece as an MCP server. The gap: there's no "is this safe?" step in the loop Think about how you'd catch this manually. You'd diff the old and new OpenAPI spec, look for removed endpoints, removed response fields, tightened request contracts, enum narrowing — the classic breaking changes — and decide whether it's safe to merge or whether you need a version bump and a heads-up to consumers. An agent never does that. It has the code in context, not the contract implications . And "did I just break a consumer?" is exactly the kind of question it should be asking before it hands you a diff. Enter MCP If you haven't used it yet: the Model Context Protocol is a standard way to give AI agents tools — little capabilities they can call. Claude, Cursor, and others all speak it. Instead of the agent guessing, it can call a tool and get a real answer. So the fix is simple to state: give the agent a tool that answers "is this API change safe to ship to my consumers?" — and have it call that before it proposes the change. That's the hero

本文内容来源于互联网,版权归原作者所有
查看原文