A Model Context Protocol (MCP) server that provides seamless integration with Notion. This server enables LLMs to interact with your Notion workspace through standardized tools for searching, reading, creating, and updating pages.
- 🔍 Search Pages: Search through your Notion workspace
- 📖 Read Pages: Retrieve content from any Notion page
- ✍️ Create Pages: Create new pages with titles and content
- 🔄 Update Pages: Append or modify content in existing pages
- Node.js (v16 or higher)
- A Notion account and API key
- MCP-compatible client (e.g., Claude Desktop)
- Clone the repository:
git clone https://github.com/v-3/notion-server.git
cd notion-server
- Install dependencies:
npm install
- Create a
.env
file in the root directory:
NOTION_API_KEY=your_notion_api_key_here
- Build the server:
npm run build
- Add the server to your Claude Desktop configuration (
claude_desktop_config.json
):
{
"mcpServers": {
"notion": {
"command": "node",
"args": ["/absolute/path/to/notion-server/build/index.js"],
"env": {
"NOTION_API_KEY": "your_notion_api_key_here"
}
}
}
}
-
Restart Claude Desktop
-
The following tools will be available:
search_pages
: Search for Notion pagesread_page
: Read content from a specific pagecreate_page
: Create a new pageupdate_page
: Update an existing page
Search through your Notion pages.
{
query: string // Search query
}
Read the content of a specific Notion page.
{
pageId: string // ID of the page to read
}
Create a new Notion page.
{
title: string, // Page title
content: string, // Page content in markdown format
parentPageId?: string // Optional parent page ID
}
Update an existing Notion page.
{
pageId: string, // ID of the page to update
content: string, // New content to append
type?: "paragraph" | "task" | "todo" | "heading" | "image" // Optional content type
}
- Go to Notion Integrations page
- Click "New integration" and give it a name
- Configure the following permissions based on your needs:
- Content Capabilities:
- Read content
- Update content
- Insert content
- Comment Capabilities (optional):
- Read comments
- Create comments
- User Information:
- Read user information
- Content Capabilities:
- After creating the integration, you'll see a "Secret Key"
- Copy this key and use it in:
- The server's
.env
file asNOTION_API_KEY
- Your Claude Desktop config file in the
env
section
- The server's
The integration needs explicit permission to access specific pages in your Notion workspace:
- Open the Notion page you want to grant access to
- Click the "..." menu in the top right
- Select "Connections"
- Find your integration in the list and click to add it
- Repeat for each page you want the integration to access
- Page permissions are hierarchical - granting access to a parent page automatically grants access to all child pages
- You can revoke access at any time by removing the integration from a page's connections
- For optimal security, grant access only to pages that require integration functionality
- Regularly audit page connections to maintain proper access control
- Store your Notion API key securely
- The server has read and write access to your Notion workspace
- Consider implementing additional access controls based on your needs
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.