Mcp Server Notion 06o

Mcp Server Notion 06o

🚀 mcp-server-notion

mcp-server-notion 是一个 MCP 服务器,借助 Notion API 可在 Notion 数据库中搜索文章,并获取文章内容。它以 Notion 作为内容源,让您能通过编程方式便捷地获取所需文章信息。

🚀 快速开始

先决条件

  • Python 3.13 或更高版本
  • 完成 Notion API 集成设置并具备相应权限
  • 拥有 Notion 集成令牌

配置

您需要在环境变量中配置 Notion API 令牌,示例如下:

NOTION_API_TOKEN=your_notion_integration_token

✨ 主要特性

  • 可在 Notion 数据库中搜索文章
  • 支持获取文章的全文或部分内容

💻 使用示例

基础用法

notion_search

该工具可用于在 Notion 数据库中搜索文章,支持传入搜索关键词和结果最大数量。示例代码如下:

# 假设这里有调用 notion_search 的代码
# 例如:
# result = notion_search(query="example_query", limit=10)
# 这里只是示例,实际代码需根据具体实现编写

notion_get_article

此工具用于获取指定文章 ID 的文章内容,并可指定输出格式。示例代码如下:

# 假设这里有调用 notion_get_article 的代码
# 例如:
# article_content = notion_get_article(article_id="example_id", format="json")
# 这里只是示例,实际代码需根据具体实现编写

高级用法

您可以根据实际需求组合使用这两个工具,例如先搜索文章,再获取搜索结果中某篇文章的详细内容。示例代码如下:

# 先搜索文章
search_result = notion_search(query="advanced_query", limit=5)
# 假设搜索结果中的第一篇文章是我们想要的
first_article_id = search_result[0]['id']
# 获取该文章的详细内容
article_content = notion_get_article(article_id=first_article_id, format="markdown")

📚 详细文档

工具参数说明

notion_search

参数 详情
query 搜索关键词,用于指定搜索的内容
limit 结果的最大数量,限制搜索结果的条数

notion_get_article

参数 详情
article_id 要获取的文章 ID,用于指定具体的文章
format 输出格式,支持 json、markdown、text 三种格式
  • 0 关注
  • 0 收藏,35 浏览
  • system 提出于 2025-09-19 14:36

相似服务问题

相关AI产品