AI-Notion Integration MCP Server
Enables AI assistants to save and manage question-and-answer pairs within a structured Notion database. It provides tools for database setup, entry creation, and querying existing conversation history.
README
Notion MCP Server - AI-Notion Integration
A Model Context Protocol (MCP) server that seamlessly integrates Claude AI with Notion databases. Save your conversations, Q&A pairs, and learning progress directly to Notion from Claude Desktop.
🎯 What is This?
This project allows Claude (via Claude Desktop) to:
- ✅ Save conversations and Q&A pairs to Notion automatically
- ✅ Query your Notion database from Claude
- ✅ Track learning progress with mastery levels
- ✅ Organize information in a structured database
📋 Quick Start
New to this project? Start here: QUICKSTART.md - A complete step-by-step guide for first-time users!
Setup
- Clone the repository
- Install dependencies:
npm install - Create a
.envfile with the following variables:NOTION_API_TOKEN=your_notion_integration_token NOTION_DATABASE_ID=your_notion_database_id NOTION_PARENT_PAGE_ID=your_notion_page_id (only needed for database setup)
Notion Integration Setup
-
Go to Notion Integrations and create a new integration <img width="600" alt="Screenshot 2026-01-31 at 7 50 23 PM" src="https://github.com/user-attachments/assets/d1373f24-663f-4c87-8e54-582707f411e6" />
-
Give your integration a name (e.g., "AI QA Tracker") and select the appropriate capabilities (read & write)
-
Copy the "Internal Integration Token" and paste it into your
.envfile
<img width="600" alt="Screenshot 2026-01-31 at 7 50 11 PM" src="https://github.com/user-attachments/assets/2e6c446f-cd99-4c30-94bf-f5933bee35ca" />
- Share your Notion database with your integration
Database Setup
To create a new database structure for tracking AI questions/answers:
# 1. Install dependencies
npm install
# 2. Configure .env (copy from .env.example)
cp .env.example .env
# Edit .env with your Notion credentials
# 3. Build the project
npm run build
# 4. Configure Claude Desktop
# Edit ~/Library/Application\ Support/Claude/claude_desktop_config.json
# See QUICKSTART.md Step 3 for details
# 5. Restart Claude Desktop
# You're ready to use it!
📚 Documentation
| Document | Purpose |
|---|---|
| QUICKSTART.md | Complete setup guide for new users |
| README.md | This file - project overview |
.env.example |
Configuration template |
🔧 System Requirements
- Node.js: 18 or higher
- npm: 9 or higher
- Operating System: macOS, Windows, or Linux
- Notion Account: With an active workspace
- Claude Desktop: Latest version
🚀 Core Features
1. Notion Integration
- Create and manage Notion databases from your code
- Automatic database setup with proper structure
- Full read/write access through Notion API
2. MCP Server
- Exposes tools to Claude Desktop via MCP protocol
- Built-in support for ES Modules (ESM)
- Type-safe with TypeScript
3. AI-Ready Tools
The server provides these tools for Claude to use:
notion_ai_save_entry- Save Q&A to Notionnotion_query_database- Search your Notion databasenotion_update_mastery- Track learning progress
📁 Project Structure
notion-mcp-server/
├── src/
│ ├── index.ts # Main MCP server entry point
│ ├── config.ts # Environment & config validation
│ ├── types.ts # TypeScript type definitions
│ ├── setup-database.ts # Database initialization script
│ ├── test-notion.ts # Notion API connection tests
│ ├── mock-test.ts # Tests without real Notion
│ └── test.ts # MCP server tests
├── dist/ # Compiled JavaScript (auto-generated)
├── .env # Your configuration (don't commit!)
├── .env.example # Configuration template
├── tsconfig.json # TypeScript settings
├── package.json # Dependencies & scripts
├── QUICKSTART.md # First-time user guide
└── README.md # This file
🔑 Configuration
Environment Variables
Create a .env file in the project root with:
# Required: Notion API Integration Token
NOTION_API_TOKEN=ntn_your_token_here
# Required: Notion page ID where database will be created
NOTION_PARENT_PAGE_ID=your_page_id_here
# Optional: Existing database ID (auto-created on first run)
NOTION_DATABASE_ID=your_database_id_here
See .env.example for more details.
Claude Desktop Configuration
Edit your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"notion-server": {
"command": "node",
"args": [
"/path/to/notion-mcp-server/dist/index.js"
],
"env": {
"NOTION_API_TOKEN": "ntn_your_token",
"NOTION_PARENT_PAGE_ID": "your_page_id",
"NOTION_DATABASE_ID": "your_database_id"
}
}
}
}
🛠️ Available Commands
# Install dependencies
npm install
# Build the project (TypeScript → JavaScript)
npm run build
# Run tests
npm run test
# Test Notion connection specifically
npm run test-notion
# Start in development mode with auto-reload
npm run dev
# Start the server (production)
npm start
📖 How It Works
1. You write in Claude Desktop
2. Claude uses the Notion tools
3. MCP Server (dist/index.js) handles the request
4. Notion API saves your data
5. Your Notion database is updated
❓ Why TypeScript → JavaScript?
Key Question: Why do we need to build?
- Source:
src/index.ts(TypeScript with type checking) - Build:
npm run build(compilation step) - Runtime:
dist/index.js(plain JavaScript) - Why: Claude Desktop runs Node.js, which needs
.jsfiles, not.ts
Development: src/index.ts
↓ npm run build
Production: dist/index.js ← Claude Desktop executes this
🔐 Security Notes
- ⚠️ Never commit
.envfile - It contains your API token - ✅
.envis already in.gitignore - ✅ Safe to share:
src/,package.json,tsconfig.json,.env.example - ❌ Never share:
.env,dist/,node_modules/
🐛 Troubleshooting
Claude Desktop shows "Failed to connect"
- Check
.envfile has correct values - Run
npm run buildto generatedist/index.js - Verify path in Claude Desktop config is correct
- Restart Claude Desktop
"NOTION_API_TOKEN is not set"
- Create
.envfile (copy from.env.example) - Add your actual Notion token
- Restart Claude Desktop
"Database permission denied"
- Go to https://www.notion.so/my-integrations
- Find your integration
- Share your Notion page with the integration
- Restart Claude Desktop
"Cannot find module dist/index.js"
- Run
npm installfirst - Run
npm run build - Check
dist/folder exists and containsindex.js
📚 Next Steps
- First time? Read QUICKSTART.md
- Want to customize? Modify
src/index.tsto add new tools - Need help? Check QUICKSTART.md's FAQ section
📝 Git Best Practices
What to commit:
src/- Your source codepackage.json- Dependencies listtsconfig.json- Build configuration.env.example- Configuration templateQUICKSTART.md- Documentation.gitignore- Git settings
What NOT to commit:
dist/- Regenerate withnpm run buildnode_modules/- Regenerate withnpm install.env- Contains secrets, already ignored*.log- Log files.DS_Store- macOS system files
🤝 Contributing
To modify or extend this project:
- Edit files in
src/ - Run
npm run buildto recompile - Test locally:
npm run test - Restart Claude Desktop to see changes
📄 License
ISC
🙏 Acknowledgments
Questions? Check QUICKSTART.md for detailed step-by-step instructions! 🚀
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
E2B
Using MCP to run code via e2b.