10k+ stars,3 个月新项目。”The CMS for you and your agent”——不是给 CMS 加 AI,是 从 schema 到 admin 全程为 Agent 设计
写在前面
WordPress 统治 CMS 二十年,问题是 2026 年的 AI agent 想往里写内容,得破解 PHP、摸清 plugin 钩子、绕过安全限制。Ghost / Strapi / Sanity / Contentful 各有取舍,但没有一款 把 agent 当一等公民。
EmDash CMS(MIT,10k+ stars,TypeScript,Astro 原生)是这样定位的:“The CMS for you and your agent”——schema 用 seed file 写,自动生成 TypeScript 类型 + 跑 migration;admin 后台给人类用,MCP server 暴露给 agent;插件系统基于 secure execution context + scoped permissions,不再有 ” 装个 plugin 整站被黑 ” 的隐患。
它不是 WordPress 的克隆,是 “WordPress 的精神 + Astro 的速度 + TypeScript 的安全 + Agent 的 API-first”。
一、它解决什么问题
| 维度 | 数据 |
|---|---|
| 仓库 | emdash-cms/emdash |
| 官网 | emdashcms.com |
| 协议 | MIT |
| Stars / Forks | 10,839 / 987 |
| Open Issues | 202(项目早期,正常) |
| 最近 commit | 2026-06-18(昨天,超活跃) |
| 体积 | 36 MB |
| 框架 | Astro + TypeScript 全栈 |
| 部署 | Cloudflare 一键 |
| 创建 | npm create emdash |
一句话定位 :Astro 全栈 CMS, 为人类和 AI agent 同时设计,带 MCP server。
二、核心机制:seed-file schema + 自动类型 + MCP server
EmDash 的核心设计是 ”schema 在前端,类型自动生成,DB 自动迁移 “——这跟传统 CMS(” 装个 plugin 在 admin 里点 ”) 是完全不同的范式。
1. seed-file schema(schema 即代码)
不是 ” 在 admin 后台定义 content type”,而是 写一个 seed.ts 文件:
// seed.ts
export const schema = {
types: {
Post: {
fields: {title: { type: 'string', required: true},
body: {type: 'markdown'},
author: {type: 'relation', ref: 'User'},
tags: {type: 'relation[]', ref: 'Tag' },
publishedAt: {type: 'datetime'},
},
},
User: {...},
Tag: {...},
},
};
跑 npm run dev:
- 自动生成 TypeScript 类型
- 自动跑数据库 migration
- admin 后台立刻看到新字段
好处:schema 进 git,PR review 时能看清改了啥;agent 改 schema 是 PR 流程,不需要 admin 权限。
2. MCP server(agent 的入口)
EmDash 内置 MCP server,暴露:
- content(读 / 写 / 改)
- schema(读 / 改 seed)
- media(上传 / 替换)
- taxonomies / menus / revisions
接 Claude / OpenCode / Cursor / 任何 MCP-aware 工具,agent 可以:
“ 帮我在 EmDash 里建一个 Article 类型,有 title/body/author/publishedAt 字段,然后用它发一篇博客讲 MCP”
admin 后台能做的,agent 都能做——但 agent 还能做 ” 批量改 100 篇文章的 slug” 这种 admin 干不了的活。
3. Astro-native(前端框架一等公民)
不是 ” 无头 CMS”(只给 API),是Astro 一等公民集成:
- 服务端渲染 pages
- Content loaders(从 EmDash 拉数据到 Astro)
- Image components(自动优化)
- JSON structured content(schema 即 JSON Schema)
部署到 Cloudflare Pages 一键,TypeScript full-stack,没有 PHP。
三、差异化:plugin 模型 + 完整 admin 能力
1. 安全的插件模型(不再有 WordPress plugin 噩梦)
| 维度 | WordPress | EmDash |
|---|---|---|
| 插件执行 | 全站权限,能改 DB | Secure execution context |
| 插件权限 | 默认全部 | Scoped permissions |
| 插件破坏面 | 一个坏 plugin = 整站被黑 | 插件只能动它声明的范围 |
| 装一个坏 plugin 后果 | 你的站被挂马 / 改首页 | 插件挂掉,主体不动 |
EmDash 插件可以做:
- 自定义 block types(编辑器的 ” 小工具 ”)
- 自定义 admin pages(后台菜单项)
- hooks(保存 / 发布时的回调)
- storage(自定义存储后端)
- 已有插件样例:GTM / GA4 / Search Console / UTM / AI call tracking
2. 完整 admin 后台(不只是 API)
| 能力 | EmDash |
|---|---|
| 草稿(drafts) | ✅ |
| 修订版本(revisions) | ✅ |
| 定时发布(scheduling) | ✅ |
| 全文搜索(full-text search) | ✅ |
| 分类法(taxonomies) | ✅ |
| 菜单(menus) | ✅ |
| 实时预览(live preview) | ✅ |
| 自定义内容类型 | ✅ seed file |
“everything you love about WordPress, with lightning-fast admin” —— 官方原话。
四、工具能力对照
| 能力 | EmDash |
|---|---|
| Schema 即代码(seed file) | ✅ 自动类型 + migration |
| TypeScript full-stack | ✅ 端到端类型 |
| Astro 一等公民 | ✅ 服务端渲染 + content loaders |
| MCP server 原生 | ✅ Claude / OpenCode 直连 |
| 完整 admin 后台 | ✅ drafts / revisions / 搜索 / 菜单 |
| 安全插件模型 | ✅ scoped permissions |
| 部署 | ✅ Cloudflare 一键 |
| 自定义内容类型 | ✅ 不限 Posts / Pages |
| 关系字段 | ✅ relation / relation[] |
| 实时预览 | ✅ |
| 多语言 | ✅(schema 层支持) |
| 许可 | MIT |
五、对比:WordPress / Ghost / Strapi / Sanity
| 维度 | WordPress | Ghost | Strapi | Sanity (云) | EmDash |
|---|---|---|---|---|---|
| 底层语言 | PHP | Node.js | Node.js | 云服务 | TypeScript + Astro |
| Schema 定义 | admin 后台 | admin 后台 | admin 后台 | Schema Studio | seed.ts(代码) |
| 部署 | VPS / 托管 | 容器 | 容器 / 云 | 必上云 | Cloudflare 一键 |
| AI Agent 友好 | ❌ 需破解 plugin | ⚠️ 有 API 但无 MCP | ⚠️ 有 REST/GraphQL | ✅ 有 API | ✅ MCP 原生 |
| 插件安全 | ❌ 整站权限 | ⚠️ 主题 hack | ✅ 隔离 | ✅ Studio 隔离 | ✅ scoped permissions |
| 启动速度 | 慢 | 中 | 中 | 快 | 快 |
| TypeScript 全栈 | ❌ | ⚠️ 部分 | ⚠️ 部分 | ❌ | ✅ 端到端 |
| 学习曲线 | 低 | 中 | 中 | 低 | 中(要会 Astro) |
| 适合场景 | 通用站 | 博客 / newsletter | 内容站 | 企业内容 | Agent / 微站 / 博客 |
结论:WordPress 是 ” 老牌但过时 ”,Ghost 是 ” 博客专用 ”,Strapi/Sanity 是 ” 无头 + admin”,EmDash 是 ”Astro + MCP + 安全插件 ” 新一类。
六、实战:3 步跑通
Step 1:创建项目
npm create emdash my-site
cd my-site
Step 2:写 schema
// seed.ts
export const schema = {
types: {
Post: {
fields: {title: { type: 'string', required: true},
body: {type: 'markdown'},
author: {type: 'relation', ref: 'User'},
publishedAt: {type: 'datetime'},
},
},
},
};
跑 npm run dev → 自动生成类型 + 跑 migration + admin 后台 ready。
Step 3:接 MCP 到你的 agent
EmDash MCP server 启动后,把 endpoint 配到 Claude / OpenCode 的 MCP config:
{
"mcpServers": {
"emdash": {
"command": "npx",
"args": ["-y", "emdash-mcp"],
"env": {"EMDASH_URL": "http://localhost:3000"}
}
}
}
之后 agent 能直接读 / 写 / 改 / 发内容。
七、决策表(按场景推荐)
| 场景 | 推荐 | 理由 |
|---|---|---|
| 你是 INTP / 程序员,要自建内容站 | ✅ EmDash | schema 进 git,type-safe |
| 你想让 AI agent 帮你管内容 | ✅ EmDash | MCP 原生 |
| 你想用 WordPress 流程但不要 PHP | ✅ EmDash | admin 体验对标 WP |
| 你不想被 Cloudflare 锁 | ⚠️ 可自托管但官方主推 CF | 关注未来 |
| 你只是要个 blog 写写东西 | ⚠️ Ghost 可能更轻 | 看个人偏好 |
| 你是大厂内容编辑,要 workflow 审批 | ❌ 早期 | 等生态成熟 |
| 你要 100% 控制前端 | ✅ EmDash | Astro 全栈,前端自由 |
八、风险与坑
- 项目早期 —— 2026-04 才创建,3 个月,202 open issues。bug 多、API 变、文档不全都正常
- Astro 学习曲线 —— 不熟 Astro 的前端开发上手成本高
- Cloudflare 绑定 —— 官方主推 Cloudflare Pages,自托管路径存在但相对新
- 202 open issues —— 在写本文时还没清理;要看 GitHub 项目的 issue 响应速度
- MCP server 早期 —— 协议刚稳定,agent 集成可能要踩坑
- 插件生态刚刚开始 —— 已有的几个 plugin(GTM / GA4 等)都是 ” 够用 ”, 还没形成像 WordPress 那样的 marketplace
- TypeScript 全栈 —— 你得熟悉 TS,如果团队是 Python/PHP 背景会有学习成本
九、总结
EmDash 最值得装的 3 个理由:
- MCP 原生 —— AI agent 管理内容 不再需要 hack,是 ” 一等公民 ”
- schema 即代码(seed.ts) —— schema 改动进 git,agent 改 schema 是 PR 流程,不是 admin 误操作
- 安全插件模型(scoped permissions) —— 彻底告别 ” 装个 plugin 整站被黑 ” 的 WordPress 噩梦
先试一周:用 npm create emdash 起个 blog,让 Claude / OpenCode 通过 MCP 帮你发 3 篇文章 。如果 agent 顺畅接管内容工作流, 你会重新评估 ”AI 时代的 CMS 应该是啥 ”。
参考
- emdash-cms/emdash · GitHub — 官方仓库(10k+ stars)
- EmDash 官网 — 项目主页 + playground
- TEMPLATES.md — 模板列表
- playwright.config.ts — e2e 测试配置
- Joost de Valk / Brian Coords 推荐 — Yoast 创始人 / Automattic 开发者背书
- Rimander/emdash — 个人 fork(740 commits,原作者或早期贡献者)
- 启动:
npm create emdash - 部署: Cloudflare Pages 一键
- 集成: MCP server(Claude / OpenCode / Cursor 直连)