Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MEMDRIVE_ROOTNoThe library root folder. Defaults to ~/memdrive (created automatically). Point it at a folder your sync client already manages (e.g. a Google Drive / OneDrive / iCloud folder).~/memdrive
MEMDRIVE_RESPONSE_BUDGET_BYTESNoTotal response budget for one read_file response (text bytes + base64 bytes of all image blocks), default 950,000, clamped to 100,000–50,000,000. Raise only if your client demonstrably accepts larger tool results than Claude Desktop's ~1 MB ceiling.950000

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_directoryA

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.

search_filesA

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/date_to (file date: front matter > filename > modification time; a date-only upper bound covers the whole day), modified_after/modified_before (modification time). exact_phrase requires the phrase to appear verbatim. diagnostics_only returns a read-only library report (empty files, duplicate content, broken image references, unreferenced attachments older than 24h) and never modifies anything; keyword is not needed for it. rebuild_index forces a full index rebuild first (use after a bulk import or a cache clear). On the first search after startup the index may still be building in the background; the result then says so and falls back to a direct scan (keyword, path, and file types only — tags, dates, and exact_phrase are not applied there, and the result says so). Paths are relative to the library root (MEMDRIVE_ROOT). Omit path or pass "" to search the whole library. Files under the top-level archive/ folder are excluded from search_files — whole-library search and an explicit path: "archive" search both return nothing for them — while list_directory still shows archive/ so archived files remain inspectable.

save_fileA

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 text. If the clipboard holds no image, the server reports that in the result and the text is still saved — tell the user to take the screenshot again and retry; do not invent a clipboard failure. Interaction rule — read before calling: Before calling this tool, show the user the EXACT destination path and filename you intend to write (for example: "notes/2026-10-28.md") and get their explicit confirmation in the chat. Never call save_file with a path or filename the user has not confirmed. If the user has not confirmed a location yet, ask them first instead of calling. There is no popup or confirmation dialog: confirmation happens here, in the conversation, through you. Save text (usually Markdown) into the MemDrive memory library. Modes: "new" (default) fails when the file already exists; "overwrite" replaces it; "append" adds to the end, creating the file when missing. Parent directories are created automatically. Tags: two syntaxes are supported — YAML front matter tags: (inline [a, b] or block - a) and body #tag. Proactively suggest adding tags ONLY in these three cases: (1) the user mentions a category or topic while saving (e.g. saving a work plan); (2) the note clearly belongs to a tag already used in the library; (3) the user saves several notes on the same topic in a row (ask once, e.g. whether to tag all of them X). NEVER ask about tags for quick screenshot/clipboard saves, when the user only said "save it" with no topic signal, or after you already asked once in this conversation and the user ignored it or said no. When the user explicitly asks to save with tags, just save with those tags — none of the rules above apply. If the tool result includes a Tip: line about tagging, you MUST say that tip to the user. Images: pass an "images" array with any mix of the literal string "clipboard" (capture the latest screenshot from the OS clipboard — see the clipboard rule above), local file paths, or http(s) image URLs. Images are copied/downloaded/captured into a sibling assets/ folder, renamed "-.", and for Markdown files a standard image reference is appended to the document automatically. The on-disk original is always kept at full quality; only the preview handed to a model is ever downscaled. Clipboard behavior: when the clipboard is empty or holds text instead of an image, the text is still saved and the result explains what to do (re-screenshot). Clipboard capture never crashes the server; in headless environments it reports itself as unsupported and suggests a file path or URL instead. 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. Path cleaning: surrounding quotes are stripped, a leading ~ expands to the home directory, and separators are normalized.

edit_tagsA

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 #tags. 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 appends #tag on its own line at the end of the file. No-ops are not errors: adding a tag that is already there, removing one that is not there, and renaming to a name that already exists all succeed with a "No change" result. Tag names are case-insensitive. The search index is updated at once, so the note is searchable by its new tags immediately. 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.

archive_fileA

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 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.

restore_fileA

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.

plan_cleanupA

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-.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. Similar content is never proposed — only exact SHA-256 duplicates. This tool never modifies any file.

apply_planA

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 ID that does not exist or is malformed is reported, and nothing is changed. The search index is refreshed incrementally after execution, so the next search reflects the change. A plan that has been executed is retired; running it again reports that it was already applied. Use this when the user asks to execute a plan in chat (for example "执行这个清理计划"). The command-line memdrive-mcp apply <plan-id> does the same thing from a terminal. Never call this tool automatically right after plan_cleanup. Always show the user the plan preview and plan ID first and wait for their explicit confirmation in the chat before calling.

read_fileA

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 higher JPEG quality before shrinking dimensions) or skipped with a note so a read never fails over an image and the file on disk is never modified. read_file returns a preview that fits the budget; to view the original image on disk, use open_image (only when the user asks). (3) MODEL: the model converts image pixels into tokens under its own limits, unrelated to the byte limits above. TWO-STEP READING — USE THIS WHENEVER A DOCUMENT REFERENCES SEVERAL IMAGES, OR ONE LARGE IMAGE: Step 1, call read_file with include_images=false to read the text and get the list of referenced image paths. Step 2, call read_file once per referenced image, passing that image path itself as path, so the image alone gets the whole response budget and keeps the best quality the budget allows. Reading an image file directly is also limited by the same total budget: a single image is returned untouched when it fits, and downscaled in memory only when the image itself exceeds the budget. Text files: returned as text (truncated at the smaller of the 1 MB text cap and the total budget, with a note when truncated). Markdown files: with include_images=true (the default), the text is returned TOGETHER WITH every locally-referenced image that fits the remaining budget in the same response — each image becomes an image content block, so the model sees words and pictures together. Remote (http) and data: images are skipped with a note. Images over the 3.5 MB preview cap are downscaled in memory only; the file on disk is never modified. Image files: returned as a single image content block (downscaled in memory only when over the preview cap or the total budget). If an image cannot be fitted within the budget at all, the result is text explaining that, not an error — the original is untouched. SVG files are returned as text (they are XML), never as image blocks. Paths are relative to the library root (MEMDRIVE_ROOT). Absolute paths are accepted only when they stay inside the root.

open_imageA

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. The image itself is never returned to the model: the result is only a short text confirmation (or a note when no viewer is available, for example on a headless machine). To see the picture in the conversation, use read_file on the image path instead. Only image files inside the library root can be opened. Non-image files, directories, missing files, and paths escaping the root are rejected with a note. The file on disk is never modified. Paths are relative to the library root (MEMDRIVE_ROOT). Absolute paths are accepted only when they stay inside the root.

open_containing_folderA

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 a read_file, a save_file, or any other tool call, and never open a folder the user has not asked to open. Opening a file manager window is a visible side effect on the user's screen; the model must not cause it unprompted. The folder contents are never returned to the model: the result is only a short text confirmation naming the folder that was opened (or a note when no file manager is available, for example on a headless machine). To see what is in the folder, use list_directory instead. Only paths inside the library root can be opened. Missing paths and paths escaping the root are rejected with a note. Nothing is modified. Paths are relative to the library root (MEMDRIVE_ROOT). Absolute paths are accepted only when they stay inside the root.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.3/5.0

Scored across 11 tools

Disambiguation4/5

Each tool targets a distinct resource+action pair (list/read/save/search/archive/restore/tag/plan/apply/open), and the descriptions actively steer the agent away from confusion, e.g. read_file vs open_image and open_containing_folder vs open_image are explicitly contrasted. The only mild overlap is between the two OS-side-effect 'open' tools, which differ by target type but both open windows; still, boundaries are clear.

Naming Consistency5/5

All 11 tools use snake_case verb_noun form: list_directory, save_file, read_file, search_files, edit_tags, archive_file, restore_file, plan_cleanup, apply_plan, open_image, open_containing_folder. No camelCase or mixed verb styles; the plan_cleanup/apply_plan pair even reads as an intentional two-phase naming scheme.

Tool Count5/5

11 tools for a memory library covering CRUD, search, tagging, archival, and cleanup is well-scoped and squarely in the 3-15 sweet spot. Every tool earns its place: no redundant variants, no thin single-tool surface.

Completeness4/5

Coverage is strong: create/read/overwrite/append, search, list, tag editing, archive/restore lifecycle, plus a safe plan/apply cleanup flow. Gaps are minor but real — there is no rename/move tool and no explicit delete (intentional, archive is the substitute), so a rename requires read+save+archive workarounds.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues