mcp server notion
A Model Context Protocol (MCP) server that exposes the official Notion SDK, allowing AI models to interact with Notion workspaces.
A Model Context Protocol (MCP) server that exposes the official Notion SDK, allowing AI models to interact with Notion workspaces.
A Model Context Protocol (MCP) server that exposes the official Notion SDK, allowing AI models to interact with Notion workspaces.
For your integration to access Notion content, you need to explicitly share your pages or databases with it:
Note: An integration only has access to pages and databases that have been explicitly shared with it. Child pages automatically inherit access from parent pages.
You can add this MCP server to Claude Desktop, Cursor AI, or Claude.ai using either of these configuration formats:
npx @ramidecodes/mcp-server-notion@latest -y --api-key=your-notion-integration-key
{
"mcpServers": {
"Notion": {
"command": "npx",
"args": [
"@ramidecodes/mcp-server-notion@latest",
"-y",
"--api-key=your-notion-integration-key"
]
}
}
}
Replace your-notion-integration-key
with the API key from step 1.
The server provides tools for interacting with Notion:
Instead of passing the API key directly, you can use a .env
file:
.env
file with:NOTION_API_KEY=your-notion-integration-key
npx @ramidecodes/mcp-server-notion@latest -y
You can also use environment variables in the JSON configuration format:
{
"mcpServers": {
"Notion": {
"command": "npx",
"args": [
"@ramidecodes/mcp-server-notion@latest",
"-y",
"--api-key=your-notion-integration-key"
]
}
}
}
OPTIONS:
-h, --help Show help message
-v, --version Show version information
--verbose Enable verbose logging
--env-path <path> Path to .env file
--api-key <key> Notion API key
-y Skip confirmation prompts
If you encounter "Failed to create client" errors:
cmd /c
before the npx commandFor detailed documentation on each tool, see the Tools Documentation.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
[
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"filter_object_type": {
"description": "Filter by object type",
"enum": [
"page",
"database"
],
"type": "string"
},
"page_size": {
"description": "Number of results to return (max 100)",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"query": {
"description": "The search query string",
"type": "string"
}
},
"type": "object"
},
"name": "search"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"database_id": {
"description": "The ID of the database to query",
"type": "string"
},
"filter": {
"description": "JSON string of filter criteria",
"type": "string"
},
"page_size": {
"description": "Number of results to return (max 100)",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"sorts": {
"description": "JSON string of sort criteria",
"type": "string"
},
"start_cursor": {
"description": "Pagination cursor",
"type": "string"
}
},
"required": [
"database_id"
],
"type": "object"
},
"name": "query-database"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"database_id": {
"description": "The ID of the database to retrieve",
"type": "string"
}
},
"required": [
"database_id"
],
"type": "object"
},
"name": "get-database"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"children": {
"description": "JSON string of page content blocks",
"type": "string"
},
"parent_id": {
"description": "ID of the parent database or page",
"type": "string"
},
"parent_type": {
"description": "Type of parent (database or page)",
"enum": [
"database_id",
"page_id"
],
"type": "string"
},
"properties": {
"description": "JSON string of page properties",
"type": "string"
}
},
"required": [
"parent_type",
"parent_id",
"properties"
],
"type": "object"
},
"name": "create-page"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"page_id": {
"description": "The ID of the page to retrieve",
"type": "string"
}
},
"required": [
"page_id"
],
"type": "object"
},
"name": "get-page"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"archived": {
"description": "Whether to archive the page",
"type": "boolean"
},
"page_id": {
"description": "The ID of the page to update",
"type": "string"
},
"properties": {
"description": "JSON string of page properties to update",
"type": "string"
}
},
"required": [
"page_id",
"properties"
],
"type": "object"
},
"name": "update-page"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"block_id": {
"description": "The ID of the block to append to",
"type": "string"
},
"children": {
"description": "JSON string of blocks to append",
"type": "string"
}
},
"required": [
"block_id",
"children"
],
"type": "object"
},
"name": "append-blocks"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"block_id": {
"description": "The ID of the block to retrieve",
"type": "string"
}
},
"required": [
"block_id"
],
"type": "object"
},
"name": "get-block"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"block_id": {
"description": "The ID of the block to get children from",
"type": "string"
},
"page_size": {
"description": "Number of results to return (max 100)",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"start_cursor": {
"description": "Pagination cursor",
"type": "string"
}
},
"required": [
"block_id"
],
"type": "object"
},
"name": "get-block-children"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"block_id": {
"description": "The ID of the block to update",
"type": "string"
},
"properties": {
"description": "JSON string of block properties to update",
"type": "string"
}
},
"required": [
"block_id",
"properties"
],
"type": "object"
},
"name": "update-block"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"block_id": {
"description": "The ID of the block to delete",
"type": "string"
}
},
"required": [
"block_id"
],
"type": "object"
},
"name": "delete-block"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
},
"name": "list-users"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"user_id": {
"description": "The ID of the user to retrieve",
"type": "string"
}
},
"required": [
"user_id"
],
"type": "object"
},
"name": "get-user"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
},
"name": "get-me"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"discussion_id": {
"description": "Optional discussion ID for threaded comments",
"type": "string"
},
"page_id": {
"description": "The ID of the page to comment on",
"type": "string"
},
"text": {
"description": "The comment text content",
"type": "string"
}
},
"required": [
"page_id",
"text"
],
"type": "object"
},
"name": "create-comment"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"block_id": {
"description": "The ID of the block to get comments from",
"type": "string"
},
"page_id": {
"description": "The ID of the page to get comments from",
"type": "string"
},
"page_size": {
"description": "Number of results to return (max 100)",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"start_cursor": {
"description": "Pagination cursor",
"type": "string"
}
},
"type": "object"
},
"name": "list-comments"
},
{
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"page_id": {
"description": "The ID of the page to add the preview to",
"type": "string"
},
"url": {
"description": "The URL to create a preview for",
"format": "uri",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"name": "create-link-preview"
}
]