返回 MCP 目录
public公开dns本地运行

notion-mcp-server-ewq

Notion MCP服务器是一个为Notion集成设计的模型上下文协议服务,允许Claude等LLM与用户的Notion工作区进行交互,提供搜索、获取页面、创建/更新页面和数据库等功能。

article

README

🚀 Notion MCP 服务器指南

Notion MCP(模型上下文协议)服务器能够让大语言模型(如Claude)与Notion进行交互,实现更智能的内容管理和自动化操作。本指南将详细介绍该服务器的设置、配置和使用方法。

🚀 快速开始

📦 安装指南

安装依赖

  1. 确保已经安装了Node.js和npm。
  2. 克隆项目仓库:
    git clone https://github.com/your-repository.git
    cd your-repository
    
  3. 安装依赖项:
    npm install
    

构建与启动

  1. 在项目根目录下运行构建命令:
    npm run build
    
  2. 启动服务器:
    npm start
    

🔧 配置与集成

配置Notion API密钥

config.json文件中添加你的Notion API密钥:

{
  "notion": {
    "apiKey": "your_notion_api_key_here"
  }
}

创建数据库和页面

  1. 在Notion中创建一个新数据库,并授予API访问权限。
  2. 使用生成的databaseId进行后续操作。

💻 使用示例

基础用法

更新数据库条目

{
  "tool_name": "update-database-entry",
  "tool_params": {
    "pageId": "your_page_id_here",
    "properties": {
      "Status": {
        "select": {
          "name": "Completed"
        }
      },
      "Priority": {
        "select": {
          "name": "High"
        }
      },
      "Due Date": {
        "date": {
          "start": "2023-12-31"
        }
      }
    }
  }
}

创建数据库行

{
  "tool_name": "create-database-row",
  "tool_params": {
    "databaseId": "your_database_id_here",
    "properties": {
      "Name": {
        "title": [
          {
            "text": {
              "content": "New Task"
            }
          }
        ]
      },
      "Status": {
        "select": {
          "name": "Not Started"
        }
      },
      "Priority": {
        "select": {
          "name": "Medium"
        }
      },
      "Due Date": {
        "date": {
          "start": "2023-12-15"
        }
      },
      "Notes": {
        "rich_text": [
          {
            "text": {
              "content": "This is a new task created via the API"
            }
          }
        ]
      }
    }
  }
}

📚 详细文档

故障排除

  • 如果工具未显示,请检查Claude桌面版日志:
    tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
    
  • 确保Notion API密钥正确设置,并且集成获得了相应页面的访问权限。

未来改进

  • 增加数据库查询功能
  • 支持更多内容格式化选项
  • 扩展对更多块类型的支持
help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端