suekou/mcp-notion-server
Built by Metorial, the integration platform for agentic AI.
suekou/mcp-notion-server
Server Summary
Retrieve content from Notion
Update Notion pages
Create new Notion entries
Delete Notion content
Convert data to Markdown format
MCP Server for the Notion API, enabling LLM to interact with Notion workspaces. Additionally, it employs Markdown conversion to reduce context size when communicating with LLMs, optimizing token usage and making interactions more efficient.
Here is a detailed explanation of the steps mentioned above in the following articles:
Create a Notion Integration:
Retrieve the Secret Key:
Add the Integration to Your Workspace:
Configure Claude Desktop:
Add the following to your claude_desktop_config.json
:
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["-y", "@suekou/mcp-notion-server"],
"env": {
"NOTION_API_TOKEN": "your-integration-token"
}
}
}
}
or
{
"mcpServers": {
"notion": {
"command": "node",
"args": ["your-built-file-path"],
"env": {
"NOTION_API_TOKEN": "your-integration-token"
}
}
}
}
NOTION_API_TOKEN
(required): Your Notion API integration token.NOTION_MARKDOWN_CONVERSION
: Set to "true" to enable experimental Markdown conversion. This can significantly reduce token consumption when viewing content, but may cause issues when trying to edit page content.--enabledTools
: Comma-separated list of tools to enable (e.g. "notion_retrieve_page,notion_query_database"). When specified, only the listed tools will be available. If not specified, all tools are enabled.Read-only tools example (copy-paste friendly):
node build/index.js --enabledTools=notion_retrieve_block,notion_retrieve_block_children,notion_retrieve_page,notion_query_database,notion_retrieve_database,notion_search,notion_list_all_users,notion_retrieve_user,notion_retrieve_bot_user,notion_retrieve_comments
By default, all responses are returned in JSON format. You can enable experimental Markdown conversion to reduce token consumption:
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["-y", "@suekou/mcp-notion-server"],
"env": {
"NOTION_API_TOKEN": "your-integration-token",
"NOTION_MARKDOWN_CONVERSION": "true"
}
}
}
}
or
{
"mcpServers": {
"notion": {
"command": "node",
"args": ["your-built-file-path"],
"env": {
"NOTION_API_TOKEN": "your-integration-token",
"NOTION_MARKDOWN_CONVERSION": "true"
}
}
}
}
When NOTION_MARKDOWN_CONVERSION
is set to "true"
, responses will be converted to Markdown format (when format
parameter is set to "markdown"
), making them more human-readable and significantly reducing token consumption. However, since this feature is experimental, it may cause issues when trying to edit page content as the original structure is lost in conversion.
You can control the format on a per-request basis by setting the format
parameter to either "json"
or "markdown"
in your tool calls:
"markdown"
for better readability when only viewing content"json"
when you need to modify the returned contentIf you encounter permission errors:
claude_desktop_config.json
.The project is organized in a modular way to improve maintainability and readability:
./
├── src/
│ ├── index.ts # Entry point and command-line handling
│ ├── client/
│ │ └── index.ts # NotionClientWrapper class for API interactions
│ ├── server/
│ │ └── index.ts # MCP server setup and request handling
│ ├── types/
│ │ ├── index.ts # Type exports
│ │ ├── args.ts # Tool argument interfaces
│ │ ├── common.ts # Common schema definitions
│ │ ├── responses.ts # API response type definitions
│ │ └── schemas.ts # Tool schema definitions
│ ├── utils/
│ │ └── index.ts # Utility functions
│ └── markdown/
│ └── index.ts # Markdown conversion utilities
All tools support the following optional parameter:
format
(string, "json" or "markdown", default: "markdown"): Controls the response format. Use "markdown" for human-readable output, "json" for programmatic access to the original data structure. Note: Markdown conversion only works when the NOTION_MARKDOWN_CONVERSION
environment variable is set to "true".notion_append_block_children
block_id
(string): The ID of the parent block.children
(array): Array of block objects to append.notion_retrieve_block
block_id
(string): The ID of the block to retrieve.notion_retrieve_block_children
block_id
(string): The ID of the parent block.start_cursor
(string): Cursor for the next page of results.page_size
(number, default: 100, max: 100): Number of blocks to retrieve.notion_delete_block
block_id
(string): The ID of the block to delete.notion_retrieve_page
page_id
(string): The ID of the page to retrieve.notion_update_page_properties
page_id
(string): The ID of the page to update.properties
(object): Properties to update.notion_create_database
parent
(object): Parent object of the database.properties
(object): Property schema of the database.title
(array): Title of the database as a rich text array.notion_query_database
database_id
(string): The ID of the database to query.filter
(object): Filter conditions.sorts
(array): Sorting conditions.start_cursor
(string): Cursor for the next page of results.page_size
(number, default: 100, max: 100): Number of results to retrieve.notion_retrieve_database
database_id
(string): The ID of the database to retrieve.notion_update_database
database_id
(string): The ID of the database to update.title
(array): New title for the database.description
(array): New description for the database.properties
(object): Updated property schema.notion_create_database_item
database_id
(string): The ID of the database to add the item to.properties
(object): The properties of the new item. These should match the database schema.notion_search
query
(string): Text to search for in page or database titles.filter
(object): Criteria to limit results to either only pages or only databases.sort
(object): Criteria to sort the resultsstart_cursor
(string): Pagination start cursor.page_size
(number, default: 100, max: 100): Number of results to retrieve.notion_list_all_users
notion_retrieve_user
notion_retrieve_bot_user
notion_create_comment
parent
object with a page_id
or a discussion_id
, but not both.rich_text
(array): Array of rich text objects representing the comment content.parent
(object): Must include page_id
if used.discussion_id
(string): An existing discussion thread ID.notion_retrieve_comments
block_id
(string): The ID of the block or page whose comments you want to retrieve.start_cursor
(string): Pagination start cursor.page_size
(number, max: 100): Number of comments to retrieve.This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.