---
title: "Hypermedia Friendly Model Context Protocol App Architecture"
description: "An MCP App for scheduling smartwatch workouts uses hypermedia instead of React by wiring the Fixi library to the MCP App Bridge, so any `fx-action` beginning with `tool:` calls `app.callServerTool` and swaps the returned HTML fragment into the iframe."
url: "https://swe.quest/articles/hypermedia-friendly-model-context-protocol-app-architecture-c26ac01ff088a07c"
canonical: "https://htmx.org/essays/mcp-apps-hypermedia/"
source: "htmx essays"
published: "2026-03-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["ai-agents","frontend","python","llms"]
---

# Hypermedia Friendly Model Context Protocol App Architecture

A post on [htmx essays](https://swe.quest/sources/htmx.md), published 2026-03-18, 13 min read, Case study. Original: [https://htmx.org/essays/mcp-apps-hypermedia/](https://htmx.org/essays/mcp-apps-hypermedia/)

## Summary

An MCP App for scheduling smartwatch workouts uses hypermedia instead of React by wiring the Fixi library to the MCP App Bridge, so any \`fx-action\` beginning with \`tool:\` calls \`app.callServerTool\` and swaps the returned HTML fragment into the iframe. The backend is a Django ASGI plus FastMCP monolith that shares the ORM and templates, using Django 6 template partials to render both the initial UI and dynamic fragments from a single file. This keeps the LLM out of the loop for form interactions like picking events and occurrences, which reduces friction and token use. The approach builds on a small workout DSL with a recursive descent parser that LLMs translate natural-language workouts into, outputting formats for Apple and Garmin watches.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Python](https://swe.quest/tags/python.md) (Languages)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- Model Context Protocol basics
- Django templates
- htmx-style hypermedia

## Keywords

MCP Apps, Model Context Protocol, Fixi, htmx, FastMCP, Django, speedystride

## Related posts

- [MCP UI: Breaking the text wall with interactive components](https://swe.quest/articles/mcp-ui-breaking-the-text-wall-with-interactive-components-5c6a56be154e7a75.md): Shopify Engineering · 2025-08-05 · Easy · 4 min read · AI agents, Frontend, E-commerce, API design
  MCP UI extends the Model Context Protocol so servers can return interactive UI components, such as product selectors, galleries and cart flows, as embedded ui:// resources alongside JSON data.
- [Implementing MCP Servers in Python: An AI Shopping Assistant with Gradio](https://swe.quest/articles/implementing-mcp-servers-in-python-an-ai-shopping-assistant-with-gradio-21ac8e123355c19a.md): Hugging Face · 2025-07-31 · Medium · 4 min read · AI agents, Python, LLMs
  Gradio's MCP integration turns Python functions into LLM tools: launching an app with mcp\_server=True exposes each endpoint as an MCP tool, with names, descriptions and input schemas generated from function docstrings, plus progress streaming and file upload handling.
- [Tiny Agents: an MCP-powered agent in 50 lines of code](https://swe.quest/articles/tiny-agents-an-mcp-powered-agent-in-50-lines-of-code-6bc1baf5d192d871.md): Hugging Face · 2025-04-25 · Medium · 10 min read · AI agents, LLMs, TypeScript
  An LLM agent built on the Model Context Protocol reduces to a simple while loop around an MCP-aware inference client: connect to MCP servers, convert their tools into OpenAI-style function definitions, pass them to the chat-completion call, execute returned tool calls via the MCP SDK, and feed results back.
- [Tiny Agents in Python: a MCP-powered agent in ~70 lines of code](https://swe.quest/articles/tiny-agents-in-python-a-mcp-powered-agent-in-70-lines-of-code-ec89d52eb52d9576.md): Hugging Face · 2025-05-23 · Medium · 16 min read · AI agents, LLMs, Python
  Hugging Face's huggingface\_hub Python SDK now includes an MCP client and a minimal Agent class, letting an LLM pull tools from MCP servers (stdio, SSE or streamable HTTP) and call them during inference.
- [What’s MCP all about? Comparing MCP with LLM function calling](https://swe.quest/articles/what-s-mcp-all-about-comparing-mcp-with-llm-function-calling-fcce1ee01a7d0aed.md): Neon · 2025-03-12 · Medium · 5 min read · AI agents, LLMs, TypeScript
  The Model Context Protocol (MCP) builds on LLM function calling by moving tool definitions and execution out of individual LLM applications into standalone servers that any MCP-compatible client can discover and invoke.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
