Documentation menu

Connecting AI assistants

MCP tools

A connected assistant gets fourteen tools. Every tool except list_brains and create_brain takes a brain argument, the id of the brain or its slug. Paths are relative to the root of the brain and use /, for example Clients/Martin/brief.md.

Finding your way

ToolWhat it does
list_brainsBrains the assistant can access: id, slug, name, its permission level and the number of readable files.
list_directoryFolders and files under a folder (path, default: the root; recursive, default: false), with size, hash, last change and permission level.
get_linksOutgoing links, backlinks and unresolved wiki links of a note.
recent_changesLatest changes in a brain (limit, default 20): path, operation, author, interface, AI client and time (UTC).

Writing

ToolWhat it does
write_noteCreates a note or replaces its whole content. With expected_hash, the write is refused if the note changed since it was read.
edit_noteReplaces an exact piece of text (old_text → new_text). The text must occur exactly once unless replace_all is set.
append_noteAdds text at the end of a note; creates the note if it does not exist.
create_folderCreates an empty folder and its missing parents.
move_pathMoves or renames a note or a folder. Fails if something already exists at the destination. Wiki links pointing to the moved notes are not rewritten.
delete_pathDeletes a note, or a folder and everything in it; returns the number of files deleted.
create_brainCreates a new, empty brain (name) owned by the user, and opens it to the assistant with read and write access. Refused unless the user ticked Can create new brains on the consent screen.

Safeguards

  • edit_note and append_note only write if the note is still the version they read, and retry once otherwise, so a simultaneous edit by a person is never overwritten.
  • read_note refuses binary files and notes larger than 1 MiB; the assistant is told to use search instead.
  • semantic_search runs entirely on the Memex server: the query and the notes are not sent to any embedding service.
  • Deleted or overwritten notes stay in the history of the brain and can be restored from the web app.
  • When something goes wrong (note not found, no permission, conflict, no match for an edit) the tool returns an error message the assistant can read and react to.
  • On a connection approved without write access, every writing tool answers with a permission error.

What the assistant may reach with these tools is decided on the consent screen: see Permissions and consent. Reference: mcp.md.