# Turning Hypermedia APIs into MCPs

DevFeed: [Turning Hypermedia APIs into MCPs](<https://devfeed.tech/articles/turning-hypermedia-apis-into-mcps-20523.md>)

Original publisher: [Read original article](<https://code.dblock.org/2025/09/18/turning-hypermedia-apis-into-mcps.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2025-09-18T09:00:00Z

Content type: tutorial

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [Model Context Protocol (MCP)](<https://devfeed.tech/topics/model-context-protocol-mcp.md>), [MCP Server](<https://devfeed.tech/topics/mcp-server.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Slack](<https://devfeed.tech/topics/slack.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [api-design](<https://devfeed.tech/tags/api-design.md>), [apis](<https://devfeed.tech/tags/apis.md>), [hypermedia](<https://devfeed.tech/tags/hypermedia.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [mcp-server](<https://devfeed.tech/tags/mcp-server.md>), [mcps](<https://devfeed.tech/tags/mcps.md>), [model-context-protocol](<https://devfeed.tech/tags/model-context-protocol.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [rest](<https://devfeed.tech/tags/rest.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [slack](<https://devfeed.tech/tags/slack.md>)

## AI overview

This tutorial shows how to expose a Hypermedia API as an MCP server using the Ruby gem hyperclient-mcp. It uses the open-source S'Up Slack bot to demonstrate resource discovery, starting the server, connecting it to Claude, and querying bot and team information.

## Source excerpt

I've written and talked extensively about Hypermedia APIs for about a decade. The HATEOAS constraints in representing resources for a RESTful API has numerous advantages in API design, readability, discoverability, and performance over a hand-rolled REST API. Unfortunately, adoption of Hypermedia APIs is very low compared to, for example GraphQL, but I find the implementation a lot simpler and continue adding Hypermedia APIs to my pet projects. At its root a Hypermedia API looks like so. { "_links": { "self": { "href": "https://sup2.playplay.io/api" }, "status": { "href": "https://sup2.playplay.io/api/status" }, "team": { "href": "https://sup2.playplay.io/api/teams/{id}", "templated": true }, ... } } The above example is an extract from this API. For this post we will use one of my Slack bots called S'Up, which generates fresh triads of team members in Slack to meet for coffee every week in an informal standup. The bot is open-source and you can try it here. Because the Hypermedia API structure is fixed with only "resources" and "links" (and similar to API frameworks such as GraphQL) you don't need an application-specific client to interact with the API. In Ruby, the most popular generic Hypermedia client is Hyperclient. With the API above, a client can retrieve the bot status, and using an API token obtained from an existing installation some team information. api = Hyperclient.new('https://sup2.playplay.io/api') do |client| client.headers['X-Access-Token'] = ENV.fetch('TOKEN', nil) end status = api.status puts "Bot is #{status.ping['presence']['presence']}." team = api.team(id: '1234') puts "Team name is '#{team.name}'." This will output "Bot is online." and "Team name is 'dblock'." for my installation. In this case, the generic client knew nothing about "team" - it was discovered programmatically and was, in a way, self-documenting. Unsurprisingly, this idea of templated resources is reused almost exactly the same way in the model context protocol (MCP). Therefor