Skip to main content
Glama

Notion MCP Server

by 589411
SETUP.md2.07 kB
# Notion MCP 伺服器設定指南 ## 快速開始 ### 1. 設定 Notion 整合 1. 前往 [Notion 開發者頁面](https://www.notion.so/my-integrations) 2. 點擊「新增整合」 3. 填寫整合名稱:`MCP Server` 4. 選擇相關的 workspace 5. 設定權限: - ✅ 讀取內容 - ✅ 更新內容 - ✅ 插入內容 6. 複製 Internal Integration Token ### 2. 建立環境變數檔案 ```bash cp .env.example .env ``` 編輯 `.env` 檔案,貼上您的 token: ``` NOTION_TOKEN=secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ### 3. 授權整合存取頁面/資料庫 在 Notion 中: 1. 開啟您想要 MCP 伺服器存取的頁面或資料庫 2. 點擊右上角的「...」選單 3. 選擇「連接」 4. 搜尋並選擇您的整合名稱 5. 點擊「確認」 ### 4. 測試連接 ```bash # 建立專案 npm run build # 啟動開發伺服器 npm run dev ``` ### 5. 在 VS Code 中偵錯 1. 開啟 VS Code 2. 按 `F5` 或點擊「執行和偵錯」 3. 選擇「Launch Notion MCP Server」配置 4. 伺服器將在偵錯模式下啟動 ## 常見問題 ### Q: 出現 "Authentication failed" 錯誤 A: 請檢查: - `.env` 檔案中的 `NOTION_TOKEN` 是否正確 - Token 是否已過期 - 整合是否仍然活躍 ### Q: 無法存取特定頁面或資料庫 A: 請確認: - 整合已被授權存取該頁面/資料庫 - 您的 Notion 帳戶有足夠的權限 - 頁面 ID 或資料庫 ID 是正確的 ### Q: MCP 客戶端無法連接 A: 檢查: - 伺服器是否正在執行 - stdio 通訊是否正常 - 防火牆設定 ## 範例使用 ### 搜尋頁面 ```json { "name": "search-pages", "arguments": { "query": "會議記錄" } } ``` ### 建立頁面 ```json { "name": "create-page", "arguments": { "parent": { "page_id": "your-parent-page-id" }, "properties": { "title": { "title": [ { "text": { "content": "新的會議記錄" } } ] } } } } ``` 更多詳細資訊請參閱 [README.md](README.md)。

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/589411/notion_mcp_connection'

If you have feedback or need assistance with the MCP directory API, please join our Discord server