Bedbook
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Bedbook Find a bedtime story for a 5-year-old about being brave."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Bedbook - 儿童故事 MCP 服务
Bedbook 是一个基于 MCP (Model Context Protocol) 协议的儿童故事服务。它提供故事列表和搜索功能,可以集成到支持 MCP 的 AI 应用中,帮助用户查找和阅读适合不同年龄段的儿童故事。
功能特点
故事列表: 列出所有可用故事,展示标题、年龄段、关键词等元信息
智能搜索: 支持按年龄段、名称、关键词、分类、内容模糊搜索,返回最佳匹配结果
阅读统计: 记录每个故事的阅读次数,帮助了解热门故事
MCP 协议: 标准化的 MCP 工具接口,可无缝集成到 Claude、Cursor 等 AI 应用
灵活部署: 支持 stdio 和 HTTP 两种传输方式
Related MCP server: Claude Book Agent
技术栈
语言: TypeScript 5.x
运行时: Node.js (ES2022)
MCP 框架: bestmcp SDK
参数验证: Zod
包管理器: pnpm
构建工具: tsup
快速开始
Bedbook 是一个 MCP 服务,你可以通过支持 MCP 的 AI 应用来使用它。以下是常见的配置方式:
在 Claude Desktop 中配置
编辑配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"bedbook": {
"command": "npx",
"args": ["-y", "bedbook"]
}
}
}在 Cursor 中配置
在项目根目录创建或编辑 .cursor/mcp.json 文件:
{
"mcpServers": {
"bedbook": {
"command": "npx",
"args": ["-y", "bedbook"]
}
}
}使用示例
配置完成后,你可以直接与 AI 对话来使用 Bedbook:
"给我找一个适合 5 岁孩子的关于勇敢的故事"
"有哪些故事可以讲给孩子听?"
"帮我找一个叫'小老虎'的故事"
使用技巧
提示: 如果你使用的 AI 工具搭载的是较小的模型,它可能会对故事进行精简总结而非完整讲述。这并非 MCP 服务或故事本身的问题,可以通过提示词来引导模型完整输出故事内容。
如果遇到故事被精简的情况,可以尝试在对话中使用以下引导提示词:
请完整地讲述这个故事,不要进行总结或精简。我希望能听到故事的每一个细节,包括所有对话和情节。请保持故事原有的语言风格和完整长度。或者更直接的提示:
请逐字逐句地讲这个故事,不要遗漏任何内容。这样可以确保模型输出完整的故事内容,让孩子能够享受完整的故事体验。
自定义故事目录(可选)
如果你想使用自己的故事文件,可以通过环境变量指定故事目录:
{
"mcpServers": {
"bedbook": {
"command": "npx",
"args": ["-y", "bedbook"],
"env": {
"BEDBOOK_STORIES_DIR": "/path/to/your/stories"
}
}
}
}Claude Plugin 支持
Bedbook 提供了一个 Claude Plugin,让你可以直接在 Claude Code 中使用 /add-story 命令快速生成儿童故事。
安装 Plugin
添加 Marketplace
首先添加 bedbook-plugins marketplace:
/plugin marketplace add shenjingnan/bedbook如果你无法访问 github 可以尝试使用 gitee
/plugin marketplace add https://gitee.com/shenjingnan/bedbook.git安装 Plugin
然后安装 bedbook plugin:
/plugin install bedbook@bedbook-plugins使用 Plugin
安装完成后,你可以使用 /bedbook:add-story 技能生成故事:
如果安装成功,但是没有发现
/bedbook:add-story技能,可以尝试重启 Claude Code
/bedbook:add-story 小兔子找太阳
/bedbook:add-story 守株待兔 --age 5-7岁
/bedbook:add-story 一只勇敢的小猫去森林冒险 --keywords 勇敢,冒险,成长支持的输入类型
故事名称: 直接提供故事标题
成语: 将成语改编为儿童故事
故事大纲: 根据大纲扩展完整故事
可选参数
--age <年龄段>: 指定目标年龄段(如3-5岁)--keywords <关键词>: 指定关键词(逗号分隔)
命令行使用
你也可以通过命令行直接调用 plugin 生成故事:
claude -p --permission-mode acceptEdits "/bedbook:add-story 闻鸡起舞"同样支持可选参数:
claude -p --permission-mode acceptEdits "/bedbook:add-story 守株待兔 --age 5-7岁"
claude -p --permission-mode acceptEdits "/bedbook:add-story 一只勇敢的小猫去森林冒险 --keywords 勇敢,冒险,成长"这种方式适合在脚本中使用或快速生成故事。
插件功能
该 plugin 提供以下功能:
✅ 自动生成符合项目规范的故事文件
✅ 检查故事标题和内容是否与现有故事重复
✅ 根据年龄段调整语言风格和故事长度
✅ 自动生成 5-8 个关键词
✅ 确保故事具有教育意义和积极结局
安装
环境要求
Node.js >= 20.0.0
pnpm >= 10.0.0
安装依赖
pnpm install使用
开发模式
# stdio 传输模式(默认)
pnpm dev
# HTTP 传输模式
pnpm dev:http生产模式
# 构建项目
pnpm build
# stdio 传输模式
pnpm start
# HTTP 传输模式
pnpm start:http开发工具
# 测试
pnpm test # 运行测试
pnpm test:watch # 监听模式运行测试
pnpm test:coverage # 运行测试覆盖率
# 代码质量
pnpm lint # 代码检查
pnpm lint:fix # 自动修复代码问题
pnpm format # 格式化代码
pnpm typecheck # 类型检查
pnpm spellcheck # 拼写检查环境变量
变量名 | 说明 | 默认值 |
| 传输方式 (stdio/http) |
|
| HTTP 模式端口 |
|
| HTTP 模式主机 |
|
| 自定义故事目录 |
|
MCP 工具
listStories
列出所有故事(不含完整内容)。
参数: 无
返回示例:
{
"success": true,
"count": 10,
"stories": [
{
"filename": "小老虎怕下雨.md",
"title": "小老虎怕下雨",
"age": "3-7岁",
"keywords": ["勇敢", "友谊"],
"author": "未知",
"category": "儿童故事",
"language": "zh",
"readCount": 5
}
]
}searchStory
根据条件搜索故事,返回最佳匹配(含完整内容)。
参数:
参数名 | 类型 | 必填 | 说明 |
| string | 否 | 年龄段筛选,如 |
| string | 否 | 故事名称模糊匹配 |
| string | 否 | 关键词搜索 |
返回示例:
{
"bestMatch": {
"filename": "小老虎怕下雨.md",
"title": "小老虎怕下雨",
"age": "3-7岁",
"keywords": ["勇敢", "友谊"],
"author": "未知",
"category": "儿童故事",
"language": "zh",
"readCount": 5,
"content": "森林里住着一只小老虎..."
},
"otherMatches": [
{
"filename": "勇敢的小兔子.md",
"title": "勇敢的小兔子",
"age": "3-6岁",
"keywords": ["勇敢", "冒险"],
"author": "未知",
"category": "儿童故事",
"language": "zh",
"readCount": 3
}
]
}故事文件格式
故事文件存放在 stories/ 目录,采用 Markdown 格式,包含 YAML Front Matter:
---
title: 故事标题
age: 3-7岁
keywords:
- 关键词1
- 关键词2
author: 作者名
category: 分类
language: zh
---
故事正文内容...元数据字段
字段 | 类型 | 必填 | 说明 |
| string | 是 | 故事标题 |
| string | 是 | 适合年龄段,如 |
| string[] | 是 | 关键词标签列表 |
| string | 是 | 作者名(可为"未知") |
| string | 是 | 故事分类 |
| string | 是 | 故事语言,ISO 639-1 代码,如 |
项目结构
bedbook/
├── src/
│ ├── index.ts # 入口文件,MCP 服务器配置
│ ├── types.ts # TypeScript 类型定义
│ ├── utils.ts # 工具函数(文件解析、相似度计算)
│ ├── story.ts # 故事服务(MCP 工具)
│ ├── readCount.ts # 阅读次数统计
│ ├── *.test.ts # 测试文件
│ └── global.d.ts # 全局类型声明
├── stories/ # 故事文件目录
│ ├── .read-counts.json # 阅读次数数据
│ ├── fairy-tale/ # 童话故事
│ ├── growth/ # 成长故事
│ ├── history/ # 历史故事
│ ├── idiom/ # 成语故事
│ ├── myth/ # 神话故事
│ ├── original/ # 原创故事
│ └── science/ # 科学故事
├── dist/ # 编译输出目录
├── package.json
└── tsconfig.json开发指南
代码规范
类型安全: 使用 TypeScript 严格模式,避免
any类型接口定义: 在
types.ts中定义所有接口和类型服务类: 使用
@Tool和@Param装饰器定义 MCP 工具错误处理: 使用 try-catch 捕获异常,避免服务崩溃
命名规范
文件名: kebab-case (如
story.ts)类名: PascalCase (如
StoryService)函数/变量: camelCase (如
getStories)接口: PascalCase,不加
I前缀 (如Story)常量: UPPER_SNAKE_CASE
许可证
本项目基于 MIT 许可证开源。
贡献
欢迎提交 Issue 和 Pull Request!
Bedbook - 为孩子们带来美好的睡前故事时光
Available Tools
2 toolslistStoriesB
列出 stories 目录中所有故事
Inputs: no named parameters.
searchStoryB
根据年龄段、名称或关键词模糊搜索故事,返回最佳匹配
Inputs: age, title, keyword.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: listStories enumerates all stories, while searchStory performs a filtered fuzzy search and returns the best match. An agent can easily choose between browsing everything and searching for a specific story.
Both names follow a consistent camelCase verb_noun pattern: listStories and searchStory. The only minor variation is plural vs. singular noun, but the convention is otherwise predictable.
Two tools is on the thin side for a story-oriented server, even if the intended scope is just browsing and searching. It is not an extreme mismatch, but the surface feels minimal.
The server supports listing and searching stories but appears to lack a get/read tool to retrieve a story's content or details. For a Bedbook story server, that is a significant gap that could block core agent workflows.
Maintenance
Related MCP Connectors
Remote MCP server for AIStoryHub: stories, chapters, story bible, Voiceprints, AI generation.
Capability registry for the agentic economy. Semantic search over verified MCP server listings.
Read-only, no-auth MCP server over Human x AI's Content Hub and confirmed 2027 facts.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceGenerates personalized short bedtime stories for three-year-old children using custom themes and names. It provides a dedicated MCP tool for automated storytelling and is optimized for cloud deployment on platforms like Render.1-
- FlicenseNot gradedqualityDmaintenanceAn MCP server that automates the generation of structured children's books using Claude Desktop.-
- AlicenseNot gradedqualityBmaintenanceThis MCP server provides semantic document search and retrieval, enabling AI assistants to search documents, search categories, and retrieve category hierarchies using the Model Context Protocol.2MIT
- AlicenseAqualityBmaintenanceThis MCP server enables AI agents to search and retrieve exact, cited passages from a large corpus of public-domain books, including full-text search, book metadata, chapters, quotes, and 'ask book' Q&A. Payments are handled via x402 micropayments on Base.873 npmMIT