Logs Cursor AI chat interactions to a Notion database, capturing prompts, responses, user information, context, and timestamps for analysis and knowledge management.
Cursor Notion MCP - Chat Logger
A Model Context Protocol (MCP) server that logs your Cursor AI chat interactions to Notion for analysis, documentation, and knowledge management.
π Features
β Automatic Chat Logging: Log Cursor AI conversations to Notion with a single command
β MCP Protocol: Implements the official Model Context Protocol specification
β Easy Setup: Simple configuration via environment variables
β Rich Context: Captures prompt, response, user, context, and timestamp
β Notion Integration: Stores data in a structured Notion database
β Privacy First: Self-hosted, no third-party services
π Prerequisites
Python 3.7 or higher
Cursor IDE (with MCP support)
Notion account with API access
requestslibrary (pip install requests)
π Quick Start
1. Clone the Repository
2. Install Dependencies
3. Set Up Notion
Create a Notion Integration
Go to Notion Integrations
Click "New integration"
Name it "Cursor Chat Logger"
Copy the Internal Integration Token (starts with
secret_)
Create a Notion Database
Create a new database in Notion
Add these properties:
Prompt (Title) - The user's question
Response (Text) - The AI's response
User (Text) - User identifier
Context (Text) - File/function context
Timestamp (Date) - When it happened
Share the database with your integration:
Click "Share" on the database
Invite your integration
Get the Database ID from the URL:
https://notion.so/YOUR_WORKSPACE/DATABASE_ID?v=... ^^^^^^^^^^^^
4. Configure Cursor
Edit ~/.cursor/mcp.json (create if it doesn't exist):
Important: Replace:
/ABSOLUTE/PATH/TO/with the actual path to this repositorysecret_YOUR_NOTION_INTEGRATION_TOKENwith your Notion integration tokenYOUR_DATABASE_IDwith your Notion database ID
5. Restart Cursor
Quit Cursor completely (βQ on Mac, Alt+F4 on Windows/Linux) and reopen it.
6. Verify Installation
You should see:
π‘ Usage
In Cursor Chat
After having a conversation with Cursor AI, simply say:
Or use the tool picker:
Type
@in the chatSelect
store_chat_logFill in the details (or let the AI do it)
Manual Tool Call
You can also invoke the tool explicitly:
π§ͺ Testing
Quick Verification
Full Test Suite
Manual MCP Protocol Test
π Project Structure
π§ Configuration
Environment Variables
Variable | Required | Description |
| Yes | Your Notion integration token |
| Yes | Your Notion database ID |
| No | Notion API version (default: 2022-06-28) |
Notion Database Schema
Your Notion database must have these properties:
Property | Type | Description |
Prompt | Title | The user's question/prompt |
Response | Text | The assistant's response |
User | Text | User identifier (email) |
Context | Text | File path, function name, etc. |
Timestamp | Date | When the interaction occurred |
π Troubleshooting
Server Not Showing in Cursor
Check that
~/.cursor/mcp.jsonis valid JSONVerify the absolute path to
mcp_notion_server.pyis correctRestart Cursor completely (quit and reopen)
Check Cursor logs:
~/Library/Logs/Cursor/(Mac) or%APPDATA%\Cursor\logs\(Windows)
Tool Not Appearing
Verify the server is listed in Cursor Settings β Features β MCP
Try typing the full tool name:
@store_chat_logCheck Developer Tools (Help β Toggle Developer Tools) for errors
Notion API Errors
Verify your
NOTION_API_KEYis correct (starts withsecret_)Verify your
NOTION_DATABASE_IDis correct (32 characters, hex)Ensure the integration has access to the database (Share β Invite integration)
Check that all required properties exist in the database
Python Errors
π Security
β οΈ Important Security Notes:
Never commit your Notion API key to version control
Use environment variables for sensitive data
Restrict integration permissions in Notion to only the databases you need
Review logged data regularly to ensure no sensitive information is stored
Consider encrypting sensitive fields before logging
Recommended: Use .env File
Instead of hardcoding credentials in mcp.json, use a .env file:
Then update mcp.json:
π Documentation
Setup Guide - Detailed setup instructions
Architecture - Technical architecture and design
MCP Specification - Official MCP docs
Notion API - Notion API documentation
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/AmazingFeature)Commit your changes (
git commit -m 'Add some AmazingFeature')Push to the branch (
git push origin feature/AmazingFeature)Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Model Context Protocol - For the MCP specification
Cursor - For the amazing AI-powered IDE
Notion - For the powerful API and database
π Support
Issues: GitHub Issues
Discussions: GitHub Discussions
πΊοΈ Roadmap
Support for multiple Notion databases
Filtering/redaction of sensitive data
Export to other formats (CSV, JSON)
Web dashboard for viewing logs
Automatic tagging and categorization
Search and analytics features
Made with β€οΈ for the Cursor community
If you find this useful, please β star the repository!
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Logs Cursor AI chat interactions to Notion databases for documentation and knowledge management. Captures prompts, responses, context, and timestamps in a structured format for analysis and reference.