Token导航 LogoToken导航

MCP Server · 文档知识

Pydantic AI Agent With Notion MCP Server

一个使用Pydantic AI和本地Notion MCP服务器构建的食谱对话代理,可从Notion工作区获取食谱并提供结构化响应。

stdio官方级别未说明来源级核验工具 0
Python结构化数据Notion集成

快速开始

作者 / 组织
anybody84
提供方
anybody84
运行时
Python

工具数量

0

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

Pydantic AI Agent With Notion MCP Server 属于文档知识类 MCP Server,公开资料标注 0 个工具,通过stdio 本地进程接入,客户端适配情况以官方文档为准,有可以直接复制的安装命令;接入前要先准备 访问 Token。

分类

文档知识

传输方式

stdio

认证方式

访问 Token

部署方式

公开资料未说明

安装与配置

安装命令

uv run src/pydantic_ai_agent/main.py

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 0 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

带有本地Notion MCP服务器的Pydantic AI代理

该项目演示了如何使用以下命令构建会话式配方代理 Pydantic AI 以及当地 MCP概念(模型上下文协议)在Docker容器中运行的服务器。

特性

  • 对话式AI:与代理交互,按名称查找食谱。
  • 概念整合:使用本地MCP服务器直接从Notion工作区获取食谱。
  • 结构化响应:以清晰易读的格式返回成分和说明。
  • 优雅的操控:如果找不到食谱,会通知您。

先决条件

  • python 版本 3.11 或更高
  • uv 版本 0.7.19 (用于包管理)
  • Docker(用于在本地运行Notion MCP服务器)
  • 有权访问食谱数据库的Notion帐户

输出示例

假设你的食谱数据库看起来像这样:

这是运行代理时的示例输出:

========================================
      Pydantic AI Recipe Agent
========================================

Welcome to the Pydantic AI Recipe Agent!
You can ask for recipes and I will retrieve them from Notion.
Type 'exit', 'quit', 'stop', or 'end' to terminate the conversation.

What would you like to cook today?

> pizza
Recipe not found in Notion.

> spaghetti carbonara
- Title: Spaghetti carbonara
- Ingredients:
  - 400g spaghetti
  - 150g pancetta or guanciale, diced
  - 3 large eggs
  - 100g Parmesan cheese, grated
  - 2 cloves garlic, minced (optional)
  - Salt and freshly ground black pepper
  - Fresh parsley, chopped (for garnish, optional)
- Instructions:
  1. **Cook the Spaghetti**: Bring a large pot of salted water to a boil. Add the spaghetti and cook according to package instructions until al dente. Reserve 1 cup of the pasta water before draining.
  2. **Prepare the Sauce**: In a bowl, whisk together the eggs, grated Parmesan cheese, a pinch of salt, and a generous amount of black pepper. Set aside.
  3. **Cook the Pancetta/Guanciale**: In a large skillet over medium heat, add the diced pancetta or guanciale. Cook until crispy, about 5-7 minutes. If using garlic, add it during the last minute of cooking to avoid burning.
  4. **Combine Pasta and Sauce**: Once the spaghetti is cooked and drained, add it directly to the skillet with the pancetta. Remove from heat and quickly pour the egg and cheese mixture over the hot pasta. Toss immediately to combine.
  5. **Adjust Consistency**: If the sauce is too thick, add reserved pasta water until desired consistency is reached.
  6. **Serve**: Plate the pasta and garnish with more Parmesan, black pepper, and parsley if desired.
- Link: [Spaghetti carbonara](https://www.notion.so/Spaghetti-carbonara-*********************************)

> exit
Ending conversation. Goodbye!

安装

  1. 克隆存储库:
   git clone https://github.com/anybody84/pydantic-ai-agent-with-notion-mcp-server.git
   cd pydantic-ai-agent-with-notion-mcp-server
  1. 使用安装依赖项 uv:
   uv sync
  1. 获取您的Notion API代币(ntn_*****)从您的Notion集成设置中。

有关如何设置此设置的更多详细信息,请参阅 MCP服务器概念文档.

注: 确保您授予了对食谱数据库的集成访问权限。
  1. 获取OpenAI API密钥(sk-*****)从 OpenAI API密钥页.
  1. 创建一个 .env 根目录中的文件,内容如下:
   NOTION_TOKEN=your_notion_api_token
   OPENAI_API_KEY=your_openai_api_key

   # Optional: Set the OpenAI model and the temperature you want to use. Default values are as follows:
   # OPENAI_MODEL="gpt-4o-mini"
   # OPENAI_MODEL_TEMPERATURE=0.0

   # Optional: Set the Logfire token if you want to leverage the observability features.
   # LOGFIRE_TOKEN=your_logfire_token

用法

从项目的根目录,您可以使用以下命令运行代理:

uv run src/pydantic_ai_agent/main.py

可观测性

此项目使用 Pydantic Logfire 为了可观察性。 您可以通过设置 LOGFIRE_TOKEN 在你的 .env 文件。 这将允许您跟踪代理的交互和性能指标。 这是可选的,但强烈推荐。

启用后,您可以在Logfire仪表板中查看日志和指标。

工具与能力

工具数量

0

资源数量

0

提示词数量

0

能力标签

食谱管理Python本地部署对话AINotion集成结构化数据

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

读长文档提问

把 PDF、Markdown 和笔记交给模型,按章节追问细节。

整理知识库

把零散资料归档、打标签,检索时更容易命中。

批量出摘要

提取要点,输出能直接引用的段落。

选择建议

值得选的地方

  • 只提供 0 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 Python,换机器要重新装一遍。
  • 需要自备访问 Token,没有凭据没法直接试。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在文档知识场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到访问 Token的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Pydantic AI Agent With Notion MCP Server

MCP World · 本页

0stdio有1 个2026-05-17
Cherry Studio

MCP World

0未说明未标注1 个2026-05-17
Pdf Math Translate

MCP World

0stdio有1 个2026-05-17
report generation

MCP World

0stdio有1 个2026-05-17
Anything To Notebooklm

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Pydantic AI Agent With Notion MCP Server 怎么安装?

公开资料给出的安装命令是 uv run src/pydantic_ai_agent/main.py,运行环境为 Python。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Pydantic AI Agent With Notion MCP Server 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Python;保存后完全退出客户端再打开,配置才会生效。

Pydantic AI Agent With Notion MCP Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Pydantic AI Agent With Notion MCP Server 需要 API Key 吗?

公开资料标注的认证方式是访问 Token,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

Pydantic AI Agent With Notion MCP Server 支持哪些客户端?

公开资料没有标注具体客户端;能配置本地 MCP 命令的客户端都能接,配置方式参照官方文档。

来源信息

继续浏览同类 MCP