logoalt Hacker News

cyberge99yesterday at 10:56 PM2 repliesview on HN

> I did something a little bit hacky: if the request is for GET /mcp and the Accept header includes text/html and NOT application/json or text/event-stream, I return a HTML page

Is this not the intended use of request headers?


Replies

PufPufPufyesterday at 10:59 PM

Technically not really, it's supposed to be alternative versions of the same content.

lorecoreyesterday at 10:58 PM

I think so, but if you wanted to be pedantic you could make the argument that the same resource is not being served with the different Accept header. A welcome page is not the same thing as the JSON returned from the MCP spec.

show 1 reply