关于 Prompt Book Server
Prompt Book Server 是用于管理 Notion 数据库中 AI 提示词的 MCP 服务,适合需要组织多个提示词集合的个人和团队,可搜索、读取和编辑内容。
主要功能
- 01管理多个 Notion 提示词集
- 02按标题、类型或标签搜索
- 03读取完整提示词内容
- 04添加和更新提示词
- 05在提示词集之间复制
- 06创建 Notion 提示词数据库
适用场景
- 01按主题或标签查找提示词
- 02为 AI 任务读取提示词
- 03维护团队提示词集合
- 04在集合之间迁移提示词
MCP 相关
它向 MCP 客户端提供 Notion 提示词集的配置与管理工具,包括搜索、读取、添加和更新提示词。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
16收录的工具列表 · 更新于 3 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| name | string | 是 | 提示词簿的名称 |
| notion_token | string | 是 | 可访问提示词数据库的 Notion API 令牌 |
| notion_database_id | string | 是 | 包含提示词的 Notion 数据库 ID |
详细介绍
Prompt Book Server
一个连接到包含 AI 提示词的 Notion 数据库的 MCP 服务,让你能够跨多个提示词集合高效地管理、搜索和检索提示词。
Prompt Book Server 有什么用途?
Prompt Book Server 是一款强大的工具,可帮助你整理和访问存储在 Notion 数据库中的 AI 提示词。它提供以下主要功能:
- 多个提示词本:通过不同的 Notion 数据库管理多个提示词集合(提示词本)
- 发现提示词:按标题、类型或标签搜索、筛选和浏览提示词
- 检索提示词:快速访问任意提示词的完整内容
- 管理提示词:添加新提示词、更新现有提示词,以及在不同提示词本之间复制提示词
- 创建数据库:直接在 Notion 中创建具有正确架构的新提示词数据库
该服务充当你的 AI 工具与基于 Notion 的提示词集合之间的桥梁,让你能够轻松维护一个集中式提示词库,并通过各种编码和 AI 工具访问它。
所有工具
配置管理工具
| 工具名称 | 描述 |
|---|---|
list_prompt_books | 列出所有已配置的提示词本 |
create_prompt_book_config | 添加新的提示词本配置 |
remove_prompt_book_config | 移除提示词本配置 |
activate_prompt_book | 将某个提示词本设为活动状态 |
rename_prompt_book | 重命名提示词本配置 |
create_prompt_database | 在 Notion 中创建新的提示词数据库,并将其添加到配置中 |
copy_prompt | 将提示词从一个提示词本复制到另一个提示词本 |
提示词管理工具
| 工具名称 | 描述 |
|---|---|
list_prompts | 列出活动数据库中的所有提示词 |
search_prompts_by_title | 按标题搜索提示词 |
get_prompts_by_tag | 获取按指定标签筛选的提示词 |
get_prompts_by_type | 获取按指定类型筛选的提示词 |
read_prompt | 读取指定提示词的完整内容 |
list_all_types | 列出数据库中所有不重复的提示词类型 |
list_all_tags | 列出数据库中使用的所有不重复的标签 |
add_prompt | 向数据库添加新提示词 |
update_prompt | 更新数据库中的现有提示词 |
如何在我的编码工具(或非编码工具)中配置它?
添加到 MCP 配置
将该服务添加到你的 MCP 配置文件中。配置文件的位置取决于你的 MCP 客户端:
MCP 配置文件路径
- cline:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - roo_code:
~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json - windsurf:
~/.codeium/windsurf/mcp_config.json - claude:
~/Library/Application Support/Claude/claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"prompt-book-server": {
"command": "npx",
"args": [
"-y",
"@piccollage/prompt-book-mcp-server"
],
"disabled": false,
"alwaysAllow": []
}
}
}
使用示例提示词
以下是一些可用于与 Prompt Book Server 交互的示例提示词:
列出和搜索提示词
List all my prompt books.
Show me all prompts in the prompt book.
Search for prompts related to "GPUImage" in my prompt book.
Show me all prompts with the tag "PicCollage".
List all prompts of type "Coding"
What types of prompts are available in my prompt book?
读取提示词
Get the prompt about idea evaluation from the prompt book.
Follow the instructions in it and then verify the following idea for me:
describe your idea
管理提示词本
Activate the engineering prompt book.
Copy the GPUImage porting prompt from my private book to the engineering book.
添加和更新提示词
Add a new prompt titled "React Component Generator" with type "Coding" and tags ["React", "Frontend"].
The prompt should include ....
......
.....
Update the "React Component Generator" prompt to include TypeScript support.
Please create a very detailed prompt to instruct LLM agents to convert Android XML UI implementations into Compose UI elements or screens. Put that prompt to the prompt book.
如何添加新的提示词本?
添加新的提示词本主要有两种方式:
方式 1:连接到现有的 Notion 数据库
如果你已经有一个包含提示词的 Notion 数据库,可以直接连接:
- 从 https://www.notion.so/my-integrations 获取 Notion API 令牌
- 将 Notion 数据库共享给你的集成
- 从 URL 中获取数据库 ID(即工作区名称之后、问号之前的部分)
- 使用
create_prompt_book_config工具:
Add a new prompt book with the following details:
- Name: "My Team Prompts"
- Notion token: "secret_abc123..."
- Notion database ID: "1a748be2b63280988d9bc5f89918431d"
选项 2:创建新的 Notion 数据库
如果你想创建一个具有正确架构的新提示词数据库:
- 从 https://www.notion.so/my-integrations 获取 Notion API 令牌
- 找到你想要在其中创建数据库的 Notion 页面 ID
- 使用
create_prompt_database工具:
Create a new prompt database with these details:
- Name: "My New Prompt Book"
- Notion token: "secret_abc123..."
- Page ID: "1a748be2b63280988d9bc5f89918431d"
- Activate: true
这会创建一个包含适当架构(Name、Type、Tags)的新数据库,并将其添加到配置中。
Notion 数据库要求
为获得最佳功能,Notion 数据库应包含以下属性:
- Name(标题):提示词的标题
- Type(选择):提示词的类别(例如,“Coding”“Image Generation”)
- Tags(多选):用于整理和筛选提示词的标签
提示词内容本身以文本块的形式存储在页面正文中。
开发
先决条件
- Node.js 16+
- TypeScript
- Notion API 令牌
设置
- 克隆仓库
- 安装依赖项:
npm install - 构建项目:
npm run build - 运行服务:
npm start
配置文件结构
~/.mcp_config/prompt_book.json 中的配置文件具有以下结构:
{
"promptBooks": [
{
"id": "uuid-string",
"name": "My Prompt Book",
"notion_token": "your-notion-api-token",
"notion_database_id": "your-notion-database-id"
}
],
"activePromptBookId": "uuid-string"
}
环境变量配置(DEFAULT_BOOKS)
你可以使用 DEFAULT_BOOKS 环境变量提供默认配置。以下情况尤其适用:
- 在部署环境中自动设置提示词集
- 为团队成员提供默认配置
- 使用提示词集配置预填充服务
DEFAULT_BOOKS 环境变量应包含有效的 JSON 字符串,且其结构应与上述配置文件结构匹配。
重要说明:
- 仅当配置文件
~/.mcp_config/prompt_book.json尚不存在时,才会使用DEFAULT_BOOKS环境变量 - 如果配置文件已存在,则会忽略环境变量
- 如果
DEFAULT_BOOKS中的 JSON 无效或与预期结构不匹配,则会忽略该值并创建空配置
使用示例:
# Set the environment variable
export DEFAULT_BOOKS='{"promptBooks":[{"id":"12345678-1234-1234-1234-123456789012","name":"Default Prompt Book","notion_token":"secret_abc123...","notion_database_id":"1a748be2b63280988d9bc5f89918431d"}],"activePromptBookId":"12345678-1234-1234-1234-123456789012"}'
# Run the server - it will use the DEFAULT_BOOKS configuration if no config file exists
npx @piccollage/prompt-book-mcp-server
在容器化环境中部署服务,或希望为团队成员提供预配置设置时,此功能尤其有用。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。