Confidential guide on numerology and astrology, based of GG33 Public information

MCP-Server-Notion-Prompt
3 years
Works with Finder
1
Github Watches
0
Github Forks
0
Github Stars
Notion Prompts MCP Server
这是一个使用 Model Context Protocol (MCP) 标准的服务器,它提供对存储在 Notion 数据库中的提示词的访问。
功能特点
- 提示词资源列表:以 MCP 资源形式提供所有可用提示词
- 提示词读取:通过 ID 或名称读取单个提示词
- 提示词组合:将用户输入与提示词模板组合
- 类别管理:支持按类别分组和查询提示词
- 搜索功能:支持在名称、描述和内容中搜索提示词
- 缓存系统:内置缓存机制,优化性能,减少 API 调用
- 可配置:支持通过环境变量或命令行参数进行配置
- 处理模式:支持多种提示词处理方式,避免LLM越界处理
安装
# 克隆仓库
git clone https://github.com/BaoxingZhang/mcp-server-notion-prompt
cd mcp-server-notion-prompt
# 安装依赖
npm install
# 构建项目
npm run build
配置
1. 创建Notion集成
- 访问 Notion Developer Portal
- 点击"+ New integration"
- 填写基本信息
- 在"Capabilities"部分,确保勾选:Read content
- 点击"Submit"创建集成
- 创建后,复制显示的"Internal Integration Token"(以"ntn_"开头),这是您的NOTION_API_KEY
2. 创建Notion数据库
- 在Notion中创建一个新页面
- 输入 /database 并选择"表格数据库"
- 设置以下属性:
- Name(标题属性):提示词的名称
- Content(文本属性):提示词的内容
- Description(文本属性):提示词的描述或用途
- Category(多选属性):提示词的分类(可选)
- 在Notion中打开您的提示词数据库
- 在页面URL中找到数据库ID(
https://www.notion.so/workspace/123456abcdef...
,其中的"123456abcdef..."部分就是数据库ID) - 记录这个ID,它将作为NOTION_DATABASE_ID使用
- 分享数据库给集成(打开提示词数据库、点击右上角的"..."菜单、选择"Add connections"、在搜索框中找到并选择您刚创建的集成)
3. 服务器配置
服务器需要以下配置:
- NOTION_API_KEY: 你的 Notion API 密钥
- NOTION_DATABASE_ID: 存储提示词的 Notion 数据库 ID
-
PROMPT_HANDLING_MODE: 提示词组合后的处理模式(可选,默认为 process_locally)
-
return_only
: 仅返回组合后的提示词文本,不做额外处理 -
process_locally
: 指示客户端使用当前上下文的LLM处理提示词 -
call_external_api
: 服务器调用外部API处理提示词(需另行配置)
-
可以通过环境变量或命令行参数提供:
# 使用环境变量
export NOTION_API_KEY="your_api_key_here"
export NOTION_DATABASE_ID="your_database_id_here"
export LOG_LEVEL="INFO" # 可选,默认为 INFO
export CACHE_EXPIRY_TIME="300000" # 可选,默认为 5 分钟 (300000ms)
export PROMPT_HANDLING_MODE="process_locally" # 可选,默认为 process_locally
# 启动服务器
npm start
# 或使用命令行参数
npm start -- --notion_api_key=your_api_key_here --notion_database_id=your_database_id_here --prompt_handling_mode=return_only
Notion 数据库结构
Notion 数据库应包含以下属性:
- Name (标题): 提示词名称
-
Content (富文本): 提示词内容,可以包含
{{USER_INPUT}}
占位符 - Description (富文本): 提示词描述
- Category (选择): 提示词类别
提示词变量
在提示词内容中,你可以使用以下变量:
-
{{USER_INPUT}}
: 将被用户输入替换 -
{{CURRENT_DATE}}
: 当前日期 -
{{CURRENT_TIME}}
: 当前时间 -
{{CURRENT_DATETIME}}
: 当前日期和时间 -
{{PROMPT_NAME}}
: 提示词名称
MCP 工具
该服务器提供以下 MCP 工具:
- list_prompts: 列出所有可用的提示词
- get_prompt_by_name: 通过名称获取提示词
- compose_prompt: 将用户输入整合到提示词模板中
- process_composed_prompt: 处理组合后的提示词
- process_category_prompts: 处理指定类别的所有提示词
- refresh_prompts: 刷新提示词缓存
- get_prompts_by_category: 获取特定类别的提示词
- search_prompts: 搜索提示词(名称、描述和内容)
- list_categories: 列出所有可用的提示词类别
开发
# 运行开发版本
npm run dev
# 构建
npm run build
# 运行测试
npm test
使用示例
# 获取特定提示词
请使用get_prompt_by_name工具获取名为"翻译助手"的提示词。
# 组合提示词与用户输入
请使用compose_prompt工具,提示词名称为"翻译助手",用户输入为"Hello, I am learning to use Cursor with MCP."
# 直接使用提示词处理内容
请使用名为"翻译助手"的提示词翻译以下文本:Hello, I am learning to use Cursor with MCP.
# 刷新缓存
请使用refresh_prompts工具刷新提示词缓存。
# 使用类别调用多个提示词
调用类别为"七把武器"的提示词,分别输出7个svg卡片,输入内容为:"只看新闻,不讨论~"。
# 组合处理结果
调用类别为"七把武器"的提示词,先分别输出7个svg卡片,然后将7个svg卡片最终整合到一个html中,输入内容为:"只看新闻,不讨论~"。
# AI自主选择
生命,爱与欢笑(奥修)
选择七把武器中一把合适的武器输出
server json 示例
{
"mcpServers": {
"notion-prompts": {
"command": "node",
"args": [
"D:\\project\\mcp-project\\mcp-server-notion-prompt\\build\\index.js"
],
"env": {
"NOTION_API_KEY": "ntn_xxx",
"NOTION_DATABASE_ID": "1ccxxx"
}
}
}
}
许可证
MIT
相关推荐
Converts Figma frames into front-end code for various mobile frameworks.
Advanced software engineer GPT that excels through nailing the basics.
Take an adjectivised noun, and create images making it progressively more adjective!
I find academic articles and books for research and literature reviews.
Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.
Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.
MCP -Server für den Fetch -Webseiteninhalt mit dem Headless -Browser von Dramatikern.
Ein leistungsstarkes Neovim -Plugin für die Verwaltung von MCP -Servern (Modellkontextprotokoll)
Brücke zwischen Ollama und MCP -Servern und ermöglicht es lokalen LLMs, Modellkontextprotokoll -Tools zu verwenden
🔍 Ermöglichen Sie AI -Assistenten, über eine einfache MCP -Schnittstelle auf PYPI -Paketinformationen zu suchen und auf Paketinformationen zuzugreifen.
Reviews

user_EXz5NAeM
I've been using mcp-server-notion-prompt by BaoxingZhang and it has significantly streamlined my workflow. The seamless integration with Notion allows for efficient prompting and task management. It's intuitive and robust, covering all my organizational needs. Highly recommend checking it out at its GitHub page!