提示图书服务器
连接到包含AI提示的Notion数据库的MCP服务器,允许您在多个提示集合中高效地管理、搜索和检索提示。
提示图书服务器做什么?
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配置的路径
- 克莱恩:
~/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
- 帆板运动:
~/.codeium/windsurf/mcp_config.json
- 克劳德:
~/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 API令牌 https://www.notion.so/my-integrations
- 与您的集成共享您的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 API令牌 https://www.notion.so/my-integrations
- 查找要在其中创建数据库的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这将创建一个具有正确模式(名称、类型、标签)的新数据库,并将其添加到您的配置中。
Notion数据库要求
为了获得最佳功能,您的Notion数据库应具有以下属性:
- 名字 (title):提示的标题
- 类型 (选择):提示的类别(例如,“编码”、“图像生成”)
- 标签 (多选):用于组织和过滤提示的标签
提示内容本身以文本块的形式存储在页面正文中。
发展
先决条件
- Node.js 16+
- TypeScript
- 通知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字符串。
重要提示:
- 这
DEFAULT_BOOKS环境变量仅在配置文件~/.mcp_config/prompt_book.json还不存在 - 如果配置文件已存在,则忽略环境变量
- 如果JSON在
DEFAULT_BOOKS无效或与预期结构不匹配,将被忽略,并创建一个空配置
示例用法:
# 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当在容器化环境中部署服务器时,或者当您想为团队成员提供预配置的设置时,此功能特别有用。
