内容
# 工具列表
## Notion-MCP-Fast
**适用于 Notion 的快速只读 MCP 服务器** - 直接从本地 SQLite 缓存读取,无需 API 调用。
## 为什么?
官方 Notion MCP 会为每个读取操作调用 API:
- **慢速**:每个请求都有网络延迟
- **速率限制**:API 配额限制
- **上下文开销大**:响应内容冗长,消耗 AI 上下文窗口
**notion-mcp-fast** 直接从 Notion 的本地 SQLite 缓存读取:
- **即时**:无需网络调用,响应时间 <10ms
- **无限制**:无 API 调用限制
- **极简**:干净、简洁的响应
## 要求
- **仅限 macOS** (Notion 在 macOS 特定路径存储 SQLite 缓存)
- **已安装 Notion 桌面应用程序** 并已登录
- **Python 3.10+**
## 安装
```bash
git clone https://github.com/lucid-jin/notion-mcp-fast.git
cd notion-mcp-fast
```
## 设置
### Claude Code
```bash
# 添加 MCP 服务器(使用绝对路径)
claude mcp add notion-fast -- uvx --from /path/to/notion-mcp-fast notion-mcp-fast
# 使用主目录示例
claude mcp add notion-fast -- uvx --from ~/notion-mcp-fast notion-mcp-fast
```
### Claude Desktop
编辑 `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"notion-fast": {
"command": "uvx",
"args": ["--from", "/path/to/notion-mcp-fast", "notion-mcp-fast"]
}
}
}
```
### 推荐:与官方 Notion MCP 一起使用
为了完整的设置,请同时使用:
- **notion-fast**:从本地缓存快速读取
- **官方 Notion MCP**:写入和实时数据
```json
{
"mcpServers": {
"notion-fast": {
"command": "uvx",
"args": ["notion-mcp-fast"]
},
"notion": {
"command": "npx",
"args": ["-y", "@notionhq/notion-mcp-server"],
"env": {
"NOTION_API_KEY": "your-api-key"
}
}
}
}
```
## 可用工具
| 工具 | 描述 |
|------|-------------|
| `list_pages` | 列出页面,可选搜索和过滤 |
| `get_page` | 获取页面及其子块 |
| `list_databases` | 列出所有数据库(集合) |
| `get_database` | 获取数据库模式和详细信息 |
| `query_database` | 查询数据库中的行 |
| `list_users` | 列出所有用户 |
| `get_user` | 获取用户信息 |
| `list_spaces` | 列出所有工作空间 |
| `search` | 按标题搜索所有页面 |
| `get_summary` | 获取所有缓存实体的计数 |
## 工作原理
```
┌─────────────────────────────────────┐
│ Notion 桌面应用程序 │
│ │
│ 同步数据 → SQLite 数据库 │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ ~/Library/Application Support/ │
│ Notion/notion.db │
│ │
│ 包含 162K+ 块的 SQLite │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ notion-mcp-fast │
│ │
│ • 直接读取 SQLite │
│ • 5 分钟 TTL 缓存 │
│ • MCP 协议接口 │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Claude / AI 助手 │
│ │
│ 即时访问 Notion 数据! │
└─────────────────────────────────────┘
```
## 限制
- **只读**:无法创建或修改 Notion 内容
- **仅限 macOS**:SQLite 路径特定于 macOS
- **缓存延迟**:数据反映最后一次 Notion 应用程序同步(通常 <1 分钟)
- **需要 Notion 应用程序**:必须安装并登录桌面应用程序
## 故障排除
### "Notion 数据库未找到"
1. 确保已安装 Notion 桌面应用程序
2. 打开 Notion 应用程序并让其同步
3. 检查文件是否存在:`ls ~/Library/Application\ Support/Notion/notion.db`
### 数据过时
Notion 会缓存数据并频繁同步。如果数据似乎过时:
1. 打开 Notion 应用程序
2. 导航到页面/数据库
3. 等待几秒钟进行同步
4. 通过 MCP 重新查询
## License
MIT
## 灵感来源
- [linear-mcp-fast](https://github.com/everything-chalna/linear-mcp-fast) - Linear 的类似概念