Notion Knowledge MCP Server

Notion Knowledge MCP Server

A Cloudflare Workers-based service that enables intelligent searching, automatic code snippet recording, and statistical analysis of programming knowledge stored in Notion databases.

Category
Visit Server

README

Notion Knowledge MCP Server

🚀 基於 Cloudflare Workers 的 Notion 知識庫 MCP 服務器,專為程式開發知識管理設計

Deploy to Cloudflare Workers License: MIT

✨ 特色功能

  • 🔍 智能搜索 - 在 Notion 知識庫中快速找到相關內容
  • 📝 自動記錄 - Claude Code Hooks 自動保存代碼片段
  • 📊 統計分析 - 知識庫內容統計和趨勢分析
  • 🌐 全球加速 - Cloudflare CDN 確保極速響應
  • 🔒 安全可靠 - 環境變數加密存儲,API Token 安全管理

🚀 快速開始

1. 部署到 Cloudflare Workers

方法一:一鍵部署

Deploy to Cloudflare Workers

方法二:手動部署

# 克隆倉庫
git clone https://github.com/etjang10/notion-knowledge-mcp.git
cd notion-knowledge-mcp

# 安裝依賴
npm install

# 登入 Cloudflare
npx wrangler login

# 設定環境變數
npx wrangler secret put NOTION_TOKEN
npx wrangler secret put NOTION_DATABASE_ID

# 部署
npm run deploy

2. 配置 Notion

  1. 前往 Notion Integrations
  2. 創建新的 Integration
  3. 複製 Integration Token
  4. 創建或選擇一個 Notion 資料庫作為知識庫
  5. 複製資料庫 ID(從資料庫 URL 中獲取)
  6. 在你的知識庫頁面授權 Integration

2.1 部署到 Cloudflare Workers(可選)

如果要部署到 Cloudflare Workers:

# 設置環境變數
wrangler secret put NOTION_TOKEN        # 你的 Notion Integration Token
wrangler secret put NOTION_DATABASE_ID  # 你的 Notion 資料庫 ID

# 部署
wrangler deploy

3. 配置 AI 客戶端

Claude Desktop

# 複製配置檔案
cp config/claude-desktop.json ~/Library/Application\ Support/Claude/claude_desktop_config.json

Claude Code

# 使用 claude mcp add 命令(推薦)
claude mcp add notion-knowledge node ./src/mcp-server.js

# 或手動配置:將以下內容添加到 ~/.claude/settings.json
{
  "mcpServers": {
    "notion-knowledge": {
      "command": "node",
      "args": ["<path-to-project>/src/mcp-server.js"]
    }
  }
}

Gemini CLI

# 安裝 Gemini CLI
npm install -g @google/gemini-cli

# 配置 MCP 服務器
cp config/gemini-cli-settings.json ~/.gemini/settings.json
# 或將 notion-knowledge 配置合併到現有的 ~/.gemini/settings.json

📖 使用指南

基本操作

搜索知識:

請搜索關於 "React Hooks" 的知識

添加知識:

請將這段代碼保存到知識庫:
[你的代碼]

查看統計:

請顯示知識庫統計信息

API 端點

  • GET /health - 健康檢查
  • GET /tools - 工具列表
  • POST /call - MCP 工具調用

🛠️ 開發

本地開發

npm run dev

測試

npm test

部署

npm run deploy

📝 配置

環境變數

  • NOTION_TOKEN - Notion Integration Token (必須)
  • NOTION_DATABASE_ID - Notion 資料庫 ID (必須)

自定義配置

編輯 wrangler.toml 來自定義部署設定

🤝 貢獻

歡迎提交 Issue 和 Pull Request!

  1. Fork 這個倉庫
  2. 創建你的功能分支 (git checkout -b feature/AmazingFeature)
  3. 提交你的修改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 打開一個 Pull Request

📄 授權

這個專案使用 MIT 授權 - 查看 LICENSE 文件了解詳情

🙏 致謝

📞 支援

如有問題請:

  1. 查看 Issues
  2. 創建新的 Issue
  3. 查看文檔 docs/

Live Demo: https://notion-knowledge.etjang10.workers.dev

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured