razibra/notion-mcp-server
If you are the rightful owner of notion-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Notion MCP Server is a Model Context Protocol server designed to integrate seamlessly with Notion, enabling AI assistants like Claude to interact with Notion pages and databases.
notion_create_page
Create a new Notion page.
notion_get_page
Retrieve page content and properties.
notion_update_page
Update page properties or content.
notion_delete_page
Delete a page (move to trash).
notion_query_database
Query a database with filters and sorts.
Notion MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Notion, allowing AI assistants like Claude to read and write Notion pages, manage databases, and more.
Features
- š Page Management: Create, read, update, and delete Notion pages
- š Database Operations: Query and manipulate Notion databases
- š Search: Search across your Notion workspace
- āļø Rich Text Support: Handle formatted text, headings, lists, and more
- š Block Management: Add and modify various block types
- š·ļø Property Support: Work with all Notion property types
Installation
Prerequisites
- Node.js 18 or higher
- npm or yarn
- Notion API key (get one at notion.so/my-integrations)
Quick Start
- Clone the repository:
git clone https://github.com/yourusername/notion-mcp-server.git
cd notion-mcp-server
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env
# Edit .env and add your Notion API key
- Build the project:
npm run build
- Test the server:
npm test
Configuration
Environment Variables
Create a .env
file with the following:
# Required
NOTION_API_KEY=your_notion_integration_token
# Optional
NOTION_API_VERSION=2022-06-28
LOG_LEVEL=info
Claude Desktop Configuration
Add to your Claude Desktop config (%APPDATA%\Claude\claude_desktop_config.json
on Windows):
{
"mcpServers": {
"notion": {
"command": "node",
"args": ["path/to/notion-mcp-server/dist/index.js"],
"env": {
"NOTION_API_KEY": "your_notion_integration_token"
}
}
}
}
Available Tools
Page Operations
notion_create_page
- Create a new Notion pagenotion_get_page
- Retrieve page content and propertiesnotion_update_page
- Update page properties or contentnotion_delete_page
- Delete a page (move to trash)
Database Operations
notion_query_database
- Query a database with filters and sortsnotion_create_database_item
- Add new item to a databasenotion_update_database_item
- Update database item properties
Block Operations
notion_append_blocks
- Add blocks to a pagenotion_get_blocks
- Get child blocks of a page or blocknotion_update_block
- Update existing block content
Search
notion_search
- Search pages and databases in workspace
Usage Examples
Create a Page
Use notion_create_page to create a new page titled "Meeting Notes" in the workspace
Query Database
Use notion_query_database to find all tasks with status "In Progress" from database [database_id]
Search Workspace
Use notion_search to find all pages containing "quarterly report"
Development
Project Structure
notion-mcp-server/
āāā src/
ā āāā index.ts # Main MCP server
ā āāā notion-client.ts # Notion API client wrapper
ā āāā tools/ # Individual tool implementations
ā ā āāā pages.ts
ā ā āāā databases.ts
ā ā āāā blocks.ts
ā ā āāā search.ts
ā āāā types/ # TypeScript types
āāā test/ # Test files
āāā docs/ # Documentation
āāā examples/ # Usage examples
Running in Development
npm run dev
Code Style
This project uses ESLint and Prettier. Run before committing:
npm run lint
npm run format
Notion Setup
- Go to notion.so/my-integrations
- Click "New integration"
- Give it a name and select capabilities
- Copy the integration token
- Share your Notion pages/databases with the integration
Security
- Never commit your Notion API key
- Use environment variables for sensitive data
- Limit integration permissions to what's needed
- Regularly rotate API keys
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the file for details.
Acknowledgments
- Built for use with Claude and the Model Context Protocol
- Uses the official Notion API
Support
- š Report bugs
- š” Request features
- š