@notionhq/notion-mcp-server 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  This project implements an [MCP server](https://spec.modelcontextprotocol.io/) for the [Notion API](https://developers.notion.com/reference/intro).
6
6
 
7
- ### Installation
7
+ ![mcp-demo](https://github.com/user-attachments/assets/1f82cd82-87e4-4d7c-8b72-486ef1f18663)
8
8
 
9
- Add the following to your `.cursor/mcp.json` or `claude_desktop_config.json` (MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json`)
9
+ ### Installation
10
10
 
11
- Don't forget to add your Bearer token.
11
+ Add the following to your `.cursor/mcp.json` or `claude_desktop_config.json` (MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`)
12
12
 
13
13
  ```javascript
14
14
  {
@@ -24,14 +24,19 @@ Don't forget to add your Bearer token.
24
24
  }
25
25
  ```
26
26
 
27
+ Don't forget to replace `ntn_****` with your integration secret. Find it from your integration configuration tab:
28
+ <img width="918" alt="retrieve-token" src="https://github.com/user-attachments/assets/67b44536-5333-49fa-809c-59581bf5370a" />
29
+
30
+ Ensure relevant pages and databases are connected to your integration.
31
+
27
32
  ### Examples
28
33
 
29
- 1. Using the following command
34
+ 1. Using the following instruction
30
35
  ```
31
36
  Comment "Hello MCP" on page "Getting started"
32
37
  ```
33
38
 
34
- AI will correctly plan two API calls, v1/search and v1/comments, to achieve the task
39
+ AI will correctly plan two API calls, `v1/search` and `v1/comments`, to achieve the task
35
40
 
36
41
  2. Similarly, the following instruction will result in a new page named "Notion MCP" added to parent page "Development"
37
42
  ```
@@ -56,3 +61,9 @@ Execute
56
61
  ```
57
62
  npx -y --prefix /path/to/local/notion-mcp-server @notionhq/notion-mcp-server
58
63
  ```
64
+
65
+ Publish
66
+
67
+ ```
68
+ npm publish --access public
69
+ ```
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "mcp",
7
7
  "server"
8
8
  ],
9
- "version": "1.1.0",
9
+ "version": "1.3.0",
10
10
  "license": "MIT",
11
11
  "type": "module",
12
12
  "scripts": {
@@ -20,39 +20,8 @@
20
20
  "scheme": "basic"
21
21
  }
22
22
  },
23
- "parameters": {
24
- "notionVersion": {
25
- "name": "Notion-Version",
26
- "in": "header",
27
- "required": true,
28
- "schema": {
29
- "enum": ["2022-06-28"]
30
- },
31
- "description": "The [API version](https://developers.notion.com/reference/versioning) to use for this request. The latest version is `2022-06-28`."
32
- }
33
- },
34
- "schemas": {
35
- "pageIdObject": {
36
- "type": "object",
37
- "properties": {
38
- "page_id": {
39
- "type": "string"
40
- }
41
- },
42
- "additionalProperties": false,
43
- "required": ["page_id"]
44
- },
45
- "databaseIdObject": {
46
- "type": "object",
47
- "properties": {
48
- "database_id": {
49
- "type": "string"
50
- }
51
- },
52
- "additionalProperties": false,
53
- "required": ["database_id"]
54
- }
55
- }
23
+ "parameters": {},
24
+ "schemas": {}
56
25
  },
57
26
  "security": [
58
27
  {
@@ -583,15 +552,6 @@
583
552
  "type": "string"
584
553
  },
585
554
  "required": true
586
- },
587
- {
588
- "name": "Notion-Version",
589
- "in": "header",
590
- "description": "The [API version](/reference/versioning) to use for this request. The latest version is `<<latestNotionVersion>>`.",
591
- "required": true,
592
- "schema": {
593
- "type": "string"
594
- }
595
555
  }
596
556
  ],
597
557
  "requestBody": {
@@ -647,7 +607,14 @@
647
607
  ],
648
608
  "properties": {
649
609
  "parent": {
650
- "$ref": "#/components/schemas/pageIdObject"
610
+ "type": "object",
611
+ "properties": {
612
+ "page_id": {
613
+ "type": "string",
614
+ "format": "uuid"
615
+ }
616
+ },
617
+ "required": ["page_id"]
651
618
  },
652
619
  "properties": {
653
620
  "type": "object",
@@ -717,24 +684,79 @@
717
684
  "application/json": {
718
685
  "schema": {
719
686
  "type": "object",
720
- "required": [
721
- "parent",
722
- "properties"
723
- ],
687
+ "required": ["parent","properties"],
724
688
  "properties": {
725
689
  "parent": {
726
- "type": "string",
727
- "description": "A [page parent](/reference/database#page-parent)",
728
- "format": "json"
729
- },
730
- "title": {
731
- "type": "array",
732
- "description": "Title of database as it appears in Notion. An array of [rich text objects](ref:rich-text)."
690
+ "type": "object",
691
+ "properties": {
692
+ "type": {
693
+ "enum": ["page_id"]
694
+ },
695
+ "page_id": {
696
+ "type": "string",
697
+ "format": "uuid"
698
+ }
699
+ },
700
+ "required": ["type", "page_id"]
733
701
  },
734
702
  "properties": {
735
- "type": "string",
703
+ "type": "object",
736
704
  "description": "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).",
737
- "format": "json"
705
+ "additionalProperties": {
706
+ "oneOf": [
707
+ {
708
+ "type": "object",
709
+ "properties": {
710
+ "title": {
711
+ "type": "object",
712
+ "properties": {},
713
+ "additionalProperties": false
714
+ },
715
+ "description": {
716
+ "type": "string",
717
+ "maxLength": 280,
718
+ "minLength": 1
719
+ }
720
+ },
721
+ "additionalProperties": false,
722
+ "required": ["title"]
723
+ }
724
+ ]
725
+ }
726
+ },
727
+ "title": {
728
+ "type": "array",
729
+ "items": {
730
+ "type": "object",
731
+ "required": ["text"],
732
+ "properties": {
733
+ "text": {
734
+ "type": "object",
735
+ "properties": {
736
+ "content": {
737
+ "type": "string",
738
+ "maxLength": 2000
739
+ },
740
+ "link": {
741
+ "type": ["object", "null"],
742
+ "properties": {
743
+ "url": {
744
+ "type": "string"
745
+ }
746
+ },
747
+ "required": ["url"]
748
+ }
749
+ },
750
+ "additionalProperties": false,
751
+ "required": ["content"]
752
+ },
753
+ "type": {
754
+ "enum": ["text"]
755
+ }
756
+ },
757
+ "additionalProperties": false
758
+ },
759
+ "maxItems": 100
738
760
  }
739
761
  }
740
762
  }
@@ -773,15 +795,6 @@
773
795
  "type": "string"
774
796
  },
775
797
  "required": true
776
- },
777
- {
778
- "name": "Notion-Version",
779
- "in": "header",
780
- "description": "The [API version](/reference/versioning) to use for this request. The latest version is `<<latestNotionVersion>>`.",
781
- "required": true,
782
- "schema": {
783
- "type": "string"
784
- }
785
798
  }
786
799
  ],
787
800
  "requestBody": {
@@ -791,19 +804,85 @@
791
804
  "type": "object",
792
805
  "properties": {
793
806
  "title": {
807
+ "description": "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.",
794
808
  "type": "array",
795
- "description": "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."
809
+ "items": {
810
+ "type": "object",
811
+ "required": ["text"],
812
+ "properties": {
813
+ "text": {
814
+ "type": "object",
815
+ "properties": {
816
+ "content": {
817
+ "type": "string",
818
+ "maxLength": 2000
819
+ },
820
+ "link": {
821
+ "type": ["object", "null"],
822
+ "properties": {
823
+ "url": {
824
+ "type": "string"
825
+ }
826
+ },
827
+ "required": ["url"]
828
+ }
829
+ },
830
+ "additionalProperties": false,
831
+ "required": ["content"]
832
+ },
833
+ "type": {
834
+ "enum": ["text"]
835
+ }
836
+ },
837
+ "additionalProperties": false
838
+ }
796
839
  },
797
840
  "description": {
798
841
  "type": "array",
842
+ "items": {
843
+ "type": "object",
844
+ "required": ["text"],
845
+ "properties": {
846
+ "text": {
847
+ "type": "object",
848
+ "properties": {
849
+ "content": {
850
+ "type": "string",
851
+ "maxLength": 2000
852
+ },
853
+ "link": {
854
+ "type": ["object", "null"],
855
+ "properties": {
856
+ "url": {
857
+ "type": "string"
858
+ }
859
+ },
860
+ "required": ["url"]
861
+ }
862
+ },
863
+ "additionalProperties": false,
864
+ "required": ["content"]
865
+ },
866
+ "type": {
867
+ "enum": ["text"]
868
+ }
869
+ },
870
+ "additionalProperties": false
871
+ },
872
+ "maxItems": 100,
799
873
  "description": "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."
800
874
  },
801
875
  "properties": {
802
- "type": "string",
803
- "description": "The properties of a database to be changed in the request, in the form of a JSON object. If updating an existing property, then the keys are the names or IDs of the properties as they appear in Notion, and the values are [property schema objects](ref:property-schema-object). If adding a new property, then the key is the name of the new database property and the value is a [property schema object](ref:property-schema-object).",
804
- "format": "json"
876
+ "type": "object",
877
+ "description": "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).",
878
+ "properties": {
879
+ "name": {
880
+ "type": "string"
881
+ }
882
+ }
805
883
  }
806
- }
884
+ },
885
+ "additionalProperties": false
807
886
  }
808
887
  }
809
888
  }
package/tsconfig.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "strict": true,
23
23
  "skipLibCheck": true
24
24
  },
25
- "include": [ "test/**/*.ts", "scripts/**/*.ts", "src/**/*.ts", "examples/**/*"]
25
+ "include": [ "test/**/*.ts", "scripts/**/*.ts", "src/**/*.ts"]
26
26
  }