概覽
Notion MCP 伺服器是什麼?
Notion MCP 伺服器是一個官方伺服器,旨在增強 Notion 的功能,這是一個受歡迎的生產力和組織工具。這個伺服器作為後端解決方案,使用戶能夠更有效地管理他們的 Notion 工作區,提供簡化工作流程和改善協作的功能。
Notion MCP 伺服器的功能
- 實時協作:伺服器支持實時更新,允許多個用戶同時在同一 Notion 頁面上工作,沒有任何延遲。
- 數據同步:它確保在 Notion 中所做的所有更改都會在設備之間同步,為用戶提供無縫的體驗。
- 自定義集成:用戶可以集成各種第三方應用程序和服務,增強 Notion 的功能。
- 用戶管理:伺服器提供強大的用戶管理功能,允許管理員控制不同用戶的訪問權限。
- API 訪問:開發人員可以利用 API 創建與 Notion 數據一起工作的自定義應用程序或集成。
如何設置 Notion MCP 伺服器
- 安裝:首先從 GitHub 的官方庫下載 Notion MCP 伺服器。
- 配置:按照文檔中提供的設置說明配置伺服器以滿足您的需求。
- 連接到 Notion:將您的 Notion 帳戶連接到伺服器,以啟用數據同步和訪問所有功能。
- 測試:設置後,進行測試以確保所有功能正常運行。
- 部署:一旦所有配置和測試完成,將伺服器部署到您的組織或個人項目中使用。
常見問題解答
問:Notion MCP 伺服器是免費使用的嗎?
答:是的,Notion MCP 伺服器是開源的,並且可以免費使用。不過,如果用戶選擇在付費伺服器上托管,可能會產生費用。
問:我可以自定義 Notion MCP 伺服器嗎?
答:當然可以!伺服器設計為可自定義,允許開發人員修改代碼以符合他們的特定需求。
問:運行 Notion MCP 伺服器的系統要求是什麼?
答:伺服器可以在大多數現代操作系統上運行,但建議擁有穩定的網絡連接和足夠的 RAM 來處理多個用戶。
問:我如何報告問題或貢獻項目?
答:用戶可以通過訪問 GitHub 倉庫並遵循那裡提供的貢獻指南來報告問題或貢獻項目。
問:Notion MCP 伺服器有支持嗎?
答:雖然沒有官方支持團隊,但用戶可以通過論壇和 GitHub 問題頁面向社區尋求幫助。
詳細
Notion MCP Server
[!NOTE]
We’ve introduced Notion MCP (Beta), a remote MCP server with the following improvements:
- Easy installation via standard OAuth. No need to fiddle with JSON or API token anymore.
- Powerful tools tailored to AI agents. These tools are designed with optimized token consumption in mind.
Learn more and try it out here
This project implements an MCP server for the Notion API.
Installation
1. Setting up Integration in Notion:
Go to https://www.notion.so/profile/integrations and create a new internal integration or select an existing one.
While we limit the scope of Notion API's exposed (for example, you will not be able to delete databases via MCP), there is a non-zero risk to workspace data by exposing it to LLMs. Security-conscious users may want to further configure the Integration's Capabilities.
For example, you can create a read-only integration token by giving only "Read content" access from the "Configuration" tab:
2. Connecting content to integration:
Ensure relevant pages and databases are connected to your integration.
To do this, visit the Access tab in your internal integration settings. Edit access and select the pages you'd like to use.
Alternatively, you can grant page access individually. You'll need to visit the target page, and click on the 3 dots, and select "Connect to integration".
3. Adding MCP config to your client:
Using npm:
Add the following to your .cursor/mcp.json
or claude_desktop_config.json
(MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
)
{
"mcpServers": {
"notionApi": {
"command": "npx",
"args": ["-y", "@notionhq/notion-mcp-server"],
"env": {
"OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"
}
}
}
}
Using Docker:
There are two options for running the MCP server with Docker:
Option 1: Using the official Docker Hub image:
Add the following to your .cursor/mcp.json
or claude_desktop_config.json
:
{
"mcpServers": {
"notionApi": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e", "OPENAPI_MCP_HEADERS",
"mcp/notion"
],
"env": {
"OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer ntn_****\",\"Notion-Version\":\"2022-06-28\"}"
}
}
}
}
This approach:
- Uses the official Docker Hub image
- Properly handles JSON escaping via environment variables
- Provides a more reliable configuration method
Option 2: Building the Docker image locally:
You can also build and run the Docker image locally. First, build the Docker image:
docker-compose build
Then, add the following to your .cursor/mcp.json
or claude_desktop_config.json
:
{
"mcpServers": {
"notionApi": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"OPENAPI_MCP_HEADERS={\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\"}",
"notion-mcp-server"
]
}
}
}
Don't forget to replace ntn_****
with your integration secret. Find it from your integration configuration tab:
Installing via Smithery
To install Notion API Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @makenotion/notion-mcp-server --client claude
Examples
- Using the following instruction
Comment "Hello MCP" on page "Getting started"
AI will correctly plan two API calls, v1/search
and v1/comments
, to achieve the task
- Similarly, the following instruction will result in a new page named "Notion MCP" added to parent page "Development"
Add a page titled "Notion MCP" to page "Development"
- You may also reference content ID directly
Get the content of page 1a6b35e6e67f802fa7e1d27686f017f2
Development
Build
npm run build
Execute
npx -y --prefix /path/to/local/notion-mcp-server @notionhq/notion-mcp-server
Publish
npm publish --access public
伺服器配置
{
"mcpServers": {
"notion-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--makenotion--notion-mcp-server--notion-mcp-server",
"node bin/cli.mjs"
],
"env": {
"OPENAPI_MCP_HEADERS": "openapi-mcp-headers"
}
}
}
}