Notion本地缓存搜索工具

通过读取Notion桌面应用的本地SQLite缓存,实现在Claude中快速搜索和查看Notion文档的工具。

  • by lu1ee
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 lu1ee/notion-local-mcp

使用说明

本地MCP概念

读取Notion桌面应用程序的本地SQLite缓存,在Claude中快速搜索和查看Notion文档的MCP服务器。

快速启动(Quick Start)

1.必备条件

2.自动设置

在终端上运行以下命令时自动设置:

npx @lulee/notion-local-mcp setup
🔧 Notion Local MCP Setup
========================================

🔍 Operating system: macOS
✅ Notion found: /Users/user/Library/Application Support/Notion/notion.db

Which apps do you want to configure?

  1. Claude Desktop Chat
  2. Claude Code (CLI)
  3. Both (recommended)

Enter choice [1-3, default: 3]: 3

========================================

✅ Claude Desktop: Successfully configured notion-local for Claude Desktop
✅ Claude Code: Successfully configured notion-local for Claude Code

🎉 Setup complete!

Please restart your Claude app to apply the changes.

3.重新启动应用程序

重新启动Claude Desktop或Claude Code即可使用。

结束!


通知API MCP与通知本地

通知API MCP 通知本地
动作方式 调用Notion服务器API 直接读取本地SQLite
人工智能概念 使用(语义搜索) 已禁用
速度 速度慢(网络)速度快(本地)
离线 不可能 可能
速率限制 有 没有
数据最新 实时 Notion应用程序同步时间
写入功能 有 没有(只读)

建议使用:

  • 搜索/查询 → notion-local (快速,不使用Notion AI,可离线)
  • 创建/修改 → Notion API MCP (写入需要服务器API)

支持平台

OS Notion DB路径 状态
macOS ~/Library/Application Support/Notion/notion.db 已验证
窗户 %APPDATA%\Notion\notion.db 支持(未验证)
Linux ~/.config/Notion/notion.db 非正式

参考:Notion是 不提供官方Linux桌面应用程序在.Linux中,只能在社区非正式构建(例如notion-app-electron)中工作。


MCP工具

通知_本地搜索

按关键字搜索页面

{
  query: string,          // 검색어 (필수)
  type?: "page" | "all",  // 검색 범위 (기본: page)
  limit?: number          // 최대 결과 수 (기본: 20)
}

notion_local_recent

最近修改的页面列表

{
  limit?: number,   // 최대 결과 수 (기본: 20)
  days?: number     // 며칠 이내 (기본: 30)
}

通知_本地_页面

查看整个页面的内容

{
  pageId: string,   // 페이지 UUID (필수)
  depth?: number    // 중첩 블록 깊이 (기본: 3)
}

通知_本地_租金

浏览页面的上层

{
  pageId: string    // 페이지 UUID (필수)
}

通知_本地儿童

页面的子页面列表

{
  pageId: string,   // 페이지 UUID (필수)
  depth?: number    // 탐색 깊이 (기본: 2)
}

手动设置(高级)

如果无法自动设置,可以手动设置。

克劳德桌面聊天

~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "notion-local": {
      "command": "npx",
      "args": ["-y", "@lulee/notion-local-mcp"],
      "env": {
        "NOTION_DB_PATH": "/Users/YOUR_USERNAME/Library/Application Support/Notion/notion.db"
      }
    }
  }
}

克劳德代码

~/.claude.json:

{
  "mcpServers": {
    "notion-local": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@lulee/notion-local-mcp"],
      "env": {
        "NOTION_DB_PATH": "/Users/YOUR_USERNAME/Library/Application Support/Notion/notion.db"
      }
    }
  }
}

开发

要在本地开发,请:

git clone https://github.com/lulee/notion-local-mcp.git
cd notion-local-mcp
npm install
npm run build
npm run setup  # 로컬 빌드를 Claude에 연결

注意事项

  • 只读:只读取本地缓存,不修改Notion数据。
  • 需要Notion应用程序:必须安装Notion桌面应用程序才能存在缓存。
  • 同步延迟:在同步Notion应用程序之前,可能不会反映最近的更改。

许可证

麻省理工学院