关于 blink-cms
blink-cms 是通过 `user-blink-mcp` 管理 blink.new 内容的技能,将 CMS 作为带版本记录和草稿管理的虚拟文件系统。适用于维护文档与博客的编辑和发布流程。
主要功能
- 01列出并读取 CMS 内容
- 02创建、更新和局部编辑文章
- 03发布文章并管理草稿
- 04文本与语义搜索
- 05查看和恢复版本
适用场景
- 01查找并阅读博客或文档
- 02以草稿方式撰写文章并发布
- 03替换文章中的指定段落
- 04检查草稿或恢复历史版本
MCP 相关
通过 `user-blink-mcp` MCP 服务调用 CMS 工具,完成内容检索、读写、草稿管理、发布和版本操作。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ blink-new/ claude --skill blink-cms安装后在 Claude Code 中输入/blink-cms确认已加载。
详细介绍
通过 MCP 使用 Blink CMS
使用 user-blink-mcp 服务,在 blink.new 上发布和管理内容。该 MCP 将 Blink CMS 视为虚拟文件系统,并内置版本管理和草稿管理功能。
快速参考
| 任务 | 工具 | 关键参数 |
|---|---|---|
| 列出内容 | cms_list_dir | path: "docs" 或 "blog" |
| 读取文章 | cms_read_file | path: "blog/article.mdx" |
| 创建/更新 | cms_write_file | path、content、publish |
| 编辑章节 | cms_search_replace | path、old_string、new_string |
| 发布 | cms_publish | paths: ["blog/x.mdx"] |
| 查找文本 | cms_grep | query、type |
| 语义搜索 | cms_search | query、type |
| 查看草稿 | cms_list_drafts | type |
| 版本历史 | cms_get_versions | path |
内容结构
/docs/ → Documentation (quickstart, pricing, reference, etc.)
/docs/build/ → Build guides (prompting, tutorials, web-apps)
/docs/extend/ → Backend features (database, auth, storage)
/docs/launch/ → Deployment (domains, analytics)
/blog/ → Blog articles
Frontmatter 结构
每篇文章都必须包含 frontmatter:
---
title: "Article Title"
description: "Brief summary for SEO and cards"
category: "Engineering" # Product, Engineering, Tutorial, Case Study
tags: ["AI", "Productivity"] # Free-form array
status: "published" # Overridden by publish action
---
类别:
Product— 公告、发布、功能更新Engineering— 技术深度解析、最佳实践Tutorial— 分步骤指南Case Study— 客户成功案例
创建新文章
cms_write_file(
path: "blog/my-article.mdx",
content: ---
title: "My Article Title"
description: "What this article is about"
category: "Engineering"
tags: ["AI", "Tips"]
---
## Introduction
Your content here with MDX components.
<Tip>Helpful tips use the Tip component.</Tip>
,
publish: false # Save as draft first
)
准备好后即可发布:
cms_publish(paths: ["blog/my-article.mdx"])
编辑现有文章
方法 1:全文重写(谨慎使用)
cms_write_file(path: "blog/article.mdx", content: "...full content...", publish: true)
方法 2:精准编辑(推荐)
cms_search_replace(
path: "blog/article.mdx",
old_string: "## Introduction\n\nOld text here",
new_string: "## Introduction\n\nNew text here"
)
请提供 3-5 行上下文,以确保匹配内容唯一。灵活的空白字符匹配会自动处理缩进差异。
查找内容
模糊文本搜索(查找精确短语):
cms_grep(query: "deployment", type: "blog", limit: 10)
语义搜索(按含义查找):
cms_search(query: "how to deploy apps", type: "blog")
版本控制
# See all versions
cms_get_versions(path: "blog/article.mdx")
# Restore a specific version
cms_activate_version(path: "blog/article.mdx", version: 3)
草稿工作流
# Check for unpublished changes
cms_list_drafts(type: "blog")
# Discard draft (revert to last published)
cms_discard_draft(path: "blog/article.mdx")
MDX 组件
富文本内容常用组件:
<Tip>Helpful tip text</Tip>
<Note>Informational note</Note>
<Warning>Caution about something</Warning>
<Steps>
<Step title="First Step">Instructions</Step>
<Step title="Second Step">More instructions</Step>
</Steps>
<CodeGroup>
<CodeTab title="JavaScript">code here</CodeTab>
<CodeTab title="Python">code here</CodeTab>
</CodeGroup>
<CardGroup cols={2}>
<Card title="Feature Name" href="/docs/path" icon="Star">
Brief description
</Card>
</CardGroup>
<AccordionGroup>
<Accordion title="Question?">Answer content</Accordion>
</AccordionGroup>
工作流最佳实践
- 编辑前先阅读:始终先使用
cms_read_file了解当前内容 - 使用精准编辑:优先使用
cms_search_replace,而非全文重写 - 预览草稿:设置
publish: false保存草稿,审核后再使用cms_publish - 留意版本:
cms_publish会创建版本快照,可用于安全回滚 - 先搜索:使用
cms_grep查找精确文本,再使用cms_search_replace
完整发布工作流
1. cms_list_dir(path: "blog") → See current articles
2. cms_write_file(path, content, false) → Create/update as draft
3. cms_read_file(path) → Review the saved content
4. cms_publish(paths: [path]) → Go live with version snapshot
MCP 服务名称
所有工具都通过 user-blink-mcp 服务访问:
server: "user-blink-mcp"
toolName: "cms_list_dir"
arguments: { "path": "blog" }
评论
支持 Markdown