Skip to content

feat(mcp): add edit and organize tools for notes and snippets - #982

Merged
antonreshetov merged 1 commit into
mainfrom
feat/mcp-edit-notes-snippets
Oct 14, 2026
Merged

antonreshetov merged 1 commit into
mainfrom
feat/mcp-edit-notes-snippets

Conversation

@antonreshetov

Copy link
Copy Markdown
Member

Summary

Adds editing and organization of notes, snippets, folders and HTTP requests to the MCP server. Edits are protected by a new opt-in preference, and writes are checked against concurrent changes.

Changes

  • New MCP tools: list_structure, list_items, update_note, update_snippet, trash_item, restore_item, create_folder, update_folder, delete_folder, move_items, get_note_links.
  • create_note and create_snippet accept folderId and tags.
  • Optimistic concurrency: items expose contentRevision. A write with a stale revision returns CONFLICT.
  • Clearer errors for invalid names: the error explains the reason and lists forbidden characters.
  • New preference api.mcp.allowEdits ("Allow MCP to modify existing items"). All tools that change existing items, including update_http_request, return EDITING_DISABLED while it is off.
  • list_http_requests accepts status: active | trash, so request IDs can be found for restore_item.
  • trash_item clears folderId, matching the app.
  • delete_folder removes only empty folders: subfolders, active items or files that massCode does not manage block deletion.
  • Storage: getUnmanagedFiles for code and notes folders, and a fix that prevents a folder from becoming its own parent.
  • Docs: MCP guide, documentation index and README updated; Claude Code is listed first.

Behavior changes and migration

  • api.mcp.allowEdits is enabled automatically for users who already have MCP enabled, so their current behavior is preserved. New users get it disabled by default.
  • For new users, update_http_request requires allowEdits. Until they enable it, the tool returns EDITING_DISABLED.

Testing

  • Vitest: src/main/api/mcp, store preferences, storage folders (257 tests).
  • ESLint on the changed files.
  • TypeScript check for the main process.
  • VitePress docs build.
  • Manual check of all tools through Claude Code on a dev build.

Known limitations

  • Autosave of a note that is open in the editor can overwrite an edit made through MCP.
  • Rolling back the runtime cache when a write fails is moved to a separate task.

@antonreshetov antonreshetov self-assigned this Oct 14, 2026
@antonreshetov
antonreshetov merged commit 48cd9e9 into main Oct 14, 2026
@antonreshetov
antonreshetov deleted the feat/mcp-edit-notes-snippets branch October 14, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant