我如何使用 AI Agents + MCP 完全自动化我的网站内容

发布: (2026年1月15日 GMT+8 03:29)
6 min read
原文: Dev.to

Source: Dev.to

在 AI 之前

首先,让我告诉你在我的站点上添加新播客集的过程是怎样的。我使用 Nuxt Content,所以每一期播客只是一个带有 YAML 前置数据的 markdown 文件。这个 YAML 包含日期、播客名称、图片 URL、主持人等信息。

去年,我只是打开旧的播客集, 在 VS Code 中点击 Duplicate(复制),然后把所有内容改成新播客的信息。换句话说,我手动完成以下步骤:

  1. 点击新集的链接。
  2. 将托管网站上的信息复制粘贴到我的 markdown 文件中。
  3. 下载集的封面图片,上传到 Cloudinary,复制 Cloudinary 的图片名称并粘贴到文件中。

Cloudinary 在管理图片和保持站点性能方面非常出色,但下载再上传图片的额外工作非常繁琐。有时我会因为懒得去做而拖延很久才添加新集。

Automating with Prompts and the Playwright MCP

我开始通过在 VS Code 中使用可复用的提示来自动化部分流程。我为 Copilot 编写了指令,然后点击 Play 按钮在新聊天中运行提示,并提供了播客的 URL。

在安装了 Playwright MCP 后,Copilot 能够导航到托管播客的 URL 并提取相关元数据。它运行良好,节省了大量时间,甚至通过提供多个 URL 实现了批量更新。

不过,图像处理仍然是个问题。我曾动摇想停止使用 Cloudinary,而直接将图像存放在站点的 public 文件夹中,但这会失去 Cloudinary 的优化优势。

使用 Goose、Playwright MCP、Cloudinary MCP 与 GitHub MCP 实现自动化

接下来我尝试了 Goose,它是 Block 提供的编码代理。Goose 是一个桌面应用(也提供 CLI 选项),可以运行“配方”——本质上是带参数的提示。我把已有的提示复制到 Goose 中并保存为配方,同时将播客 URL 设为参数。

新工作流的样子

  1. Playwright MCP 访问播客页面并提取所有所需信息,包括图片 URL。
  2. Goose 将图片下载到本地。
  3. Cloudinary MCP 使用扩展设置中存储的 API Key 将图片上传到我的 Cloudinary 账户,并自动选择正确的文件夹。
  4. Goose 使用正确的 Cloudinary 图片 ID 写入 markdown 文件。
  5. 通过 GitHub MCP,Goose 创建一个包含新剧集文件的 Pull Request。

我甚至可以让 Goose 启动开发服务器,并使用 Playwright 验证更改,截取播客页面的截图以确认一切显示正常。

cloudinary mcp in goose

一切顺利运行。PR 合并后,新播客剧集便出现在我的站点上,并使用了经过适当优化的 Cloudinary 图片。

结论

花了一些时间来弄清所有细节并搭建流程,确实,对于单个剧集来说,复制粘贴会更快。但现在工作流已经实现自动化:下次想要添加播客剧集时,我只需运行我的 Goose 配方并传入播客 URL。整个管道——从元数据提取到图片上传再到 PR 创建——都会自动完成。

I am a guest on one tonight so when that is out I will be able to add it easily to the site. In fact, if I had a team of people working on my site I could even share the recipe with them and they could simply run it.

I am using **Nuxt Content** for my site, which means I have no CMS. My content lives in markdown files and it makes it very easy as a developer to add content but perhaps not so easy for non‑developers. But now, even my mother could add a new podcast episode to my site. That is just amazing. This is just my personal site but think about the possibilities of this use case for many other businesses.

I am very impressed with what **Goose** can do. The more I am using it, the more it is blowing my mind. I am now going to go ahead and add other **recipes** for the rest of the content I add, or perhaps just modify this recipe with parameters so I can have one recipe. I shall keep playing around. This is fun.

Let me know if you found this interesting, are doing something similar, or have used any of the MCPs mentioned above. We are living in exciting times, so if you haven't started to experiment yet then what are you waiting for? Just play around and have fun.
Back to Blog

相关文章

阅读更多 »

Rapg:基于 TUI 的密钥管理器

我们都有这种经历。你加入一个新项目,首先听到的就是:“在 Slack 的置顶消息里查找 .env 文件”。或者你有多个 .env …

技术是赋能者,而非救世主

为什么思考的清晰度比你使用的工具更重要。Technology 常被视为一种魔法开关——只要打开,它就能让一切改善。新的 software,...

踏入 agentic coding

使用 Copilot Agent 的经验 我主要使用 GitHub Copilot 进行 inline edits 和 PR reviews,让我的大脑完成大部分思考。最近我决定 t...