Notion MCP(模型上下文协议)服务器能够让大语言模型(如Claude)与Notion进行交互,实现更智能的内容管理和自动化操作。本指南将详细介绍该服务器的设置、配置和使用方法。
git clone https://github.com/your-repository.git
cd your-repository
npm install
npm run build
npm start
在config.json文件中添加你的Notion API密钥:
{
"notion": {
"apiKey": "your_notion_api_key_here"
}
}
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"
}
}
]
}
}
}
}
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log