使用说明

项目简介

SystemPrompt Notion Server 是一个基于 Model Context Protocol (MCP) 构建的高性能服务器,旨在无缝连接 Notion 与您的 AI 工作流程。通过此服务器,AI 智能体可以通过标准化的 MCP 协议与 Notion 页面、数据库进行交互,实现内容管理和工作流程自动化。

主要功能点

  • 全面的内容管理
    • 创建和更新包含富文本格式的 Notion 页面
    • 在您的 Notion 工作空间中进行搜索
  • 开发者友好
    • 完善的 Jest 单元测试覆盖
    • TypeScript 支持
    • 完整的错误处理机制
    • 详细的日志记录和调试工具

安装步骤

  1. 环境准备

    • 确保已安装 Node.js 和 npm。
    • 访问 systemprompt.io/console 注册并获取 Systemprompt API Key (免费)。
    • 拥有 Notion 账号和工作空间。
    • notion.so/my-integrations 创建 Notion Integration,并授予以下能力:
      • 读取、更新、插入内容
      • 数据库管理
      • 搜索功能
  2. 安装服务器

    您可以通过 Smithery 自动安装,或者使用 npm 手动安装。

    • 通过 Smithery 安装 (推荐 Claude Desktop 用户):

      npx -y @smithery/cli install systemprompt-mcp-notion --client claude
    • 通过 npm 安装:

      npm install systemprompt-mcp-notion
  3. 配置环境变量

    在项目根目录下创建 '.env' 文件,并填入您的 API Keys:

    SYSTEMPROMPT_API_KEY=your_systemprompt_api_key  # 您的 Systemprompt API Key
    NOTION_API_KEY=your_notion_integration_token # 您的 Notion Integration Token

服务器配置

为了让 MCP 客户端(如 Claude)连接到 SystemPrompt Notion Server,您需要在 MCP 客户端的配置文件中添加以下服务器配置信息。请根据您的安装方式选择相应的配置:

  • 如果使用 'npx' 启动服务器 (推荐):

    {
      "mcpServers": {
        "notion": {
          "command": "npx",
          "args": ["systemprompt-mcp-notion"],
          "env": {
            "SYSTEMPROMPT_API_KEY": "your_systemprompt_api_key", // 替换为您的 Systemprompt API Key
            "NOTION_API_KEY": "your_notion_integration_token"  // 替换为您的 Notion Integration Token
          }
        }
      }
    }
  • 如果本地安装并使用 'node' 启动服务器:

    {
      "mcpServers": {
        "notion": {
          "command": "node",
          "args": ["./node_modules/systemprompt-mcp-notion/build/index.js"],
          "env": {
            "SYSTEMPROMPT_API_KEY": "your_systemprompt_api_key", // 替换为您的 Systemprompt API Key
            "NOTION_API_KEY": "your_notion_integration_token"  // 替换为您的 Notion Integration Token
          }
        }
      }
    }

基本使用方法

配置完成后,启动您的 MCP 客户端,它将自动连接到 SystemPrompt Notion Server。您可以通过 MCP 客户端的功能列表访问 Notion 的资源、工具和 Prompt,从而在 AI 工作流中集成 Notion 的强大功能。

信息

分类

生产力应用