Notion Mcp Server 7hr

Notion Mcp Server 7hr

🚀 NOTION-MCP-SERVER

这是一个用于与Notion集成的MCP(多方协作协议)服务器项目。我们旨在通过提供简单易用且功能强大的API,助力开发者快速构建与Notion协同工作的应用程序。

🚀 快速开始

在五分钟内设置本地MCP服务器:

git clone https://github.com/your-username/notion-mcp-server.git
cd notion-mcp-server
npm install
npm start

✨ 主要特性

  • 支持Notion API:借助MCP协议与Notion平台实现全面集成。
  • 易于部署和扩展:采用现代架构,保障服务器稳定运行且便于扩展。
  • 详细的文档支持:提供全面的API文档和技术指南,助力开发者快速上手。

📦 安装指南

为了使项目正常工作,请在项目设置中启用以下权限:

{
"notion": {
"read_write": true,
"discussion_comments": true,
"database_access": true,
"user_management": true
}
}

💻 使用示例

基础用法

const { NotionMCPClient } = require('notion-mcp-client');

async function quickStart() {
const client = new NotionMCPClient({
token: 'your_notion_integration_token'
});

// 创建新页面
const pageId = await client.pages.create({
title: 'My New Page',
content: 'This is a test page created via MCP.'
});

console.log('页面ID:', pageId);
}

quickStart().catch(console.error);

📚 详细文档

完整API文档

以下是完整的Notion MCP Server API接口列表:

1. 创建页面

  • 方法POST /api/pages/create
  • 参数
    • title: string
    • content: string
  • 返回值:新创建的页面ID

2. 更新页面内容

  • 方法PUT /api/pages/{pageId}
  • 参数
    • newContent: string
  • 返回值:更新成功的状态

3. 删除页面

  • 方法DELETE /api/pages/{pageId}
  • 参数:无
  • 返回值:删除操作的状态

4. 查询数据库

  • 方法GET /api/databases/{dbId}/query
  • 参数
    • filter: object (可选)
    • sorts: array (可选)
  • 返回值:查询结果数组

5. 创建新数据库

  • 方法POST /api/databases
  • 参数
    • name: string
    • schema: object
  • 返回值:新创建的数据库ID

6. 获取用户信息

  • 方法GET /api/users/{userId}
  • 参数:无
  • 返回值:用户详细信息对象

7. 创建新用户

  • 方法POST /api/users
  • 参数
    • username: string
    • email: string
    • role: string ("user" or "admin")
  • 返回值:新建用户的ID

8. 更新用户角色

  • 方法PUT /api/users/{userId}/role
  • 参数
    • newRole: string
  • 返回值:更新操作的状态

9. 获取当前用户

  • 方法GET /api/users/current
  • 参数:无
  • 返回值:当前用户的ID和角色信息

10. 处理文件上传

  • 方法POST /api/files/upload
  • 参数
    • file: File对象
    • description: string (可选)
  • 返回值:上传的文件URL

如需进一步了解每个API的具体使用细节,请参考我们提供的完整开发者文档。

🤝 贡献指南

我们欢迎社区贡献!如果你发现任何问题,请在GitHub上报告。我们也非常感谢你的功能建议和代码提交。

📄 许可证

此MCP服务器基于MIT License授权,允许您自由使用、修改和分发软件,前提是您保留版权声明和许可信息。有关详细信息,请参阅项目仓库中的LICENSE文件。

  • 0 关注
  • 0 收藏,11 浏览
  • system 提出于 2025-09-28 23:21

相似服务问题