memdrive-mcp
v0.9.3Local-first MCP memory: Markdown notes and images with full-text search for Claude and Cursor.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_directory
List the immediate children (subfolders and files) of a directory inside the MemDrive memory library. Returns one line per entry with type, size, and modification time. Directories sort first. Use this to explore what is already stored before reading or saving. Paths are relative to the library root (MEMDRIVE_ROOT). Omit path or pass "" for the root. Absolute paths are accepted only when they stay inside the root.
| Parameter | Type | Description |
|---|---|---|
path | string | Directory to list, relative to the library root. Omit or pass "" for the root. |
search_files
Search the memory library by keyword, ranked by relevance (full-text index + BM25; Chinese queries are segmented, so 1–2 character terms match). Returns one hit per matching file (its best-matching chunk) with the file path, section heading, relevance score, and a snippet with the matched term highlighted as **term**. Filename matches are included too: a substring of a filename finds the file, including non-text files such as images. Results are paginated: limit defaults to 20, pass offset for the next page. Filters: file_types (e.g. [".md"]), tags (a file must carry at least one), date_from…
| Parameter | Type | Description |
|---|---|---|
date_from | string | Earliest file date (ISO date, e.g. "2026-01-01"). File date is front matter date, then filename date, then modification time. A date-only value means that calendar day in the server's local timezone. |
date_to | string | Latest file date (ISO date, e.g. "2026-12-31"). A date-only value covers that whole calendar day in the server's local timezone. |
diagnostics_only | boolean | Return the read-only library diagnostics report instead of searching (default false). |
exact_phrase | string | Phrase that must appear verbatim in a matching chunk (in addition to the keyword). |
file_types | array | File extensions to include, e.g. [".md", ".txt"]. Omit for all types. |
keyword | string | Keyword to search for (case-insensitive; Chinese terms are segmented). Required unless diagnostics_only is true. |
limit | integer | Maximum files to return (default 20, max 200). |
modified_after | string | Earliest modification time (ISO date). A date-only value means the start of that calendar day in the server's local timezone. |
modified_before | string | Latest modification time (ISO date). A date-only value covers that whole calendar day in the server's local timezone. |
offset | integer | Files to skip for pagination (default 0). |
path | string | Directory to search under, relative to the library root. Omit or pass "" for the whole library. |
rebuild_index | boolean | Force a full index rebuild before searching (default false). |
tags | array | A file must carry at least one of these tags (YAML front matter `tags:` or body `#tag`). Omit for all. |
save_file
CLIPBOARD FIRST — READ THIS BEFORE ANYTHING ELSE: When the user says to save a screenshot or an image from the clipboard — for example "把截图存下来", "把剪贴板里的图存下来", "save the screenshot", or any equivalent wording — pass images: ["clipboard"]. That is all it takes: the server reads the clipboard directly on the user's own machine. You do NOT need to see the clipboard or the image. NEVER ask the user to paste, upload, or send the image into the chat. NEVER say you cannot read the clipboard, that you cannot see images, or that this memory library can only store te…
| Parameter | Type | Description |
|---|---|---|
content * | string | Text content to save (usually Markdown). |
path * | string | Destination file path, relative to the library root (for example "notes/2026-10-28.md"). Must be confirmed with the user before calling. |
images | array | Images to archive with the document — CLIPBOARD FIRST: the literal string "clipboard" captures the latest screenshot/image from the OS clipboard on the machine running the server. Use it whenever th… |
mode | string | Write mode: "new" (default, fails if the file exists), "overwrite", or "append". |
edit_tags
Edit the tags on an existing Markdown note (.md, .markdown, .mdx; other file types are not supported): add one tag, remove one tag, or rename one tag. One operation per call. Tags live in two places: YAML front matter `tags:` (inline `[a, b]` or block `- a`) and body `#tag`s. The location parameter picks which one to edit (default front_matter). Only the tag lines change: the rest of the file is left byte-for-byte identical (no reflow, no other front-matter field touched). Adding a tag to a note with no front matter creates a minimal `---\ntags: [tag]\n---` block at the top; adding a body tag…
| Parameter | Type | Description |
|---|---|---|
operation * | string | One operation per call: "add" adds tag, "remove" removes tag, "rename" renames tag to new_tag. |
path * | string | Note to edit, relative to the library root (for example "notes/2026-10-28.md"). |
tag * | string | The tag to add, remove, or rename (without the leading "#"). |
location | string | Which tag syntax to edit: "front_matter" (default, YAML `tags:`) or "body" (`#tag`s in the text). |
new_tag | string | Required for "rename": the new tag name. Ignored for "add" and "remove". |
archive_file
Move a file into the top-level `archive/` folder, preserving its relative path (`notes/foo.md` becomes `archive/notes/foo.md`). Archiving is recoverable and is the default way to retire old or superseded files instead of deleting them. Use `restore_file` to move an archived file back. Files in `archive/` are excluded from `search_files`, while `list_directory` still shows `archive/` so archived files remain inspectable. Refuses to overwrite if the destination under `archive/` already exists, and rejects directories, missing files, `archive/` itself, or files already inside `archive/`. Paths ar…
| Parameter | Type | Description |
|---|---|---|
path * | string | File to archive, relative to the library root (for example "notes/2026-10-28.md"). |
restore_file
Restore an archived file from the top-level `archive/` folder back to its original path (for example `archive/notes/foo.md` becomes `notes/foo.md`). The search index is updated immediately so the restored file is searchable again. Refuses to overwrite if a file already exists at the original path, and rejects directories, missing files, or paths not inside `archive/`. Paths are relative to the library root (MEMDRIVE_ROOT). Absolute paths are accepted only when they stay inside the root. The root is a hard sandbox: "../" escapes and symlinks pointing outside are rejected.
| Parameter | Type | Description |
|---|---|---|
path * | string | Archived file to restore, relative to the library root — must start with "archive/" (for example "archive/notes/2026-10-28.md"). |
plan_cleanup
Generate a read-only cleanup plan for the library (two-step confirmation). Scans the library and proposes file actions — archiving empty files, duplicate files and orphan attachments — but changes nothing. Returns a plan ID and a human-readable preview. The plan is also saved as JSON in the per-library cache dir (plan-<id>.json) for the `apply_plan` tool or the `memdrive-mcp apply <plan-id>` command. Empty files, duplicates and orphan attachments are all proposed for archiving (recoverable); nothing is ever permanently deleted. Broken image references are listed as notes, not actions. Simi…
apply_plan
Execute a cleanup plan created by plan_cleanup, by its plan ID. Archives each action in the plan (empty files, duplicate files, orphan attachments) after re-verifying it; nothing is ever permanently deleted. Before executing, each action is re-verified against the library: the path must still exist, the SHA-256 and modification time must match the plan, and the reason must still hold (empty file still empty, duplicate group still intact, orphan still unreferenced). Actions that no longer hold are skipped with the reason, and the rest still execute. Plans older than 7 days are rejected. A plan…
| Parameter | Type | Description |
|---|---|---|
plan_id * | string | Plan ID returned by plan_cleanup (for example "20261114054412-c4ad79"). |
read_file
Read a file from the MemDrive memory library. TOTAL RESPONSE BUDGET — THREE LIMITS ON THREE DIFFERENT LAYERS. (1) HOST: the MCP host rejects a whole tool result over about 1 MB ("Tool result is too large. Maximum size is 1MB"), a host limit outside this server and separate from the model context window. (2) SERVER: text bytes plus base64 image bytes in one response must fit a single total budget — default 950,000 bytes, overridable with MEMDRIVE_RESPONSE_BUDGET_BYTES (clamped to 100,000–50,000,000). Text is guaranteed first; images share what remains and are downscaled in memory (trying…
| Parameter | Type | Description |
|---|---|---|
path * | string | File to read, relative to the library root (for example "notes/2026-10-28.md"). |
include_images | boolean | For Markdown files: true (default) returns the text together with its referenced images, within the total response budget; false returns text only plus the list of referenced image paths (step 1 of tw… |
open_image
Open an image file from the MemDrive memory library in the operating system's default image viewer (Photos on Windows/macOS, the default viewer on Linux), at full original quality. USE ONLY WHEN THE USER EXPLICITLY ASKS TO VIEW THE ORIGINAL IMAGE — for example "open this image", "show me the original", or "在系统里打开这张图". NEVER call open_image automatically after a read_file, a save_file, or any other tool call, and never open an image the user has not asked to view. Opening a viewer window is a visible side effect on the user's screen; the model must not cause it unprompted. T…
| Parameter | Type | Description |
|---|---|---|
path * | string | Image file to open, relative to the library root (for example "notes/assets/shot-20261028-120000-000.png"). Only call this when the user explicitly asked to view the original image. |
open_containing_folder
Open the folder containing a file or directory from the MemDrive memory library in the operating system's file manager (Explorer on Windows, Finder on macOS, the default file manager on Linux). A file opens its parent folder; a folder opens itself; an empty path opens the whole library root. The folder is opened without highlighting or selecting any file. USE ONLY WHEN THE USER EXPLICITLY ASKS TO OPEN THE FOLDER — for example "open the folder", "show me this note in the file manager", or "在系统里打开这个笔记所在的文件夹". NEVER call open_containing_folder automatically after…
| Parameter | Type | Description |
|---|---|---|
path | string | File or folder whose containing folder to open, relative to the library root (for example "notes/2026-10-28.md" opens "notes"). Omit or pass "" to open the library root. Only call this when the user e… |