Jun Yuan
Back to List

Blog Meets MCP: AI Agents Maintain Content

Blog Meets MCP: AI Agents Maintain Content
How this blog connects to AI agents via MCP/OpenAPI — motivation, workflow, and reflections, without manual layout work.

For a long time, running a personal blog meant two kinds of work I never really enjoyed: adjusting layouts by hand, and turning raw ideas into finished articles one paragraph at a time. The content was the part I cared about; the plumbing around it was not. This post is about removing that plumbing — by exposing the blog's own content API as an MCP server so an AI agent can do the repetitive work, while I stay in charge of direction and taste.

What MCP Actually Changes

Model Context Protocol (MCP) is a simple idea: instead of teaching an AI agent about your API through prompts and hope, you describe your API once (here, through an OpenAPI document) and let an adapter turn every endpoint into a typed tool. The agent then discovers tools the same way it discovers any other capability — by name, schema, and description.

This blog system already had a tenant-scoped content API: create posts, upload media, manage categories, create and update projects. All it needed was a bridge. By pointing a local OpenAPI-to-MCP adapter at https://jyuan.online/api/v1/openapi.json, every one of those endpoints became a tool the agent can call directly. No server-side MCP deployment, no new backend — just a local process that reads the spec and speaks MCP over stdio.

Why I Built It (The Real Motivation)

I did not want to:

  • hand-tune layouts for every new article,
  • copy-paste images into the media library,
  • retype metadata, slugs, and excerpts,
  • or treat publishing as a chore that competes with writing.

What I wanted was a workflow where I describe what I want in natural language, and the agent handles the mechanical steps: drafting, attaching images, categorizing, and keeping a consistent structure. I still review before publishing — the API defaults to draft for exactly this reason — but the boring 80% is gone.

The Posting Flow

Here is the flow an agent follows when publishing through MCP:

Code and automation workflow

What the Agent Can Do Today

  • Create post drafts from Markdown, including headings, lists, code blocks (Mermaid included), blockquotes, and images using ![alt](media:MEDIA_ID).
  • Upload media either as a multipart file or by importing from a sourceUrl, then reuse the returned mediaId.
  • Create or reuse categories so articles stay organized without manual setup.
  • Manage projects: create drafts, update localized content, append progress updates with commit links.
  • Stay tenant-safe: every request goes to the tenant host, and the API key is validated against that host.

A Few of My Own Observations

  1. Defaults matter more than features. Making creation default to draft is the single most important safety decision. It turns the agent from a risk into an assistant.
  2. Markdown as the interchange format is underrated. By accepting Markdown and converting to rich text on the server, the agent can produce structured content without knowing the CMS's internal block model.
  3. Media IDs as first-class references keep images decoupled from posts. The same image can be reused, and the post body stays readable.
  4. Bilingual by construction is a big deal. Because the API accepts localized entries, one request can carry both English and Chinese versions, and SEO is computed per locale.
  5. The last mile is still human. An agent can draft, but tone, accuracy, and the decision to publish should stay with a person. Automation should remove friction, not judgment.

Closing

Connecting this blog to an MCP server did not make it "automatic" — it made it low-friction. The writing is still mine; the layout, media handling, and bookkeeping are not. If you are building a content platform, exposing a clean OpenAPI surface and letting a local adapter do the MCP translation is one of the highest-leverage, lowest-risk ways to bring AI agents into the workflow.

— written with the help of an AI agent, reviewed by a human.

Related Posts

You might also like

A Programmer's Days in the AI Boom: I Build Whatever I Need

A Programmer's Days in the AI Boom: I Build Whatever I Need

AI has improved faster than my sense of what my job even is. The hours after dinner go into handing tasks to agents and building my own systems. If I need something, I build it — bookkeeping, photo sync, my own deployment, all written and shipped by one person.

Read more