@atikk-co-jp/notion-mcp-server 0.2.2 → 0.2.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"append-block-children.d.ts","sourceRoot":"","sources":["../../../src/tools/append-block-children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAoBvD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAiCzF"}
1
+ {"version":3,"file":"append-block-children.d.ts","sourceRoot":"","sources":["../../../src/tools/append-block-children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAWvD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAiCzF"}
@@ -1,16 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { BlockChildrenSchema } from '../schemas/block.js';
3
2
  import { formatResponse, handleError } from '../utils/index.js';
3
+ // Minimal schema for MCP (full validation by Notion API)
4
4
  const inputSchema = {
5
- block_id: z.string().describe('The ID of the block or page to append children to'),
6
- children: BlockChildrenSchema.describe('Array of block objects to append. ' +
7
- 'Supported types: paragraph, heading_1/2/3, bulleted_list_item, numbered_list_item, to_do, toggle, code, quote, callout, divider, bookmark, image, video, embed, table_of_contents. ' +
8
- 'Example: [{ "type": "paragraph", "paragraph": { "rich_text": [{ "text": { "content": "Hello" } }] } }]'),
9
- after: z
10
- .string()
11
- .optional()
12
- .describe('The ID of a block to insert the new children after. ' +
13
- 'If not provided, children are appended at the end.'),
5
+ block_id: z.string().describe('Block or page ID'),
6
+ children: z.array(z.any()).describe('Block objects to append'),
7
+ after: z.string().optional().describe('Insert after this block ID'),
14
8
  };
15
9
  export function registerAppendBlockChildren(server, notion) {
16
10
  server.registerTool('append-block-children', {
@@ -1 +1 @@
1
- {"version":3,"file":"create-comment.d.ts","sourceRoot":"","sources":["../../../src/tools/create-comment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAoBvD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAqCnF"}
1
+ {"version":3,"file":"create-comment.d.ts","sourceRoot":"","sources":["../../../src/tools/create-comment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAUvD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAqCnF"}
@@ -1,16 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { RichTextArraySchema } from '../schemas/common.js';
3
2
  import { formatResponse, handleError } from '../utils/index.js';
3
+ // Minimal schema for MCP (full validation by Notion API)
4
4
  const inputSchema = {
5
- page_id: z.string().describe('The ID of the page to add a comment to'),
6
- rich_text: RichTextArraySchema.describe('The comment content as rich text array. ' +
7
- 'Each item: { "type": "text", "text": { "content": "..." }, "annotations": { "bold": true, ... } }. ' +
8
- 'Example: [{ "type": "text", "text": { "content": "This is a comment" } }]'),
9
- discussion_id: z
10
- .string()
11
- .optional()
12
- .describe('Optional ID of an existing discussion to add the comment to. ' +
13
- 'If not provided, a new discussion is created.'),
5
+ page_id: z.string().describe('Page ID'),
6
+ rich_text: z.array(z.any()).describe('Comment content as rich text'),
7
+ discussion_id: z.string().optional().describe('Reply to existing discussion'),
14
8
  };
15
9
  export function registerCreateComment(server, notion) {
16
10
  server.registerTool('create-comment', {
@@ -1 +1 @@
1
- {"version":3,"file":"create-database.d.ts","sourceRoot":"","sources":["../../../src/tools/create-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA+CvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA+CpF"}
1
+ {"version":3,"file":"create-database.d.ts","sourceRoot":"","sources":["../../../src/tools/create-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAavD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAgDpF"}
@@ -1,27 +1,13 @@
1
1
  import { z } from 'zod';
2
- import { CoverSchema, IconSchema, RichTextArraySchema, } from '../schemas/common.js';
3
- import { DatabasePropertiesSchema } from '../schemas/database.js';
4
2
  import { formatResponse, handleError } from '../utils/index.js';
3
+ // Minimal schema for MCP (full validation by Notion API)
5
4
  const inputSchema = {
6
- parent_page_id: z
7
- .string()
8
- .describe('The ID of the parent page where the database will be created'),
9
- title: RichTextArraySchema.optional().describe('Optional title of the database as an array of rich text objects. ' +
10
- 'Example: [{ "type": "text", "text": { "content": "My Database" } }]'),
11
- properties: DatabasePropertiesSchema.describe('Database property schema object. Keys are property names, values define the property type and configuration. ' +
12
- 'Each database must have exactly one "title" property. ' +
13
- 'Supported types: title, rich_text, number, select, multi_select, date, people, files, checkbox, url, email, phone_number, formula, relation, rollup, created_time, created_by, last_edited_time, last_edited_by. ' +
14
- 'Example: { "Name": { "title": {} }, "Description": { "rich_text": {} }, "Price": { "number": { "format": "dollar" } }, "Tags": { "multi_select": { "options": [{ "name": "Tag1", "color": "blue" }] } } }'),
15
- icon: IconSchema.optional().describe('Optional icon for the database. ' +
16
- 'Emoji: { "type": "emoji", "emoji": "📊" }. ' +
17
- 'External: { "type": "external", "external": { "url": "https://..." } }'),
18
- cover: CoverSchema.optional().describe('Optional cover image for the database. ' +
19
- 'Example: { "type": "external", "external": { "url": "https://..." } }'),
20
- is_inline: z
21
- .boolean()
22
- .optional()
23
- .describe('Optional. If true, the database will appear as an inline database within the parent page. ' +
24
- 'If false or omitted, it will be a full page database.'),
5
+ parent_page_id: z.string().describe('Parent page ID'),
6
+ title: z.array(z.any()).optional().describe('Database title'),
7
+ properties: z.record(z.string(), z.any()).describe('Property schema (must include one title property)'),
8
+ icon: z.any().optional().describe('Database icon'),
9
+ cover: z.any().optional().describe('Cover image'),
10
+ is_inline: z.boolean().optional().describe('Inline database'),
25
11
  };
26
12
  export function registerCreateDatabase(server, notion) {
27
13
  server.registerTool('create-database', {
@@ -47,6 +33,7 @@ export function registerCreateDatabase(server, notion) {
47
33
  if (is_inline !== undefined) {
48
34
  params.is_inline = is_inline;
49
35
  }
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
37
  const response = await notion.databases.create(params);
51
38
  return formatResponse(response);
52
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-page.d.ts","sourceRoot":"","sources":["../../../src/tools/create-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAiCvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA0ChF"}
1
+ {"version":3,"file":"create-page.d.ts","sourceRoot":"","sources":["../../../src/tools/create-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAkBvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA0ChF"}
@@ -1,21 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { BlockChildrenSchema } from '../schemas/block.js';
3
- import { CoverSchema, IconSchema } from '../schemas/common.js';
4
- import { PropertiesSchema } from '../schemas/page.js';
5
2
  import { formatResponse, handleError } from '../utils/index.js';
3
+ // Minimal schema for MCP (full validation by Notion API)
6
4
  const inputSchema = {
7
- database_id: z.string().describe('The ID of the database where the page will be created'),
8
- properties: PropertiesSchema.describe('Page properties object. Keys are property names, values follow Notion property format. ' +
9
- 'Supported types: title, rich_text, number, select, multi_select, status, date, checkbox, url, email, phone_number, relation, people, files. ' +
10
- 'Example: { "Name": { "title": [{ "text": { "content": "My Page" } }] }, "Status": { "status": { "name": "In Progress" } } }'),
11
- children: BlockChildrenSchema.optional().describe('Optional array of block objects for the page content. ' +
12
- 'Supported types: paragraph, heading_1/2/3, bulleted_list_item, numbered_list_item, to_do, toggle, code, quote, callout, divider, bookmark, image, video, embed, table_of_contents. ' +
13
- 'Example: [{ "type": "paragraph", "paragraph": { "rich_text": [{ "text": { "content": "Hello" } }] } }]'),
14
- icon: IconSchema.optional().describe('Optional icon for the page. ' +
15
- 'Emoji: { "type": "emoji", "emoji": "🚀" }. ' +
16
- 'External: { "type": "external", "external": { "url": "https://..." } }'),
17
- cover: CoverSchema.optional().describe('Optional cover image for the page. ' +
18
- 'Example: { "type": "external", "external": { "url": "https://..." } }'),
5
+ database_id: z.string().describe('Database ID'),
6
+ properties: z.record(z.string(), z.any()).describe('Notion properties object'),
7
+ children: z.array(z.any()).optional().describe('Block objects array'),
8
+ icon: z.any().optional().describe('Page icon'),
9
+ cover: z.any().optional().describe('Cover image'),
19
10
  };
20
11
  export function registerCreatePage(server, notion) {
21
12
  server.registerTool('create-page', {
@@ -1 +1 @@
1
- {"version":3,"file":"query-database.d.ts","sourceRoot":"","sources":["../../../src/tools/query-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAwDvD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA+CnF"}
1
+ {"version":3,"file":"query-database.d.ts","sourceRoot":"","sources":["../../../src/tools/query-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA8BvD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAgDnF"}
@@ -1,31 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  import { pagesToSimple } from '../converters/index.js';
3
- import { FilterSchema, SortsSchema } from '../schemas/filter.js';
4
3
  import { formatPaginatedResponse, formatSimplePaginatedResponse, handleError, } from '../utils/index.js';
4
+ // Minimal schema for MCP (full validation by Notion API)
5
5
  const inputSchema = {
6
- database_id: z.string().describe('The ID of the database to query'),
7
- filter: FilterSchema.optional().describe('Filter conditions. ' +
8
- 'Property filter: { "property": "Status", "status": { "equals": "Done" } }. ' +
9
- 'Compound filter: { "and": [...] } or { "or": [...] }. ' +
10
- 'Supported property types: title, rich_text, number, checkbox, select, multi_select, status, date, relation.'),
11
- sorts: SortsSchema.optional().describe('Sort conditions array. ' +
12
- 'By property: { "property": "Name", "direction": "ascending" }. ' +
13
- 'By timestamp: { "timestamp": "created_time", "direction": "descending" }.'),
14
- start_cursor: z
15
- .string()
16
- .optional()
17
- .describe('Cursor for pagination. Use the next_cursor from previous response.'),
18
- page_size: z
19
- .number()
20
- .min(1)
21
- .max(100)
22
- .optional()
23
- .describe('Number of results to return (1-100). Default is 100.'),
24
- format: z
25
- .enum(['json', 'simple'])
26
- .optional()
27
- .default('simple')
28
- .describe("Output format: 'simple' (default) returns simplified property values with reduced token usage, 'json' returns raw Notion API response"),
6
+ database_id: z.string().describe('Database ID'),
7
+ filter: z.any().optional().describe('Filter conditions'),
8
+ sorts: z.array(z.any()).optional().describe('Sort conditions'),
9
+ start_cursor: z.string().optional().describe('Pagination cursor'),
10
+ page_size: z.number().optional().describe('Results per page (1-100)'),
11
+ format: z.enum(['json', 'simple']).optional().describe('Output format (default: simple)'),
29
12
  };
30
13
  export function registerQueryDatabase(server, notion) {
31
14
  server.registerTool('query-database', {
@@ -46,6 +29,7 @@ export function registerQueryDatabase(server, notion) {
46
29
  if (page_size) {
47
30
  params.page_size = page_size;
48
31
  }
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
33
  const response = await notion.databases.query(params);
50
34
  if (format === 'simple') {
51
35
  const simplePages = pagesToSimple(response.results);
@@ -1 +1 @@
1
- {"version":3,"file":"update-database.d.ts","sourceRoot":"","sources":["../../../src/tools/update-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA2DvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA2DpF"}
1
+ {"version":3,"file":"update-database.d.ts","sourceRoot":"","sources":["../../../src/tools/update-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAevD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA4DpF"}
@@ -1,37 +1,15 @@
1
1
  import { z } from 'zod';
2
- import { CoverSchema, IconSchema, RichTextArraySchema, } from '../schemas/common.js';
3
- import { DatabasePropertiesSchema } from '../schemas/database.js';
4
2
  import { formatResponse, handleError } from '../utils/index.js';
3
+ // Minimal schema for MCP (full validation by Notion API)
5
4
  const inputSchema = {
6
- database_id: z.string().describe('The ID of the database to update'),
7
- title: RichTextArraySchema.optional().describe('Optional new title for the database as an array of rich text objects. ' +
8
- 'Example: [{ "type": "text", "text": { "content": "Updated Database Title" } }]'),
9
- description: RichTextArraySchema.optional().describe('Optional new description for the database as an array of rich text objects. ' +
10
- 'Example: [{ "type": "text", "text": { "content": "Database description" } }]'),
11
- properties: DatabasePropertiesSchema.optional().describe('Optional properties to add or update. Keys are property names, values define the property type and configuration. ' +
12
- 'To add a new property, include its full schema. To update an existing property, provide the property name with its new configuration. ' +
13
- 'To rename a property, use the property ID as key with a "name" field. ' +
14
- 'To delete a property, set it to null. ' +
15
- 'Supported types: title, rich_text, number, select, multi_select, date, people, files, checkbox, url, email, phone_number, formula, relation, rollup, created_time, created_by, last_edited_time, last_edited_by. ' +
16
- 'Example: { "NewColumn": { "rich_text": {} }, "Price": { "number": { "format": "euro" } } }'),
17
- icon: IconSchema.nullable()
18
- .optional()
19
- .describe('Optional icon for the database. Set to null to remove the icon. ' +
20
- 'Emoji: { "type": "emoji", "emoji": "📊" }. ' +
21
- 'External: { "type": "external", "external": { "url": "https://..." } }'),
22
- cover: CoverSchema.nullable()
23
- .optional()
24
- .describe('Optional cover image for the database. Set to null to remove the cover. ' +
25
- 'Example: { "type": "external", "external": { "url": "https://..." } }'),
26
- is_inline: z
27
- .boolean()
28
- .optional()
29
- .describe('Optional. If true, the database will appear as an inline database. ' +
30
- 'If false, it will be a full page database.'),
31
- archived: z
32
- .boolean()
33
- .optional()
34
- .describe('Optional. Set to true to archive the database, false to unarchive.'),
5
+ database_id: z.string().describe('Database ID'),
6
+ title: z.array(z.any()).optional().describe('New title'),
7
+ description: z.array(z.any()).optional().describe('New description'),
8
+ properties: z.record(z.string(), z.any()).optional().describe('Properties to add/update/delete'),
9
+ icon: z.any().optional().describe('Icon (null to remove)'),
10
+ cover: z.any().optional().describe('Cover (null to remove)'),
11
+ is_inline: z.boolean().optional().describe('Inline database'),
12
+ archived: z.boolean().optional().describe('Archive status'),
35
13
  };
36
14
  export function registerUpdateDatabase(server, notion) {
37
15
  server.registerTool('update-database', {
@@ -64,6 +42,7 @@ export function registerUpdateDatabase(server, notion) {
64
42
  if (archived !== undefined) {
65
43
  params.archived = archived;
66
44
  }
45
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
46
  const response = await notion.databases.update(params);
68
47
  return formatResponse(response);
69
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"update-page.d.ts","sourceRoot":"","sources":["../../../src/tools/update-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAkCvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA4ChF"}
1
+ {"version":3,"file":"update-page.d.ts","sourceRoot":"","sources":["../../../src/tools/update-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAiBvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CA4ChF"}
@@ -1,24 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { CoverSchema, IconSchema } from '../schemas/common.js';
3
- import { PropertiesSchema } from '../schemas/page.js';
4
2
  import { formatResponse, handleError } from '../utils/index.js';
3
+ // Minimal schema for MCP (full validation by Notion API)
5
4
  const inputSchema = {
6
- page_id: z.string().describe('The ID of the page to update'),
7
- properties: PropertiesSchema.optional().describe('Properties to update. Keys are property names, values follow Notion property format. ' +
8
- 'Supported types: title, rich_text, number, select, multi_select, status, date, checkbox, url, email, phone_number, relation, people, files. ' +
9
- 'Example: { "Status": { "status": { "name": "Done" } } }'),
10
- archived: z.boolean().optional().describe('Set to true to archive (delete) the page'),
11
- icon: IconSchema.nullable()
12
- .optional()
13
- .describe('Icon for the page. ' +
14
- 'Emoji: { "type": "emoji", "emoji": "🚀" }. ' +
15
- 'External: { "type": "external", "external": { "url": "https://..." } }. ' +
16
- 'Set to null to remove.'),
17
- cover: CoverSchema.nullable()
18
- .optional()
19
- .describe('Cover image for the page. ' +
20
- 'Example: { "type": "external", "external": { "url": "https://..." } }. ' +
21
- 'Set to null to remove.'),
5
+ page_id: z.string().describe('Page ID'),
6
+ properties: z.record(z.string(), z.any()).optional().describe('Properties to update'),
7
+ archived: z.boolean().optional().describe('Archive the page'),
8
+ icon: z.any().optional().describe('Page icon (null to remove)'),
9
+ cover: z.any().optional().describe('Cover image (null to remove)'),
22
10
  };
23
11
  export function registerUpdatePage(server, notion) {
24
12
  server.registerTool('update-page', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atikk-co-jp/notion-mcp-server",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "MCP server for Notion API - Create, read, update pages and databases",
5
5
  "type": "module",
6
6
  "license": "MIT",