使用说明
项目简介
Prompt Book Server 作为一个 MCP 服务器,旨在桥接您的 AI 工具和存储在 Notion 数据库中的 AI 提示词集合。通过该服务器,您可以集中管理多个提示词库,并方便地在不同的编码和 AI 工具中访问和使用这些提示词。
主要功能点
- 多 Prompt Book 管理: 支持连接和管理多个 Notion 数据库作为不同的 Prompt Book。
- Prompt 发现: 提供强大的 Prompt 搜索、过滤和浏览功能,可以根据标题、类型或标签快速找到需要的 Prompt。
- Prompt 检索: 能够快速读取并获取指定 Prompt 的完整内容。
- Prompt 管理: 支持添加、更新和复制 Prompt,方便 Prompt 的维护和组织。
- Prompt 数据库创建: 可以直接在 Notion 中创建符合 Prompt Book Server 要求的数据库结构。
- 全面的工具集: 提供丰富的工具,用于配置管理 Prompt Book 和管理 Prompt,例如列出 Prompt Book、创建 Prompt Book 配置、激活 Prompt Book、搜索 Prompt、按标签/类型获取 Prompt、读取 Prompt 内容等。
安装步骤
- 安装 Node.js: 确保您的系统中已安装 Node.js (版本 16 或更高版本)。
- 安装 prompt-book-mcp-server: 您无需手动克隆和构建仓库,可以直接使用 'npx' 命令来运行该 MCP 服务器。
服务器配置
为了让 MCP 客户端(如 cline, roo_code, windsurf, claude 等)连接到 Prompt Book Server,您需要在 MCP 客户端的配置文件中添加以下服务器配置信息。配置信息为 JSON 格式,示例如下:
{ "mcpServers": { "prompt-book-server": { "command": "npx", "args": [ "-y", "@piccollage/prompt-book-mcp-server" ], "disabled": false, "alwaysAllow": [] } } }
参数注释:
- '"prompt-book-server"': 服务器名称,在 MCP 客户端中用于标识该服务器。
- '"command": "npx"': 运行服务器的命令,这里使用 'npx' 来执行 npm 包。
- '"args": [...]': 传递给 'npx' 命令的参数列表。
- '"-y"': 'npx' 参数,表示自动确认安装包。
- '"@piccollage/prompt-book-mcp-server"': 要执行的 npm 包名称,即 Prompt Book Server 的包名。
- '"disabled": false': 表示服务器未禁用,MCP 客户端会尝试连接该服务器。
- '"alwaysAllow": []': 表示允许所有工具调用,您可以根据需要配置允许调用的工具列表。
配置位置:
根据您使用的 MCP 客户端,将上述 JSON 配置添加到对应的配置文件中:
- 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'
基本使用方法
配置完成后,您可以使用 MCP 客户端向 Prompt Book Server 发送指令,以管理和检索 Prompt。以下是一些基本的使用示例,您可以在 MCP 客户端的对话框中输入这些指令来与 Prompt Book Server 交互:
Prompt Book 管理:
- 'List all my prompt books.' - 列出所有已配置的 Prompt Book。
- 'Activate the engineering prompt book.' - 激活名为 "engineering" 的 Prompt Book。
- 'Add a new prompt book with the following details: - Name: "My Team Prompts" - Notion token: "secret_abc123..." - Notion database ID: "1a748be2b63280988d9bc5f89918431d"' - 添加一个新的 Prompt Book 配置。
- 'Create a new prompt database with these details: - Name: "My New Prompt Book" - Notion token: "secret_abc123..." - Page ID: "1a748be2b63280988d9bc5f89918431d" - Activate: true' - 创建一个新的 Prompt 数据库并添加到配置中。
Prompt 检索和搜索:
- 'Show me all prompts in the prompt book.' - 列出当前激活的 Prompt Book 中的所有 Prompt 列表。
- 'Search for prompts related to "GPUImage" in my prompt book.' - 在当前激活的 Prompt Book 中搜索标题包含 "GPUImage" 的 Prompt。
- 'Show me all prompts with the tag "PicCollage".' - 在当前激活的 Prompt Book 中列出所有标签为 "PicCollage" 的 Prompt。
- 'List all prompts of type "Coding"' - 在当前激活的 Prompt Book 中列出所有类型为 "Coding" 的 Prompt。
- 'What types of prompts are available in my prompt book?' - 列出当前激活的 Prompt Book 中所有可用的 Prompt 类型。
- 'Get the prompt about idea evaluation from the prompt book.' - 读取标题为 "idea evaluation" 的 Prompt 的完整内容。
Prompt 内容管理:
- 'Add a new prompt titled "React Component Generator" with type "Coding" and tags ["React", "Frontend"]. The prompt should include .... ...... .....' - 添加一个新的 Prompt 到当前激活的 Prompt Book。
- 'Update the "React Component Generator" prompt to include TypeScript support.' - 更新名为 "React Component Generator" 的 Prompt。
- 'Copy the GPUImage porting prompt from my private book to the engineering book.' - 将名为 "GPUImage porting prompt" 的 Prompt 从 "private book" 复制到 "engineering book"。
请根据实际需求使用上述示例指令,并参考仓库 README 文件获取更详细的工具和使用说明。
信息
分类
AI与计算