Notion MCP
Notion มี official MCP server ที่ช่วยให้ AI สามารถอ่าน/เขียน Notion pages และ databases ได้
เตรียมตัวก่อนเริ่ม
Section titled “เตรียมตัวก่อนเริ่ม”- มี Notion account
- สร้าง Notion Integration (API Key)
วิธีสร้าง Integration
Section titled “วิธีสร้าง Integration”- ไปที่ https://www.notion.so/profile/integrations
- กด “New integration”
- ตั้งชื่อและเลือก workspace
- Copy Integration Token (เริ่มด้วย
ntn_)
แชร์ Content ให้ Integration
Section titled “แชร์ Content ให้ Integration”ไปที่หน้า page ที่ต้องการ → กด ... → “Add connections” → เลือก integration ที่สร้างไว้
ตั้งค่าใน opencode.jsonc
Section titled “ตั้งค่าใน opencode.jsonc”{ "mcp": { "notion": { "type": "local", "command": ["npx", "-y", "@notionhq/notion-mcp-server"], "env": { "NOTION_TOKEN": "ntn_xxxx" }, "enabled": true } }}⚠️ แนะนำใช้
{env:NOTION_TOKEN}แทนการใส่ token ตรงๆ เพื่อความปลอดภัย
{ "mcp": { "notion": { "type": "local", "command": ["npx", "-y", "@notionhq/notion-mcp-server"], "env": { "NOTION_TOKEN": "{env:NOTION_TOKEN}" }, "enabled": true } }}Tools ที่มีให้ใช้
Section titled “Tools ที่มีให้ใช้”Notion MCP มี tools ให้ใช้มากมาย เช่น:
search- ค้นหา pages/databasesget-page- ดึงข้อมูล pageget-block-children- ดึง content ใน pagepatch-block-children- เพิ่ม/แก้ไข contentcreate-page- สร้าง page ใหม่update-page- แก้ไข page properties
ตัวอย่างการใช้งาน
Section titled “ตัวอย่างการใช้งาน”หลังจากตั้งค่าเสร็จ ลองถาม AI ว่า:
Show me the content of my "Projects" page using notionหรือ
Create a new page titled "Meeting Notes" under the "Work" page using notionทดสอบความเข้าใจเกี่ยวกับ Notion MCP
ข้อ 1 / 40%