HATEOAS vs MCP: Hypermedia Wins on Invalid Calls

Diagram comparing HATEOAS vs MCP for AI agents using an order workflow

A new experiment pits HATEOAS against MCP for AI agents and finds that hypermedia stops invalid actions before they happen. In a test with an order workflow of 12 actions, an MCP server rejected all 4 deliberately invalid steps, while the HTML version never offered them at all.

The result revives a 26-year-old REST idea just as the Model Context Protocol becomes the default way to connect agents to services.

Two ways to tell an agent what it can do

Any agent talking to a service has to learn what it may do at that moment. Can this order still be cancelled? Is payment allowed? REST’s answer, laid out by Roy Fielding in 2000, is hypermedia as the engine of application state, or HATEOAS. The server returns the current state along with the links and forms that are valid from it. A browser has always worked this way.

MCP works differently. When an agent connects, the server sends a full list of tools, each with a JSON schema. The agent chooses one, calls it, and learns whether that was valid only from the result.

How the test was built

The developer started with a small demo: one order workflow, 12 actions, exposed as a minimal MCP server and as plain HTML with links and forms. They then built The Field Map, a working store for their own merchandise with carts, checkout, payments, cancellations and returns. People shop in a browser, and agents shop through /mcp. Both run on the same database and the same order rules. Payments use test mode, so all measurements involve test cards.

What the numbers show

MCP is the smaller option per purchase. HTML pages carry navigation, labels and markup that a model doesn’t need, and that cost is real. Two MCP costs show up too. The tool catalog takes almost 5 KB before the agent does anything, and it grows with every added tool. The MCP spec also asks tools that return structured data to repeat it as serialized text for older clients, so each result carries its data twice.

Wrong turns told the opposite story. In a run with 4 steps that were invalid in the current state:

  • MCP sent 4 calls and the server rejected all 4.
  • HTML produced 0 failed requests, because the invalid steps were never on the page.

The client doesn’t get smarter under hypermedia. The server simply reports what is allowed at each step, whereas MCP waits for a bad call and then answers with an error.

The caveat: these were scripted clients, not a model making its own choices.

Why hypermedia lost anyway

The developer blames effort. With JSON over RPC a team writes one endpoint per action and ships. Hypermedia makes designers decide, for every resource, what a client may do in each possible state. That is a question about how the business really runs, and it has nothing to do with data formats.

Building the store showed the catch. To make the MCP side safe, every order it returns includes an available_actions list, such as pay and cancel before payment, and only cancel afterward. One function derives that list from the order’s state, and the same function decides which buttons the HTML order page shows. So the hypermedia work still happened. It was just bolted onto a protocol with no native place for it.

In other words, a dependable agent integration needs the same effort hypermedia asks for. MCP leaves that effort optional, and optional tasks get dropped when deadlines loom.

Not a technical limit

Since the mid-1990s, HTML forms have spelled out allowed actions, allowed values (select options, minimums, maximums) and the target address. An agent can read all that on the store today. The developer’s best guess for why the industry built something new is short-term thinking: RPC ships faster this quarter, while hypermedia pays off over years through clients that don’t break when a workflow changes. A fresh protocol also gives everyone something to announce.

What comes next for HATEOAS and MCP

The next test is a real agent working against both sides of the store, with its own choices rather than scripts. Until that run is done, the current figures show a trade, not a verdict: smaller payloads for MCP, fewer invalid calls for hypermedia. Teams building MCP servers can borrow the lesson now by returning an available-actions list with every resource, which is the one piece of hypermedia the experiment found they would need anyway.

Source: Field Mappings

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.