Model Context Protocol in Practice: Wiring LLMs Directly into Production CMS Systems
Lessons from implementing Model Context Protocol (MCP) endpoints inside Cloudflare Workers so LLM agents can draft, update, and manage structured content autonomously.
August 2026
The transition from prompt-engineering chatbots to autonomous software agents depends on one fundamental primitive: structured tool execution with standard protocols. The Model Context Protocol (MCP) has rapidly become the standard interface for connecting reasoning models to operational data stores.
Here is how we architected our CMS at moseti.fikanova.com and fikanova.com so that agents like Claude or Antigravity can directly draft, format, and publish notes.
System Interaction Flow
Architecture Diagram
sequenceDiagram
autonumber
actor Author as Moseti / Agent
participant LLM as LLM Agent (Claude/Antigravity)
participant MCP as EmDash MCP (/_emdash/api/mcp)
participant D1 as Cloudflare D1 Database
participant Site as Public /notes Site
Author->>LLM: 'Draft an essay on edge architecture'
LLM->>LLM: Generate structured markdown + diagrams
LLM->>MCP: call content_create(collection='notes', status='draft')
MCP->>D1: Insert note record & generate revision
D1-->>MCP: Confirmation { id: 'edge-architecture-note' }
MCP-->>LLM: Draft saved successfully
Author->>MCP: Review in /_emdash/admin & publish (or call content_publish)
MCP->>D1: Set status='published'
D1-->>Site: Live on moseti.fikanova.com/notes
Key Lessons Learned
- Strict Schema Validation: Agents require precise JSON schema definitions for tool parameters. Ambiguous field types lead to hallucinated argument keys.
- Draft Gates: Autonomous systems should default to status: 'draft', allowing human review or automated pre-flight checks before content goes live to public CDN caches.
- Bidirectional Markdown-PortableText Translation: Allowing agents to write native Markdown while storing structured blocks in D1 ensures you get both the power of rich-text visual editing and seamless LLM agent compatibility.
By exposing /notes through MCP, writing is no longer a chore confined to a browser tab—it is an integrated workflow accessible directly from your terminal or AI pair programmer.