这是一个用于与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": {
"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);
以下是完整的Notion MCP Server API接口列表:
POST /api/pages/createtitle: stringcontent: stringPUT /api/pages/{pageId}newContent: stringDELETE /api/pages/{pageId}GET /api/databases/{dbId}/queryfilter: object (可选)sorts: array (可选)POST /api/databasesname: stringschema: objectGET /api/users/{userId}POST /api/usersusername: stringemail: stringrole: string ("user" or "admin")PUT /api/users/{userId}/rolenewRole: stringGET /api/users/currentPOST /api/files/uploadfile: File对象description: string (可选)如需进一步了解每个API的具体使用细节,请参考我们提供的完整开发者文档。
我们欢迎社区贡献!如果你发现任何问题,请在GitHub上报告。我们也非常感谢你的功能建议和代码提交。
此MCP服务器基于MIT License授权,允许您自由使用、修改和分发软件,前提是您保留版权声明和许可信息。有关详细信息,请参阅项目仓库中的LICENSE文件。