📄 Notion页面查看器
可以在Web上查看Notion页面内容的Streamlit应用程序。
主要功能
🔍 4种查看模式
- 全部内容 -显示所有内容,包括切换、图像和子页面
- 标题+图像 -仅显示主页的标题和图像
- 子页面 -链接子页面的标题列表
- 原始数据 -JSON格式的原始数据(用于调试)
🚀 快速入门
1.安装
git clone https://github.com/ar-codelabs/MCP_NotionMCP_Webviewer.git
cd MCP_notion_webviewer
# 설치
pip install -r requirements.txt
2.Notion设置
- developers.notion.com/)中创建集成
- 复制Integration Token
- 将Integration连接到您想要查看的Notion页面
- 复制页面ID(从URL提取)
3.修改配置文件(Notion)
application/mcp.json 在文件中:
{
"mcpServers": {
"notion": {
"command": "python3",
"args": ["./application/mcp_server_notion.py"],
"env": {
"NOTION_API_KEY": "your_notion_integration_token",
"NOTION_PAGE_ID": "your_notion_page_id"
}
}
}
}4.运行
streamlit run application/app_webview_mcp_simple.py📖 使用方法
1.连接Web应用程序
- 从浏览器连接
2.利用4个按钮
- 🔍 全部内容:结构化显示页面的所有内容
- 🖼️ 标题+图像:只显示标题和图像
- 📑 子页面:链接子页面的标题列表和链接
- 🔧 原始数据:验证开发者的JSON数据
3.支持的Notion块
- 文本(paragraph)
- 헤딩 (标题1、标题2、标题3)
- 리스트 (bulleted_list_item,编号_list_items)
- 切换(toggle)
- 图像(image)
- 代码(code)
- 引文(quote)
- 列(column_list,column)
- 子页面(child_page)
🔧 高级设置
查找Notion页面ID
- Notion页面URL:
https://notion.so/페이지제목-abc123def456... - 最后一个连字符后的32位字符串是页面ID
- 删除连字符:
abc123def456...
更改端口
# MCP 방식
streamlit run application/app_webview_mcp_simple.py --server.port 8502🛠️ 技术堆栈
共同
- 前端:流光灯
- API:通知API(通知客户端)
- 语言:Python 3.8+
添加MCP方式
- 主控程序:模型上下文协议
- 建筑:断开Server-Client
- 模块化:可重复使用的MCP服务器
📝 注意事项
- Notion Integration必须具有页面读取权限
- 图像使用Notion的临时URL,可能会在一段时间后过期
- 对于大页面,加载时间可能会延长
