|
| 1 | +# notion MCP Server |
| 2 | + |
| 3 | +Official Notion MCP Server |
| 4 | + |
| 5 | +[What is an MCP Server?](https://www.anthropic.com/news/model-context-protocol) |
| 6 | + |
| 7 | +| <!-- --> | <!-- --> | |
| 8 | +|-----------|---------| |
| 9 | +| **Image Source** | Official Image | |
| 10 | +| **Author** | [makenotion](https://github.com/makenotion) | |
| 11 | +| **Repository** | https://github.com/makenotion/notion-mcp-server | |
| 12 | +| **Dockerfile** | https://github.com/makenotion/notion-mcp-server/blob/main/Dockerfile | |
| 13 | +| **Docker Image built by** | Docker Inc. | |
| 14 | +| **Licence** | MIT License | |
| 15 | + |
| 16 | +## Tools Summary |
| 17 | + |
| 18 | + 1. **`API-create-a-comment`**: Create comment |
| 19 | + 1. **`API-create-a-database`**: Create a database |
| 20 | + 1. **`API-delete-a-block`**: Delete a block |
| 21 | + 1. **`API-get-block-children`**: Retrieve block children |
| 22 | + 1. **`API-get-self`**: Retrieve your token's bot user |
| 23 | + 1. **`API-get-user`**: Retrieve a user |
| 24 | +Error Responses: |
| 25 | +400: 400 |
| 26 | + 1. **`API-get-users`**: List all users |
| 27 | +Error Responses: |
| 28 | +400: 400 |
| 29 | + 1. **`API-patch-block-children`**: Append block children |
| 30 | + 1. **`API-patch-page`**: Update page properties |
| 31 | + 1. **`API-post-database-query`**: Query a database |
| 32 | + 1. **`API-post-page`**: Create a page |
| 33 | + 1. **`API-post-search`**: Search by title |
| 34 | + 1. **`API-retrieve-a-block`**: Retrieve a block |
| 35 | + 1. **`API-retrieve-a-comment`**: Retrieve comments |
| 36 | + 1. **`API-retrieve-a-database`**: Retrieve a database |
| 37 | + 1. **`API-retrieve-a-page`**: Retrieve a page |
| 38 | + 1. **`API-retrieve-a-page-property`**: Retrieve a page property item |
| 39 | + 1. **`API-update-a-block`**: Update a block |
| 40 | + 1. **`API-update-a-database`**: Update a database |
| 41 | + |
| 42 | +## Tools |
| 43 | + |
| 44 | +### Tool: **`API-create-a-comment`** |
| 45 | + |
| 46 | +Create comment |
| 47 | + |
| 48 | +| Parameter | Type | Description | |
| 49 | +| - | - | - | |
| 50 | +| `parent` | `object` | The page that contains the comment | |
| 51 | +| `rich_text` | `array` | | |
| 52 | + |
| 53 | +### Tool: **`API-create-a-database`** |
| 54 | + |
| 55 | +Create a database |
| 56 | + |
| 57 | +| Parameter | Type | Description | |
| 58 | +| - | - | - | |
| 59 | +| `parent` | `object` | | |
| 60 | +| `properties` | `object` | Property schema of database. The keys are the names of properties as they appear in Notion and the values are [property schema objects](https://developers.notion.com/reference/property-schema-object). | |
| 61 | +| `title` | `array` *optional* | | |
| 62 | + |
| 63 | +### Tool: **`API-delete-a-block`** |
| 64 | + |
| 65 | +Delete a block |
| 66 | + |
| 67 | +| Parameter | Type | Description | |
| 68 | +| - | - | - | |
| 69 | +| `block_id` | `string` | Identifier for a Notion block | |
| 70 | + |
| 71 | +### Tool: **`API-get-block-children`** |
| 72 | + |
| 73 | +Retrieve block children |
| 74 | + |
| 75 | +| Parameter | Type | Description | |
| 76 | +| - | - | - | |
| 77 | +| `block_id` | `string` | Identifier for a [block](ref:block) | |
| 78 | +| `page_size` | `integer` *optional* | The number of items from the full list desired in the response. Maximum: 100 | |
| 79 | +| `start_cursor` | `string` *optional* | If supplied, this endpoint will return a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results. | |
| 80 | + |
| 81 | +### Tool: **`API-get-self`** |
| 82 | + |
| 83 | +Retrieve your token's bot user |
| 84 | + |
| 85 | +### Tool: **`API-get-user`** |
| 86 | + |
| 87 | +Retrieve a user |
| 88 | +Error Responses: |
| 89 | +400: 400 |
| 90 | + |
| 91 | +| Parameter | Type | Description | |
| 92 | +| - | - | - | |
| 93 | +| `user_id` | `string` | | |
| 94 | + |
| 95 | +### Tool: **`API-get-users`** |
| 96 | + |
| 97 | +List all users |
| 98 | +Error Responses: |
| 99 | +400: 400 |
| 100 | + |
| 101 | +| Parameter | Type | Description | |
| 102 | +| - | - | - | |
| 103 | +| `page_size` | `integer` *optional* | The number of items from the full list desired in the response. Maximum: 100 | |
| 104 | +| `start_cursor` | `string` *optional* | If supplied, this endpoint will return a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results. | |
| 105 | + |
| 106 | +### Tool: **`API-patch-block-children`** |
| 107 | + |
| 108 | +Append block children |
| 109 | + |
| 110 | +| Parameter | Type | Description | |
| 111 | +| - | - | - | |
| 112 | +| `block_id` | `string` | Identifier for a [block](ref:block). Also accepts a [page](ref:page) ID. | |
| 113 | +| `children` | `array` | Child content to append to a container block as an array of [block objects](ref:block) | |
| 114 | +| `after` | `string` *optional* | The ID of the existing block that the new block should be appended after. | |
| 115 | + |
| 116 | +### Tool: **`API-patch-page`** |
| 117 | + |
| 118 | +Update page properties |
| 119 | + |
| 120 | +| Parameter | Type | Description | |
| 121 | +| - | - | - | |
| 122 | +| `page_id` | `string` | The identifier for the Notion page to be updated. | |
| 123 | +| `archived` | `boolean` *optional* | | |
| 124 | +| `cover` | `object` *optional* | A cover image for the page. Only [external file objects](https://developers.notion.com/reference/file-object) are supported. | |
| 125 | +| `icon` | `object` *optional* | A page icon for the page. Supported types are [external file object](https://developers.notion.com/reference/file-object) or [emoji object](https://developers.notion.com/reference/emoji-object). | |
| 126 | +| `in_trash` | `boolean` *optional* | Set to true to delete a block. Set to false to restore a block. | |
| 127 | +| `properties` | `object` *optional* | The property values to update for the page. The keys are the names or IDs of the property and the values are property values. If a page property ID is not included, then it is not changed. | |
| 128 | + |
| 129 | +### Tool: **`API-post-database-query`** |
| 130 | + |
| 131 | +Query a database |
| 132 | + |
| 133 | +| Parameter | Type | Description | |
| 134 | +| - | - | - | |
| 135 | +| `database_id` | `string` | Identifier for a Notion database. | |
| 136 | +| `archived` | `boolean` *optional* | | |
| 137 | +| `filter` | `object` *optional* | When supplied, limits which pages are returned based on the [filter conditions](ref:post-database-query-filter). | |
| 138 | +| `filter_properties` | `array` *optional* | A list of page property value IDs associated with the database. Use this param to limit the response to a specific page property value or values for pages that meet the `filter` criteria. | |
| 139 | +| `in_trash` | `boolean` *optional* | | |
| 140 | +| `page_size` | `integer` *optional* | The number of items from the full list desired in the response. Maximum: 100 | |
| 141 | +| `sorts` | `array` *optional* | When supplied, orders the results based on the provided [sort criteria](ref:post-database-query-sort). | |
| 142 | +| `start_cursor` | `string` *optional* | When supplied, returns a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results. | |
| 143 | + |
| 144 | +### Tool: **`API-post-page`** |
| 145 | + |
| 146 | +Create a page |
| 147 | + |
| 148 | +| Parameter | Type | Description | |
| 149 | +| - | - | - | |
| 150 | +| `parent` | `object` | | |
| 151 | +| `properties` | `object` | | |
| 152 | +| `children` | `array` *optional* | The content to be rendered on the new page, represented as an array of [block objects](https://developers.notion.com/reference/block). | |
| 153 | +| `cover` | `string` *optional* | The cover image of the new page, represented as a [file object](https://developers.notion.com/reference/file-object). | |
| 154 | +| `icon` | `string` *optional* | The icon of the new page. Either an [emoji object](https://developers.notion.com/reference/emoji-object) or an [external file object](https://developers.notion.com/reference/file-object).. | |
| 155 | + |
| 156 | +### Tool: **`API-post-search`** |
| 157 | + |
| 158 | +Search by title |
| 159 | + |
| 160 | +| Parameter | Type | Description | |
| 161 | +| - | - | - | |
| 162 | +| `filter` | `object` *optional* | A set of criteria, `value` and `property` keys, that limits the results to either only pages or only databases. Possible `value` values are `"page"` or `"database"`. The only supported `property` value is `"object"`. | |
| 163 | +| `page_size` | `integer` *optional* | The number of items from the full list to include in the response. Maximum: `100`. | |
| 164 | +| `query` | `string` *optional* | The text that the API compares page and database titles against. | |
| 165 | +| `sort` | `object` *optional* | A set of criteria, `direction` and `timestamp` keys, that orders the results. The **only** supported timestamp value is `"last_edited_time"`. Supported `direction` values are `"ascending"` and `"descending"`. If `sort` is not provided, then the most recently edited results are returned first. | |
| 166 | +| `start_cursor` | `string` *optional* | A `cursor` value returned in a previous response that If supplied, limits the response to results starting after the `cursor`. If not supplied, then the first page of results is returned. Refer to [pagination](https://developers.notion.com/reference/intro#pagination) for more details. | |
| 167 | + |
| 168 | +### Tool: **`API-retrieve-a-block`** |
| 169 | + |
| 170 | +Retrieve a block |
| 171 | + |
| 172 | +| Parameter | Type | Description | |
| 173 | +| - | - | - | |
| 174 | +| `block_id` | `string` | Identifier for a Notion block | |
| 175 | + |
| 176 | +### Tool: **`API-retrieve-a-comment`** |
| 177 | + |
| 178 | +Retrieve comments |
| 179 | + |
| 180 | +| Parameter | Type | Description | |
| 181 | +| - | - | - | |
| 182 | +| `block_id` | `string` | Identifier for a Notion block or page | |
| 183 | +| `page_size` | `integer` *optional* | The number of items from the full list desired in the response. Maximum: 100 | |
| 184 | +| `start_cursor` | `string` *optional* | If supplied, this endpoint will return a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results. | |
| 185 | + |
| 186 | +### Tool: **`API-retrieve-a-database`** |
| 187 | + |
| 188 | +Retrieve a database |
| 189 | + |
| 190 | +| Parameter | Type | Description | |
| 191 | +| - | - | - | |
| 192 | +| `database_id` | `string` | An identifier for the Notion database. | |
| 193 | + |
| 194 | +### Tool: **`API-retrieve-a-page`** |
| 195 | + |
| 196 | +Retrieve a page |
| 197 | + |
| 198 | +| Parameter | Type | Description | |
| 199 | +| - | - | - | |
| 200 | +| `page_id` | `string` | Identifier for a Notion page | |
| 201 | +| `filter_properties` | `string` *optional* | A list of page property value IDs associated with the page. Use this param to limit the response to a specific page property value or values. To retrieve multiple properties, specify each page property ID. For example: `?filter_properties=iAk8&filter_properties=b7dh`. | |
| 202 | + |
| 203 | +### Tool: **`API-retrieve-a-page-property`** |
| 204 | + |
| 205 | +Retrieve a page property item |
| 206 | + |
| 207 | +| Parameter | Type | Description | |
| 208 | +| - | - | - | |
| 209 | +| `page_id` | `string` | Identifier for a Notion page | |
| 210 | +| `property_id` | `string` | Identifier for a page [property](https://developers.notion.com/reference/page#all-property-values) | |
| 211 | +| `page_size` | `integer` *optional* | For paginated properties. The max number of property item objects on a page. The default size is 100 | |
| 212 | +| `start_cursor` | `string` *optional* | For paginated properties. | |
| 213 | + |
| 214 | +### Tool: **`API-update-a-block`** |
| 215 | + |
| 216 | +Update a block |
| 217 | + |
| 218 | +| Parameter | Type | Description | |
| 219 | +| - | - | - | |
| 220 | +| `block_id` | `string` | Identifier for a Notion block | |
| 221 | +| `archived` | `boolean` *optional* | Set to true to archive (delete) a block. Set to false to un-archive (restore) a block. | |
| 222 | +| `type` | `object` *optional* | The [block object `type`](ref:block#block-object-keys) value with the properties to be updated. Currently only `text` (for supported block types) and `checked` (for `to_do` blocks) fields can be updated. | |
| 223 | + |
| 224 | +### Tool: **`API-update-a-database`** |
| 225 | + |
| 226 | +Update a database |
| 227 | + |
| 228 | +| Parameter | Type | Description | |
| 229 | +| - | - | - | |
| 230 | +| `database_id` | `string` | identifier for a Notion database | |
| 231 | +| `description` | `array` *optional* | An array of [rich text objects](https://developers.notion.com/reference/rich-text) that represents the description of the database that is displayed in the Notion UI. If omitted, then the database description remains unchanged. | |
| 232 | +| `properties` | `object` *optional* | Property schema of database. The keys are the names of properties as they appear in Notion and the values are [property schema objects](https://developers.notion.com/reference/property-schema-object). | |
| 233 | +| `title` | `array` *optional* | An array of [rich text objects](https://developers.notion.com/reference/rich-text) that represents the title of the database that is displayed in the Notion UI. If omitted, then the database title remains unchanged. | |
| 234 | + |
| 235 | +## Use this MCP Server |
| 236 | + |
| 237 | +```json |
| 238 | +{ |
| 239 | + "mcpServers": { |
| 240 | + "notion": { |
| 241 | + "command": "docker", |
| 242 | + "args": [ |
| 243 | + "run", |
| 244 | + "-i", |
| 245 | + "--rm", |
| 246 | + "-e", |
| 247 | + "OPENAPI_MCP_HEADERS", |
| 248 | + "mcp/notion" |
| 249 | + ], |
| 250 | + "env": { |
| 251 | + "OPENAPI_MCP_HEADERS": "{"Authorization": "Bearer ntn_****", "Notion-Version": "2022-06-28" }" |
| 252 | + } |
| 253 | + } |
| 254 | + } |
| 255 | +} |
| 256 | +``` |
| 257 | + |
| 258 | +[Why is it safer to run MCP Servers with Docker?](https://www.docker.com/blog/the-model-context-protocol-simplifying-building-ai-apps-with-anthropic-claude-desktop-and-docker/) |
| 259 | + |
| 260 | +## Rebuild this image |
| 261 | + |
| 262 | +```console |
| 263 | +docker build -t mcp/notion -f Dockerfile https://github.com/makenotion/notion-mcp-server.git |
| 264 | +``` |
| 265 | + |
0 commit comments