marcinklimek's avatar
18 days ago
Status:
New

API Drift: Keeping Your APIs in Perfect Sync [SmartBear MCP Hackathon]

We’ve been exploring an idea that tackles a pretty common pain point for API teams: keeping everything in sync between what’s actually running in production and what’s documented or tested. We're calling this experiment API Drift, and it’s built as an MCP server tool to detect and automatically resolve inconsistencies between live APIs, Swagger documentation, and PactFlow contracts.

Check the YouTube video.

The Problem

If you’ve worked on APIs long enough, you’ve probably run into this. Someone ships a change, adds an endpoint, or tweaks a response structure, but the Swagger file doesn’t get updated right away. Then, a few weeks later, the contract tests start failing, or someone realizes an endpoint exists in production that isn’t documented anywhere. Suddenly, everyone’s trying to figure out what the source of truth.

That slow divergence between code, documentation, and tests is what I mean by API drift. It’s subtle, but it causes real headaches. Outdated Swagger specs, missing endpoints, and broken contracts. Over time, it chips away at developer confidence and makes it harder to move fast safely.

The Solution

For API Drift, we prototyped the Detect API Drift MCP tool to automate this entire process. It compares your live API traffic (using BugSnag data) with the existing OpenAPI spec and PactFlow contracts. When it spots undocumented or outdated endpoints, it can update your OpenAPI definition locally, bump the version, and publish the new spec straight to SwaggerHub. It even reviews your PactFlow tests and regenerates them if needed. No manual test runs required.

All of this happens through MCP Copilot, so you can trigger the process with a simple prompt. For example:

Use the MCP detect api drift tool to check my APIs

If you discover undocumented APIs:
1. Update the OpenAPI document locally, based on your knowledge of the API server
2. Publish a new version of the Open API to SwaggerHub (incrementing the patch version), using SmartBear MCP tools
3. Review pact tests. Do not run any test. If the API client uses these undocumented endpoints, ensure they have test coverage. Use the contract-testing_generate_pact_tests MCP tool to generate this

From there, the tool handles the analysis, documentation update, and contract alignment automatically.

Why It Matters

The purpose of this prototype is to show how SmartBear MCP Server can remove friction. Instead of spending hours auditing endpoints or rewriting specs, teams get instant synchronization between live code, documentation, and tests. It’s especially powerful for larger APIs where manual tracking just doesn’t scale.

By automating what is a tedious, error-prone process, API Drift helps teams move faster with more confidence. The end result: APIs that stay accurate, reliable, and always in sync with reality.

This prototype is still in its concept phase. We’d love to hear what you think. Have you faced API drift in your teams? What other data sources or integrations would make this even more powerful?

Let’s discuss in the comments. We're curious to hear if you would like to see API Drift becoming an actual tool of SmartBear MCP Server.

No CommentsBe the first to comment