@inkdropapp/mcp-server 1.5.0 → 1.6.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
@@ -34,63 +34,67 @@ Read [the docs here](https://docs.inkdrop.app/reference/mcp-server).
34
34
  - `sort`: Sort field (`updatedAt`, `createdAt`, or `title`). Default: `updatedAt`.
35
35
  - `descending`: Reverse the order of output. Default: `true`.
36
36
  - Note: Results include truncated note bodies (200 characters). Use `read-note` to get full content.
37
- 5. **`create-note`**: Create a new note in the database.
37
+ 5. **`list-templates`**: List note templates — your custom templates, followed by the official ones bundled with Inkdrop.
38
+ - Optional inputs:
39
+ - `keyword`: Filter templates by fuzzy-matching their titles.
40
+ - Note: Results include truncated template bodies (200 characters). Use `read-note` to get full content.
41
+ 6. **`create-note`**: Create a new note in the database.
38
42
  - Required inputs:
39
- - `bookId`: The notebook ID. Must start with 'book:' or be 'trash'.
43
+ - `bookId`: The notebook ID. Must start with 'book:' or be 'trash' or 'template'. Specify 'template' to create a custom note template.
40
44
  - `title`: The note title.
41
45
  - `body`: The content of the note in Markdown.
42
46
  - Optional inputs:
43
47
  - `status`: The note status (`none`, `active`, `onHold`, `completed`, `dropped`).
44
48
  - `tags`: An array of tag IDs to assign to the note. Each must start with 'tag:'.
45
- 6. **`update-note`**: Update an existing note in the database. Only the fields you provide will be updated; omitted fields remain unchanged.
49
+ 7. **`update-note`**: Update an existing note in the database. Only the fields you provide will be updated; omitted fields remain unchanged.
46
50
  - Required inputs:
47
51
  - `_id`: The note ID. Must start with 'note:'.
48
52
  - `_rev`: The revision ID (CouchDB MVCC-token).
49
53
  - Optional inputs:
50
- - `bookId`: The notebook ID. Must start with 'book:' or be 'trash'.
54
+ - `bookId`: The notebook ID. Must start with 'book:' or be 'trash' or 'template'.
51
55
  - `title`: The note title.
52
56
  - `body`: The content of the note in Markdown.
53
57
  - `status`: The note status (`none`, `active`, `onHold`, `completed`, `dropped`).
54
58
  - `tags`: An array of tag IDs to assign to the note. Each must start with 'tag:'.
55
- 7. **`patch-note`**: Update the body of an existing note by performing an exact string replacement. More efficient than `update-note` for small edits to large notes as it saves tokens. You must first read the note with `read-note` to get the current body.
59
+ 8. **`patch-note`**: Update the body of an existing note by performing an exact string replacement. More efficient than `update-note` for small edits to large notes as it saves tokens. You must first read the note with `read-note` to get the current body.
56
60
  - Required inputs:
57
61
  - `_id`: The note ID. Must start with 'note:'.
58
62
  - `_rev`: The revision ID (CouchDB MVCC-token).
59
63
  - `old_string`: The exact text to find in the note body. Must match exactly one occurrence. Include enough surrounding context to ensure a unique match.
60
64
  - `new_string`: The text to replace `old_string` with. Use an empty string to delete the matched text.
61
- 8. **`list-notebooks`**: Retrieve a list of all notebooks.
62
- 9. **`read-book`**: Retrieve a single notebook by its ID.
63
- - Required inputs:
64
- - `bookId`: The notebook ID. Must start with 'book:'.
65
- 10. **`create-book`**: Create a new notebook in the database.
65
+ 9. **`list-notebooks`**: Retrieve a list of all notebooks.
66
+ 10. **`read-book`**: Retrieve a single notebook by its ID.
67
+ - Required inputs:
68
+ - `bookId`: The notebook ID. Must start with 'book:'.
69
+ 11. **`create-book`**: Create a new notebook in the database.
66
70
  - Required inputs:
67
71
  - `name`: The notebook name.
68
72
  - Optional inputs:
69
73
  - `parentBookId`: The ID of the parent notebook. Must start with 'book:'. Omit it to create the notebook at the root level.
70
- 11. **`update-book`**: Update an existing notebook in the database. Only the fields you provide will be updated; omitted fields remain unchanged, so you don't need to read the notebook first.
74
+ 12. **`update-book`**: Update an existing notebook in the database. Only the fields you provide will be updated; omitted fields remain unchanged, so you don't need to read the notebook first.
71
75
  - Required inputs:
72
76
  - `_id`: The notebook ID. Must start with 'book:'.
73
77
  - Optional inputs:
74
78
  - `_rev`: The revision ID (CouchDB MVCC-token). Only needed as an optimistic-concurrency guard — pass it to make the update fail on a conflicting concurrent edit.
75
79
  - `name`: The notebook name.
76
80
  - `parentBookId`: The ID of the parent notebook. Pass `null` to move the notebook to the root level.
77
- 12. **`list-tags`**: Retrieve a list of all tags.
78
- 13. **`read-tag`**: Retrieve a single tag by its ID.
81
+ 13. **`list-tags`**: Retrieve a list of all tags.
82
+ 14. **`read-tag`**: Retrieve a single tag by its ID.
79
83
  - Required inputs:
80
84
  - `tagId`: The tag ID. Must start with 'tag:'.
81
- 14. **`create-tag`**: Create a new tag in the database.
85
+ 15. **`create-tag`**: Create a new tag in the database.
82
86
  - Required inputs:
83
87
  - `name`: The name of the tag.
84
88
  - Optional inputs:
85
89
  - `color`: The color type of the tag (`default`, `red`, `orange`, `yellow`, `olive`, `green`, `teal`, `blue`, `violet`, `purple`, `pink`, `brown`, `grey`, `black`). Default: `default`.
86
- 15. **`update-tag`**: Update an existing tag in the database. Only the fields you provide will be updated; omitted fields remain unchanged, so you don't need to read the tag first.
90
+ 16. **`update-tag`**: Update an existing tag in the database. Only the fields you provide will be updated; omitted fields remain unchanged, so you don't need to read the tag first.
87
91
  - Required inputs:
88
92
  - `_id`: The tag ID. Must start with 'tag:'.
89
93
  - Optional inputs:
90
94
  - `_rev`: The revision ID (CouchDB MVCC-token). Only needed as an optimistic-concurrency guard — pass it to make the update fail on a conflicting concurrent edit.
91
95
  - `name`: The name of the tag.
92
96
  - `color`: The color type of the tag. Omit it to keep the tag's current color.
93
- 16. **`create-file`**: Create a new attachment file in the database from a local image file or from base64 image data. Returns the Markdown to embed the attachment in a note body.
97
+ 17. **`create-file`**: Create a new attachment file in the database from a local image file or from base64 image data. Returns the Markdown to embed the attachment in a note body.
94
98
  - Required inputs: exactly one of
95
99
  - `filePath`: Absolute path to a local image file to attach. Preferred — it keeps the image bytes out of the conversation.
96
100
  - `data`: Base64-encoded image data, without a `data:` URI prefix.
@@ -99,7 +103,7 @@ Read [the docs here](https://docs.inkdrop.app/reference/mcp-server).
99
103
  - `contentType`: The MIME type (`image/png`, `image/jpeg`, `image/jpg`, `image/svg+xml`, `image/gif`, `image/heic`, `image/heif`). Inferred from the `filePath` extension when omitted, so it is required with `data`.
100
104
  - `publicIn`: An array of note IDs where the attachment is included. Each must start with 'note:'.
101
105
  - Note: Attachments are limited to 10MB.
102
- 17. **`read-file`**: Retrieve an attachment file by its ID. Returns the file metadata, and the image itself when it is a PNG, JPEG or GIF.
106
+ 18. **`read-file`**: Retrieve an attachment file by its ID. Returns the file metadata, and the image itself when it is a PNG, JPEG or GIF.
103
107
  - Required inputs:
104
108
  - `fileId`: The attachment ID. Must start with 'file:'.
105
109
  - Optional inputs:
package/dist/index.js CHANGED
@@ -215,7 +215,7 @@ You have to retrieve the full note content by calling \`read-note\`.
215
215
  bookId: zod_1.z
216
216
  .string()
217
217
  .optional()
218
- .describe(`ID of the notebook. It always starts with 'book:'. You can retrieve a list of notebooks with \`list-notebooks\``),
218
+ .describe(`ID of the notebook. It always starts with 'book:'. You can retrieve a list of notebooks with \`list-notebooks\`. The pseudo-notebooks 'trash' and 'template' are not supported here; use \`list-templates\` for templates`),
219
219
  tagIds: zod_1.z
220
220
  .array(zod_1.z.string())
221
221
  .optional()
@@ -259,6 +259,35 @@ You have to retrieve the full note content by calling \`read-note\`.
259
259
  ]
260
260
  };
261
261
  });
262
+ server.registerTool('list-templates', {
263
+ description: `List note templates: your custom templates, followed by the official ones bundled with Inkdrop.
264
+ Templates are notes whose \`bookId\` is \`template\`. Official templates are read-only.
265
+ The result does not include entire template bodies as they are truncated in 200 characters.
266
+ You have to retrieve the full template content by calling \`read-note\`.
267
+ `,
268
+ inputSchema: {
269
+ keyword: zod_1.z
270
+ .string()
271
+ .optional()
272
+ .describe('Filter templates by fuzzy-matching their titles. Search qualifiers such as `book:` or `tag:` are not supported.')
273
+ }
274
+ }, async ({ keyword }) => {
275
+ const templates = await (0, api_1.fetchJSON)('/templates', { keyword });
276
+ const summaries = templates.map(template => {
277
+ return {
278
+ ...template,
279
+ body: template.body.substring(0, 200)
280
+ };
281
+ });
282
+ return {
283
+ content: [
284
+ {
285
+ type: 'text',
286
+ text: JSON.stringify(summaries, null, 2)
287
+ }
288
+ ]
289
+ };
290
+ });
262
291
  server.registerTool('create-note', {
263
292
  description: 'Create a new note in the database',
264
293
  inputSchema: {
@@ -266,8 +295,8 @@ server.registerTool('create-note', {
266
295
  .string()
267
296
  .min(5)
268
297
  .max(128)
269
- .regex(/^(book:|trash$)/)
270
- .describe('The notebook ID'),
298
+ .regex(/^(book:|trash$|template$)/)
299
+ .describe('The notebook ID. Specify `template` to create a custom note template'),
271
300
  title: zod_1.z.string().max(128).describe('The note title'),
272
301
  body: zod_1.z.string().max(1048576).describe('The content of the note represented with Markdown'),
273
302
  status: zod_1.z
@@ -306,9 +335,9 @@ server.registerTool('update-note', {
306
335
  .string()
307
336
  .min(5)
308
337
  .max(128)
309
- .regex(/^(book:|trash$)/)
338
+ .regex(/^(book:|trash$|template$)/)
310
339
  .optional()
311
- .describe('The notebook ID'),
340
+ .describe('The notebook ID. Specify `template` to turn the note into a custom note template'),
312
341
  title: zod_1.z.string().max(128).optional().describe('The note title'),
313
342
  body: zod_1.z
314
343
  .string()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkdropapp/mcp-server",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Inkdrop Model Context Protocol Server",
5
5
  "bin": {
6
6
  "inkdrop-mcp-server": "dist/index.js"
@@ -26,14 +26,14 @@
26
26
  "author": "Takuya Matsuyama<contact@inkdrop.app>",
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@modelcontextprotocol/sdk": "^1.30.0",
29
+ "@modelcontextprotocol/sdk": "^1.32.1",
30
30
  "ajv": "^8.20.0",
31
- "inkdrop-model": "^2.13.1",
32
- "zod": "^4.5.4"
31
+ "inkdrop-model": "^3.0.1",
32
+ "zod": "^4.6.7"
33
33
  },
34
34
  "devDependencies": {
35
- "@types/node": "^26.4.1",
36
- "oxfmt": "^0.66.0",
35
+ "@types/node": "^26.6.5",
36
+ "oxfmt": "^0.73.0",
37
37
  "typescript": "^7.0.2"
38
38
  }
39
39
  }
package/src/index.ts CHANGED
@@ -257,7 +257,7 @@ You have to retrieve the full note content by calling \`read-note\`.
257
257
  .string()
258
258
  .optional()
259
259
  .describe(
260
- `ID of the notebook. It always starts with 'book:'. You can retrieve a list of notebooks with \`list-notebooks\``
260
+ `ID of the notebook. It always starts with 'book:'. You can retrieve a list of notebooks with \`list-notebooks\`. The pseudo-notebooks 'trash' and 'template' are not supported here; use \`list-templates\` for templates`
261
261
  ),
262
262
  tagIds: z
263
263
  .array(z.string())
@@ -307,6 +307,42 @@ You have to retrieve the full note content by calling \`read-note\`.
307
307
  }
308
308
  )
309
309
 
310
+ server.registerTool(
311
+ 'list-templates',
312
+ {
313
+ description: `List note templates: your custom templates, followed by the official ones bundled with Inkdrop.
314
+ Templates are notes whose \`bookId\` is \`template\`. Official templates are read-only.
315
+ The result does not include entire template bodies as they are truncated in 200 characters.
316
+ You have to retrieve the full template content by calling \`read-note\`.
317
+ `,
318
+ inputSchema: {
319
+ keyword: z
320
+ .string()
321
+ .optional()
322
+ .describe(
323
+ 'Filter templates by fuzzy-matching their titles. Search qualifiers such as `book:` or `tag:` are not supported.'
324
+ )
325
+ }
326
+ },
327
+ async ({ keyword }) => {
328
+ const templates: Note[] = await fetchJSON('/templates', { keyword })
329
+ const summaries = templates.map(template => {
330
+ return {
331
+ ...template,
332
+ body: template.body.substring(0, 200)
333
+ }
334
+ })
335
+ return {
336
+ content: [
337
+ {
338
+ type: 'text',
339
+ text: JSON.stringify(summaries, null, 2)
340
+ }
341
+ ]
342
+ }
343
+ }
344
+ )
345
+
310
346
  server.registerTool(
311
347
  'create-note',
312
348
  {
@@ -316,8 +352,8 @@ server.registerTool(
316
352
  .string()
317
353
  .min(5)
318
354
  .max(128)
319
- .regex(/^(book:|trash$)/)
320
- .describe('The notebook ID'),
355
+ .regex(/^(book:|trash$|template$)/)
356
+ .describe('The notebook ID. Specify `template` to create a custom note template'),
321
357
 
322
358
  title: z.string().max(128).describe('The note title'),
323
359
 
@@ -374,9 +410,11 @@ server.registerTool(
374
410
  .string()
375
411
  .min(5)
376
412
  .max(128)
377
- .regex(/^(book:|trash$)/)
413
+ .regex(/^(book:|trash$|template$)/)
378
414
  .optional()
379
- .describe('The notebook ID'),
415
+ .describe(
416
+ 'The notebook ID. Specify `template` to turn the note into a custom note template'
417
+ ),
380
418
 
381
419
  title: z.string().max(128).optional().describe('The note title'),
382
420
 
@@ -1,77 +0,0 @@
1
- name: Claude Code Review
2
-
3
- on:
4
- pull_request:
5
- types: [opened, synchronize]
6
- # Optional: Only run on specific file changes
7
- # paths:
8
- # - "src/**/*.ts"
9
- # - "src/**/*.tsx"
10
- # - "src/**/*.js"
11
- # - "src/**/*.jsx"
12
-
13
- jobs:
14
- claude-review:
15
- # Optional: Filter by PR author
16
- # if: |
17
- # github.event.pull_request.user.login == 'external-contributor' ||
18
- # github.event.pull_request.user.login == 'new-developer' ||
19
- # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20
-
21
- runs-on: ubuntu-latest
22
- permissions:
23
- contents: read
24
- pull-requests: read
25
- issues: read
26
- id-token: write
27
-
28
- steps:
29
- - name: Checkout repository
30
- uses: actions/checkout@v4
31
- with:
32
- fetch-depth: 1
33
-
34
- - name: Run Claude Code Review
35
- id: claude-review
36
- uses: anthropics/claude-code-action@beta
37
- with:
38
- claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39
-
40
- # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
41
- # model: "claude-opus-4-20250514"
42
-
43
- # Direct prompt for automated review (no @claude mention needed)
44
- direct_prompt: |
45
- Please review this pull request and provide feedback on:
46
- - Code quality and best practices
47
- - Potential bugs or issues
48
- - Performance considerations
49
- - Security concerns
50
- - Test coverage
51
-
52
- Be constructive and helpful in your feedback.
53
-
54
- # Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
55
- # use_sticky_comment: true
56
-
57
- # Optional: Customize review based on file types
58
- # direct_prompt: |
59
- # Review this PR focusing on:
60
- # - For TypeScript files: Type safety and proper interface usage
61
- # - For API endpoints: Security, input validation, and error handling
62
- # - For React components: Performance, accessibility, and best practices
63
- # - For tests: Coverage, edge cases, and test quality
64
-
65
- # Optional: Different prompts for different authors
66
- # direct_prompt: |
67
- # ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
68
- # 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
69
- # 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
70
-
71
- # Optional: Add specific tools for running tests or linting
72
- # allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
73
-
74
- # Optional: Skip review for certain conditions
75
- # if: |
76
- # !contains(github.event.pull_request.title, '[skip-review]') &&
77
- # !contains(github.event.pull_request.title, '[WIP]')
@@ -1,63 +0,0 @@
1
- name: Claude Code
2
-
3
- on:
4
- issue_comment:
5
- types: [created]
6
- pull_request_review_comment:
7
- types: [created]
8
- issues:
9
- types: [opened, assigned]
10
- pull_request_review:
11
- types: [submitted]
12
-
13
- jobs:
14
- claude:
15
- if: |
16
- (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
- (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
- (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
- (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
- runs-on: ubuntu-latest
21
- permissions:
22
- contents: read
23
- pull-requests: read
24
- issues: read
25
- id-token: write
26
- actions: read # Required for Claude to read CI results on PRs
27
- steps:
28
- - name: Checkout repository
29
- uses: actions/checkout@v4
30
- with:
31
- fetch-depth: 1
32
-
33
- - name: Run Claude Code
34
- id: claude
35
- uses: anthropics/claude-code-action@beta
36
- with:
37
- claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
-
39
- # This is an optional setting that allows Claude to read CI results on PRs
40
- additional_permissions: |
41
- actions: read
42
-
43
- # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
44
- # model: "claude-opus-4-20250514"
45
-
46
- # Optional: Customize the trigger phrase (default: @claude)
47
- # trigger_phrase: "/claude"
48
-
49
- # Optional: Trigger when specific user is assigned to an issue
50
- # assignee_trigger: "claude-bot"
51
-
52
- # Optional: Allow Claude to run specific commands
53
- # allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
54
-
55
- # Optional: Add custom instructions for Claude to customize its behavior for your project
56
- # custom_instructions: |
57
- # Follow our coding standards
58
- # Ensure all new code has tests
59
- # Use TypeScript for new files
60
-
61
- # Optional: Custom environment variables for Claude
62
- # claude_env: |
63
- # NODE_ENV: test