@inkdropapp/mcp-server 1.1.1 → 1.2.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.
@@ -0,0 +1,78 @@
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]')
78
+
@@ -0,0 +1,64 @@
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
64
+
package/README.md CHANGED
@@ -58,6 +58,7 @@ A [Model Context Protocol](https://github.com/modelcontextprotocol) server for t
58
58
  - `body`: The content of the note in Markdown.
59
59
  - Optional inputs:
60
60
  - `status`: The note status (`none`, `active`, `onHold`, `completed`, `dropped`).
61
+ - `tags`: An array of tag IDs to assign to the note. Each must start with 'tag:'.
61
62
  5. **`update-note`**: Update an existing note in the database.
62
63
  - Required inputs:
63
64
  - `_id`: The note ID. Must start with 'note:'.
@@ -67,8 +68,27 @@ A [Model Context Protocol](https://github.com/modelcontextprotocol) server for t
67
68
  - `body`: The content of the note in Markdown.
68
69
  - Optional inputs:
69
70
  - `status`: The note status (`none`, `active`, `onHold`, `completed`, `dropped`).
71
+ - `tags`: An array of tag IDs to assign to the note. Each must start with 'tag:'.
70
72
  6. **`list-notebooks`**: Retrieve a list of all notebooks.
71
- 7. **`list-tags`**: Retrieve a list of all tags.
73
+ 7. **`read-book`**: Retrieve a single notebook by its ID.
74
+ - Required inputs:
75
+ - `bookId`: The notebook ID. Must start with 'book:'.
76
+ 8. **`list-tags`**: Retrieve a list of all tags.
77
+ 9. **`read-tag`**: Retrieve a single tag by its ID.
78
+ - Required inputs:
79
+ - `tagId`: The tag ID. Must start with 'tag:'.
80
+ 10. **`create-tag`**: Create a new tag in the database.
81
+ - Required inputs:
82
+ - `name`: The name of the tag.
83
+ - Optional inputs:
84
+ - `color`: The color type of the tag (`default`, `red`, `orange`, `yellow`, `olive`, `green`, `teal`, `blue`, `violet`, `purple`, `pink`, `brown`, `grey`, `black`). Default: `default`.
85
+ 11. **`update-tag`**: Update an existing tag in the database.
86
+ - Required inputs:
87
+ - `_id`: The tag ID. Must start with 'tag:'.
88
+ - `_rev`: The revision ID (CouchDB MVCC-token).
89
+ - `name`: The name of the tag.
90
+ - Optional inputs:
91
+ - `color`: The color type of the tag. Default: `default`.
72
92
 
73
93
  ## Debugging
74
94
 
package/dist/index.js CHANGED
@@ -191,7 +191,11 @@ server.tool('create-note', 'Create a new note in the database', {
191
191
  status: zod_1.z
192
192
  .enum(['none', 'active', 'onHold', 'completed', 'dropped'])
193
193
  .optional()
194
- .describe('The status of the note')
194
+ .describe('The status of the note'),
195
+ tags: zod_1.z
196
+ .array(zod_1.z.string().startsWith('tag:'))
197
+ .optional()
198
+ .describe('An array of tag IDs to assign to the note. Call `list-tags` or `read-tag` to retrieve available tags. You can create a new tag with `create-tag` tool if necessary.')
195
199
  }, async (noteData) => {
196
200
  const res = await (0, api_1.postJSON)(`/notes`, noteData);
197
201
  return {
@@ -227,7 +231,11 @@ server.tool('update-note', 'Update the existing note in the database. You should
227
231
  status: zod_1.z
228
232
  .enum(['none', 'active', 'onHold', 'completed', 'dropped'])
229
233
  .optional()
230
- .describe('The status of the note')
234
+ .describe('The status of the note'),
235
+ tags: zod_1.z
236
+ .array(zod_1.z.string().startsWith('tag:'))
237
+ .optional()
238
+ .describe('An array of tag IDs to assign to the note. Call `list-tags` or `read-tag` to retrieve available tags. You can create a new tag with `create-tag` tool if necessary.')
231
239
  }, async (noteData) => {
232
240
  const res = await (0, api_1.postJSON)(`/notes`, noteData);
233
241
  return {
@@ -239,6 +247,78 @@ server.tool('update-note', 'Update the existing note in the database. You should
239
247
  ]
240
248
  };
241
249
  });
250
+ server.tool('list-tags', `Retrieve a list of all tags`, {}, async () => {
251
+ const tags = await (0, api_1.fetchJSON)('/tags');
252
+ return {
253
+ content: [
254
+ {
255
+ type: 'text',
256
+ text: JSON.stringify(tags, null, 2)
257
+ }
258
+ ]
259
+ };
260
+ });
261
+ server.tool('read-tag', `Retrieve a single tag`, {
262
+ tagId: zod_1.z
263
+ .string()
264
+ .describe('ID of the tag to retrieve. It can be found as `_id` in the tag docs. It always starts with \`tag:\`.')
265
+ }, async ({ tagId }) => {
266
+ if (!tagId.startsWith('tag:'))
267
+ tagId = `tag:${tagId}`;
268
+ const tag = await (0, api_1.fetchJSON)(`/${tagId}`, {});
269
+ return {
270
+ content: [
271
+ {
272
+ type: 'text',
273
+ text: JSON.stringify(tag, null, 2)
274
+ }
275
+ ]
276
+ };
277
+ });
278
+ const TagColors = Object.values(inkdrop_model_1.TAG_COLOR);
279
+ server.tool('create-tag', 'Create a new tag in the database', {
280
+ color: zod_1.z
281
+ .enum(TagColors)
282
+ .default('default')
283
+ .describe('The color type of the tag'),
284
+ name: zod_1.z.string().max(64).describe('The name of the tag')
285
+ }, async (tagData) => {
286
+ const res = await (0, api_1.postJSON)(`/tags`, tagData);
287
+ return {
288
+ content: [
289
+ {
290
+ type: 'text',
291
+ text: JSON.stringify(res, null, 2)
292
+ }
293
+ ]
294
+ };
295
+ });
296
+ server.tool('update-tag', 'Update the existing tag in the database. You should retrieve the existing tag with \`list-tags\` first. When updating the tag, you must specify not only the changed fields but also all the un-changed fields.', {
297
+ _id: zod_1.z
298
+ .string()
299
+ .min(6)
300
+ .max(128)
301
+ .regex(/^tag:/)
302
+ .describe('The unique document ID which should start with `tag:` and the remains are randomly generated string'),
303
+ _rev: zod_1.z
304
+ .string()
305
+ .describe('This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable).'),
306
+ color: zod_1.z
307
+ .enum(TagColors)
308
+ .default('default')
309
+ .describe('The color type of the tag'),
310
+ name: zod_1.z.string().max(64).describe('The name of the tag')
311
+ }, async (tagData) => {
312
+ const res = await (0, api_1.postJSON)(`/tags`, tagData);
313
+ return {
314
+ content: [
315
+ {
316
+ type: 'text',
317
+ text: JSON.stringify(res, null, 2)
318
+ }
319
+ ]
320
+ };
321
+ });
242
322
  server.tool('list-notebooks', `Retrieve a list of all notebooks`, {}, async () => {
243
323
  const books = await (0, api_1.fetchJSON)('/books');
244
324
  return {
@@ -250,13 +330,19 @@ server.tool('list-notebooks', `Retrieve a list of all notebooks`, {}, async () =
250
330
  ]
251
331
  };
252
332
  });
253
- server.tool('list-tags', `Retrieve a list of all tags`, {}, async () => {
254
- const books = await (0, api_1.fetchJSON)('/tags');
333
+ server.tool('read-book', `Retrieve a single book`, {
334
+ bookId: zod_1.z
335
+ .string()
336
+ .describe('ID of the book to retrieve. It can be found as `_id` in the book docs. It always starts with \`book:\`.')
337
+ }, async ({ bookId }) => {
338
+ if (!bookId.startsWith('book:'))
339
+ bookId = `book:${bookId}`;
340
+ const book = await (0, api_1.fetchJSON)(`/${bookId}`, {});
255
341
  return {
256
342
  content: [
257
343
  {
258
344
  type: 'text',
259
- text: JSON.stringify(books, null, 2)
345
+ text: JSON.stringify(book, null, 2)
260
346
  }
261
347
  ]
262
348
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkdropapp/mcp-server",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Inkdrop Model Context Protocol Server",
5
5
  "bin": {
6
6
  "inkdrop-mcp-server": "dist/index.js"
package/src/index.ts CHANGED
@@ -5,7 +5,15 @@ import {
5
5
  ResourceTemplate
6
6
  } from '@modelcontextprotocol/sdk/server/mcp.js'
7
7
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
8
- import { Note, NoteSchema, Book, BookSchema, TagSchema } from 'inkdrop-model'
8
+ import {
9
+ Note,
10
+ NoteSchema,
11
+ Book,
12
+ BookSchema,
13
+ TagSchema,
14
+ TAG_COLOR,
15
+ Tag
16
+ } from 'inkdrop-model'
9
17
  import { z } from 'zod'
10
18
  import { fetchJSON, postJSON } from './api'
11
19
 
@@ -230,7 +238,14 @@ server.tool(
230
238
  status: z
231
239
  .enum(['none', 'active', 'onHold', 'completed', 'dropped'])
232
240
  .optional()
233
- .describe('The status of the note')
241
+ .describe('The status of the note'),
242
+
243
+ tags: z
244
+ .array(z.string().startsWith('tag:'))
245
+ .optional()
246
+ .describe(
247
+ 'An array of tag IDs to assign to the note. Call `list-tags` or `read-tag` to retrieve available tags. You can create a new tag with `create-tag` tool if necessary.'
248
+ )
234
249
  },
235
250
  async noteData => {
236
251
  const res = await postJSON(`/notes`, noteData)
@@ -283,7 +298,14 @@ server.tool(
283
298
  status: z
284
299
  .enum(['none', 'active', 'onHold', 'completed', 'dropped'])
285
300
  .optional()
286
- .describe('The status of the note')
301
+ .describe('The status of the note'),
302
+
303
+ tags: z
304
+ .array(z.string().startsWith('tag:'))
305
+ .optional()
306
+ .describe(
307
+ 'An array of tag IDs to assign to the note. Call `list-tags` or `read-tag` to retrieve available tags. You can create a new tag with `create-tag` tool if necessary.'
308
+ )
287
309
  },
288
310
  async noteData => {
289
311
  const res = await postJSON(`/notes`, noteData)
@@ -298,6 +320,107 @@ server.tool(
298
320
  }
299
321
  )
300
322
 
323
+ server.tool('list-tags', `Retrieve a list of all tags`, {}, async () => {
324
+ const tags: Tag[] = await fetchJSON('/tags')
325
+ return {
326
+ content: [
327
+ {
328
+ type: 'text',
329
+ text: JSON.stringify(tags, null, 2)
330
+ }
331
+ ]
332
+ }
333
+ })
334
+
335
+ server.tool(
336
+ 'read-tag',
337
+ `Retrieve a single tag`,
338
+ {
339
+ tagId: z
340
+ .string()
341
+ .describe(
342
+ 'ID of the tag to retrieve. It can be found as `_id` in the tag docs. It always starts with \`tag:\`.'
343
+ )
344
+ },
345
+ async ({ tagId }) => {
346
+ if (!tagId.startsWith('tag:')) tagId = `tag:${tagId}`
347
+ const tag: Tag = await fetchJSON(`/${tagId}`, {})
348
+ return {
349
+ content: [
350
+ {
351
+ type: 'text',
352
+ text: JSON.stringify(tag, null, 2)
353
+ }
354
+ ]
355
+ }
356
+ }
357
+ )
358
+
359
+ const TagColors = Object.values(TAG_COLOR) as [string, ...string[]]
360
+
361
+ server.tool(
362
+ 'create-tag',
363
+ 'Create a new tag in the database',
364
+ {
365
+ color: z
366
+ .enum(TagColors)
367
+ .default('default')
368
+ .describe('The color type of the tag'),
369
+
370
+ name: z.string().max(64).describe('The name of the tag')
371
+ },
372
+ async tagData => {
373
+ const res = await postJSON(`/tags`, tagData)
374
+ return {
375
+ content: [
376
+ {
377
+ type: 'text',
378
+ text: JSON.stringify(res, null, 2)
379
+ }
380
+ ]
381
+ }
382
+ }
383
+ )
384
+
385
+ server.tool(
386
+ 'update-tag',
387
+ 'Update the existing tag in the database. You should retrieve the existing tag with \`list-tags\` first. When updating the tag, you must specify not only the changed fields but also all the un-changed fields.',
388
+ {
389
+ _id: z
390
+ .string()
391
+ .min(6)
392
+ .max(128)
393
+ .regex(/^tag:/)
394
+ .describe(
395
+ 'The unique document ID which should start with `tag:` and the remains are randomly generated string'
396
+ ),
397
+
398
+ _rev: z
399
+ .string()
400
+ .describe(
401
+ 'This is a CouchDB specific field. The current MVCC-token/revision of this document (mandatory and immutable).'
402
+ ),
403
+
404
+ color: z
405
+ .enum(TagColors)
406
+ .default('default')
407
+ .describe('The color type of the tag'),
408
+
409
+ name: z.string().max(64).describe('The name of the tag')
410
+ },
411
+ async tagData => {
412
+ const res = await postJSON(`/tags`, tagData)
413
+ return {
414
+ content: [
415
+ {
416
+ type: 'text',
417
+ text: JSON.stringify(res, null, 2)
418
+ }
419
+ ]
420
+ }
421
+ }
422
+ )
423
+
301
424
  server.tool(
302
425
  'list-notebooks',
303
426
  `Retrieve a list of all notebooks`,
@@ -315,17 +438,29 @@ server.tool(
315
438
  }
316
439
  )
317
440
 
318
- server.tool('list-tags', `Retrieve a list of all tags`, {}, async () => {
319
- const books: Book[] = await fetchJSON('/tags')
320
- return {
321
- content: [
322
- {
323
- type: 'text',
324
- text: JSON.stringify(books, null, 2)
325
- }
326
- ]
441
+ server.tool(
442
+ 'read-book',
443
+ `Retrieve a single book`,
444
+ {
445
+ bookId: z
446
+ .string()
447
+ .describe(
448
+ 'ID of the book to retrieve. It can be found as `_id` in the book docs. It always starts with \`book:\`.'
449
+ )
450
+ },
451
+ async ({ bookId }) => {
452
+ if (!bookId.startsWith('book:')) bookId = `book:${bookId}`
453
+ const book: Book = await fetchJSON(`/${bookId}`, {})
454
+ return {
455
+ content: [
456
+ {
457
+ type: 'text',
458
+ text: JSON.stringify(book, null, 2)
459
+ }
460
+ ]
461
+ }
327
462
  }
328
- })
463
+ )
329
464
 
330
465
  server.prompt(
331
466
  'inkdrop-prompt',