Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Why did we not use REST HATEOAS instead of MCP (fieldmappings.com)
12 points by joeyguerra 13 hours ago | past | favorite | 10 comments
 help



I built an app that uses Claude to manage a blog. The latest post is an exploration of HATEOAS vs MCP.

> Hypermedia pays off over years: clients that don't break when the workflow changes,

Except they do, when you deploy your application and the HTML on the client isn't compatible with what the server responds to. The problem doesn't go away at all. A good MCP client reloads the tools.

> and fewer wrong calls to debug.

A failed call should return the reason for the failure in natural language. If your MCP returns mysterious errors, the agent won't be able to recover. If your REST endpoint returns mysterious errors, the client fails also and then some human down the road has to puzzle over it.

There's three benefits here that are missed that support MCP:

1. The interface can change without changing the client. Add a new parameter. Change the whole tool. Doesn't matter. The agent gets a fresh schema every time. You never think about forwards or backwards compatibility, API versioning, /v1/ prefixes, whatever.

2. It's 100% self documenting. The schema is in the protocol. You can serve OpenAPI of your rest endpoint, but there's no standard for how to find it. Agents don't need to look up how to use your tool on your docs site every time they get a fresh context window with MCP.

3. MCP has auth built in. Calling a REST endpoint means handling keys. Every harness that uses your REST API needs a way to store the key and to know how to inject it into requests. It needs a way to trigger and handle OAuth. MCP has it built in. Any client and any server built against MCP speak the same auth.

But here's really where the article misses the point:

> First a small demo: one order workflow with 12 actions, exposed two ways. One side is a minimal MCP server.

That's not a plausible use case for MCP in the first place. A Shopify store isn't going to ship an MCP. I, as a user, am not going to copy their MCP URL and add a new Claude plugin to place an order on a website.

I'm installing an MCP for Kagi so my agent can search the Web. I'm installing Figma so Claude Code can pull my brand identity and export SVGs. Imagine if Claude had to figure out Figma's REST API every time it wanted to pull something for me, and then it needed its harness to intercept calls to inject a key that... somehow Claude Code knows how to maintain.

That's the whole point. I can click a few buttons and sign into Cloudflare, and now my agent can pull analytics data for my site. I prefer it! Cloudflare also has a great REST API that I could point Claude at, but I'd be forced to somehow set env vars with an API key that I now need to rotate regularly.


“Except they do, when you deploy your application and the HTML on the client isn't compatible with what the server responds to.”

Could you explain what you mean by this? There’s just one representation in question for HATEOAS, and it’s rendered by the server.

“ It's 100% self documenting. The schema is in the protocol.”

This is what HATEOAS means, except swap “protocol” for “representation.”

“ The interface can change without changing the client. Add a new parameter. Change the whole tool. Doesn't matter.”

This is exactly what REST is for. Some stupid people used the term incorrectly to talk about URI patterns and HTTP methods, but it has always actually been about hypermedia and nothing else.

“ MCP has auth built in. Calling a REST endpoint means handling keys.”

HTTP also has auth built in. And there’s no such thing as a “REST endpoint.”

https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypert...


>HTTP also has auth built in

Yes, but not in the way an MCP server can with a harness. The harness is responsible for performing the OAuth dance and providing the tools to the model.

I don't know of any harness that will do the same for normal HTTP requests. So, it would end up calling CURL or something through bash instead of just having the API readily available, which means you need a way for the auth to be secure (like putting it in an env var). You don't have to worry about this over MCP since the harness is doing that already.


I am really not following you here. If you are worried about lack of harness support, a trivial MCP bridge can be written to let harnesses interact with existing hypertext applications on HTTP. Or MCPs can themselves present generic tools that are a REST API. As Dr. Fielding said in the blog I linked, “A REST API should not be dependent on any single communication protocol.”

The trouble, which you identified correctly but named incorrectly, is that nearly all APIs that are called “REST” APIs do not in fact work via representational state transfer. However, the blog posted for this HN item does not make this common mistake. It is talking strictly about the hypertext-driven APIs that Fielding meant when he wrote his thesis.


> a trivial MCP bridge can be written to let harnesses interact with existing hypertext applications on HTTP

You must understand that the point is that the MCP part of the MCP bridge you're describing is the value add.

Let's assume MCP hasn't been invented. What do I add the hypertext application to in the harness (and the user doesn't know what a terminal or config file is) so that the model can safely talk to the application?


The harness needs some kind of tool, whether it's added via adding an MCP server or not. Adding an MCP server is the only extension mechanism we're given.

Claude has WebFetch already. If it had WebPost then it would be able to interact with most hypertext applications.

You can write and add an MCP server that does authenticated arbitrary HTTP calls trivially; there are dozens out there.

The key is that the web application has to describe the valid links in the resources you retrieve, and the agent has to navigate the application state by following those links and doing nothing else.

(WebFetch not allowing any kind of authenticated access is a design choice by the tool authors. I'm not sure why you seem to be holding harness developers' bad choices against an application architecture.)


I'm not arguing HATEOAS is worse, I'm pointing out that the things you say MCP doesn't do or doesn't solve are, indeed, things that it does do and solve. And more importantly, that MCP does things HATEOAS alone can't do.

> HTTP also has auth built in.

Sure, and how do I explain to my mom how to get a bearer token from an OAuth provider to pass it to her agent's env vars? There's no standard that says for the harness how to authorize against an arbitrary HATEOAS server.

MCP could have been HATEOAS with some auth and ux standards bolted onto the side. But they used JSON Schema instead of HTML, and they could have put the schemas on the responses instead of shipping them in a tools payload, but those are just implementation details that don't really make it better or worse.

MCP specifies how a URL being entered into a client gets it authed with the host at that URL. Where does a HATEOAS equivalent define that?

> there’s no such thing as a “REST endpoint.”

Sure, call it whatever you want. This is just pedantry. This is the equivalent of being the "centrifugal force doesn't exist" guy.


Do you think your mom can authenticate using a web browser?

A harness tool for a HATEOAS application is just a web browser that an agent can use, too. Harnesses already do this. People love it, even though it’s slow. If web applications were authored sanely (i.e. they were actually REST as in Fielding), the whole DOM/JS stack of the browser would not be necessary for agents to use them. They don’t even need to render the pages. They just need to read link descriptions, follow links, and submit forms.

And you can implement a HATEOAS application through an MCP interface. I recommend it; it reduces the tool surface, makes it dead simple to add features, and reduces the number of errors the agent makes, as the blog poster said.

You can literally just access his HTML site in a generic web client MCP server and get whatever you think you’re getting out of MCP. The win is from his application design, not the harness’s tool specification.


This is a great idea. It’s a shame absolute morons ruined the term “REST” a decade or two ago, so now almost nobody understands it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: