@squirrelnotes.app/mcp 1.28.0 → 1.29.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.
@@ -22392,6 +22392,18 @@ var init_api2 = __esm({
22392
22392
  deleteNote(id) {
22393
22393
  return this.requestVoid("DELETE", `/public/notes/${id}`);
22394
22394
  }
22395
+ listTrash() {
22396
+ return this.request("GET", "/public/notes/trash");
22397
+ }
22398
+ restoreNote(id) {
22399
+ return this.request("POST", `/public/notes/${id}/restore`);
22400
+ }
22401
+ emptyTrash() {
22402
+ return this.requestVoid("DELETE", "/public/notes/trash");
22403
+ }
22404
+ permanentlyDeleteNote(id) {
22405
+ return this.requestVoid("DELETE", `/public/notes/${id}/permanent`);
22406
+ }
22395
22407
  setNoteTags(id, tagIds) {
22396
22408
  return this.request("POST", `/public/notes/${id}/tags`, { tagIds });
22397
22409
  }
@@ -22823,12 +22835,65 @@ function createMcpServer(creds, opts = {}) {
22823
22835
  );
22824
22836
  server2.tool(
22825
22837
  "delete_note",
22826
- "Soft-delete a note by ID. The note is moved to trash and its encrypted content is cleared. This action cannot be undone via the API.",
22838
+ "Moves the note to trash. The encrypted content is preserved and the note can be restored within 30 days. Public share links are revoked immediately. After 30 days the note is automatically hard-deleted.",
22827
22839
  { id: external_exports.string().describe("Note ID") },
22828
22840
  async ({ id }) => {
22829
22841
  const { client } = await buildContext(creds);
22830
22842
  await client.deleteNote(id);
22831
- return { content: [{ type: "text", text: JSON.stringify({ id, deleted: true }, null, 2) }] };
22843
+ return { content: [{ type: "text", text: JSON.stringify({ id, trashed: true }, null, 2) }] };
22844
+ }
22845
+ );
22846
+ server2.tool(
22847
+ "list_trash",
22848
+ "List all trashed notes. Returns notes with decrypted titles and the date they were trashed. Notes are automatically hard-deleted 30 days after trashing.",
22849
+ {},
22850
+ async () => {
22851
+ const { client, key } = await buildContext(creds);
22852
+ const notes = await client.listTrash();
22853
+ const result = notes.map((n) => {
22854
+ let title = "(Untitled)";
22855
+ try {
22856
+ title = decrypt(n.encryptedTitle, n.titleIv, key) || "(Untitled)";
22857
+ } catch {
22858
+ }
22859
+ return {
22860
+ id: n.id,
22861
+ title,
22862
+ trashedAt: n.trashedAt ?? null,
22863
+ collectionId: n.collectionId
22864
+ };
22865
+ });
22866
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
22867
+ }
22868
+ );
22869
+ server2.tool(
22870
+ "restore_note",
22871
+ "Restore a note from trash back to active. The note returns to its last collection. Public share links are NOT recreated.",
22872
+ { id: external_exports.string().describe("Note ID") },
22873
+ async ({ id }) => {
22874
+ const { client } = await buildContext(creds);
22875
+ const note = await client.restoreNote(id);
22876
+ return { content: [{ type: "text", text: JSON.stringify({ id: note.id, restored: true }, null, 2) }] };
22877
+ }
22878
+ );
22879
+ server2.tool(
22880
+ "permanently_delete_note",
22881
+ "Permanently and irreversibly delete a single trashed note. Removes all attachments from S3 and clears encrypted content. The note must already be in trash.",
22882
+ { id: external_exports.string().describe("Note ID (must be in trash)") },
22883
+ async ({ id }) => {
22884
+ const { client } = await buildContext(creds);
22885
+ await client.permanentlyDeleteNote(id);
22886
+ return { content: [{ type: "text", text: JSON.stringify({ id, permanentlyDeleted: true }, null, 2) }] };
22887
+ }
22888
+ );
22889
+ server2.tool(
22890
+ "empty_trash",
22891
+ "Permanently and irreversibly delete ALL trashed notes. Removes all their attachments from S3. This cannot be undone. Requires confirm: true.",
22892
+ { confirm: external_exports.literal(true).describe("Must be true to confirm the destructive operation") },
22893
+ async () => {
22894
+ const { client } = await buildContext(creds);
22895
+ await client.emptyTrash();
22896
+ return { content: [{ type: "text", text: JSON.stringify({ emptied: true }, null, 2) }] };
22832
22897
  }
22833
22898
  );
22834
22899
  server2.tool(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squirrelnotes.app/mcp",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "description": "MCP stdio CLI for Squirrel Notes — bridges AI agents to the encrypted note-taking API",
5
5
  "type": "module",
6
6
  "bin": {