为Claude搭建WordPress MCP服务器:利用AI自动发布博客文章
Building a WordPress MCP Server for Claude: Automating Blog Posts with AI

原始链接: https://val.demar.in/2025/06/building-a-wordpress-mcp-server-for-claude-automating-blog-posts-with-ai/

我构建了一个自定义的模型上下文协议 (MCP) 服务器,用于将 Claude(AI 助手)直接连接到我的 WordPress 博客,从而实现博客文章的自动化创建。这个简化的工作流程消除了复制粘贴的步骤,允许 Claude 直接发布到 WordPress。该服务器使用 TypeScript 和 MCP SDK 构建,利用 WordPress REST API 进行安全身份验证,并为 Claude 提供创建格式化文章、管理类别和标签、检索博客信息以及更新现有文章等功能。Claude 现在可以在一次对话中完成研究、撰写、格式化、分类和发布文章。该集成还处理 SEO 元数据、自定义 URL 链接和草稿创建,显著增强了 AI 辅助内容创作,同时保持了编辑控制。虽然我更倾向于使用 ChatGPT,但这个由与 Dave 的一次对话激发的自动化流程,代表了博客写作的一个飞跃。

Hacker News上的一篇帖子讨论了一位名为MaysonL的用户,他使用大型语言模型Claude构建了一个WordPress“MCP服务器”来自动化其博客的内容创作。其目标是让Claude直接负责博客文章的研究、撰写、排版、分类和发布。 评论大多持批评态度。用户质疑,当他们可以直接向Claude提问时,阅读一篇由大型语言模型生成的博客文章有何价值。一些人担心博客文章会缺乏深度和原创性。一位用户开玩笑地问作者是否故意选择了一个在HN上不受欢迎的话题。其他人则指出,自动化一个从本质上消除了博客中人文元素的过程具有讽刺意味。“Enshitification”(平台质量下降)的概念也被提及。 帖子中还讨论了“工具”和“MCP”(管理控制程序)之间的关系,一位用户澄清说MCP“提供/服务工具”。
相关文章

原文

Building a custom MCP server to connect Claude directly to WordPress, enabling automated blog post creation with proper formatting and intelligent categorisation.

Third day, third MCP experiment (inspired by a quick conversation with Dave).

This time I connected Claude with this WordPress blog.

At the end of the chat that I used for the whole process of writing, building and installing the tool on my Mac, I asked Claude to write a post about the experience.

Of course I wouldn’t allow Claude to post unsupervised original stuff to my blog like I just did, but as Dave was pointing out, these are our new writing tools, being able to post directly without having to copy and paste just makes sense.

To be honest I would rather do this with ChatGPT, but apparently MCP integration is not available yet in the UK yet.

Check below to see Claude’s original post.

PS: it also categorised and tagged the post automagically ❤️


The Challenge

As someone who’s been blogging since 2002, I’ve always looked for ways to streamline my writing workflow. With the rise of AI assistants like Claude, I wanted to explore how I could automate blog post creation while maintaining quality and proper formatting.

The Solution: A Custom MCP Server

Today I built a custom Model Context Protocol (MCP) server that connects Claude directly to my WordPress blog. This server handles all the technical complexity of the WordPress REST API whilst providing Claude with simple, powerful tools for content management.

What It Does

The WordPress MCP server provides Claude with three main capabilities:

  • Create posts with properly formatted HTML content
  • Manage categories and tags automatically (creating new ones when needed)
  • Retrieve blog information including existing categories, tags, and recent posts
  • Update existing posts and change their publication status

The server intelligently handles WordPress authentication using application passwords and can publish posts immediately or save them as drafts for later review.

Technical Implementation

Built in TypeScript using the MCP SDK, the server:

  • Uses WordPress’s REST API with secure authentication
  • Automatically creates missing categories and tags
  • Supports SEO meta descriptions and custom URL slugs
  • Handles both immediate publishing and draft creation
  • Provides comprehensive error handling and logging

The Result

I can now ask Claude to research a topic, write a well-structured blog post with proper HTML formatting, categorise it appropriately, and publish it directly to my blog—all in a single conversation. This represents a significant leap forward in AI-assisted content creation whilst maintaining editorial control.

The integration feels seamless and natural, exactly what you’d expect from a mature AI workflow tool.

联系我们 contact @ memedata.com