Connect your AI assistant to Memex

Memex speaks the Model Context Protocol (MCP). An AI assistant such as Claude connects to one endpoint, you approve it on a consent screen where you choose the folders it may read or edit, and it then searches, reads and writes your notes on your behalf, with exactly the rights you gave it and never more than your own.

One endpoint

The MCP endpoint of a Memex instance is its address followed by /mcp. For the hosted service:

https://app.openmemex.dev/mcp
  • Transport: MCP streamable HTTP. The endpoint is stateless and answers each request with a plain JSON body.
  • Authentication: OAuth 2.1 bearer tokens. The client discovers the authorisation server by itself; you never copy a token by hand.
  • Use the address without a trailing slash. On a self-hosted instance, replace the host with your own.

Connecting a client

The flow is the same in every client: you give it the address, it opens a browser window on Memex, you sign in and land on the consent screen.

Claude (claude.ai and Claude Desktop)

  1. Open Settings → Connectors → Add custom connector.
  2. Name it Memex and paste https://app.openmemex.dev/mcp as the URL.
  3. Click Connect. The Memex consent screen opens: tick the folders, approve.
  4. In a conversation, enable the connector from the tools menu.

For claude.ai the Memex instance must be reachable from the internet, because the requests come from the assistant’s servers and not from your browser.

Claude Code

claude mcp add --transport http memex https://app.openmemex.dev/mcp

Then run /mcp inside Claude Code and choose Authenticate to go through the consent screen.

Cursor

Add the server to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project:

{
  "mcpServers": {
    "memex": {
      "url": "https://app.openmemex.dev/mcp"
    }
  }
}

Cursor shows a Needs login button next to the server; it opens the consent screen.

Other clients

Any client that supports streamable HTTP with OAuth works the same way. Clients limited to stdio servers can go through a bridge such as mcp-remote.

The tools an assistant gets

Every tool except list_brains and create_brain takes a brain argument (its id or slug). Paths are relative to the root of the brain, for example Clients/Martin/brief.md.

ToolWhat it does
list_brainsBrains the assistant can access, with its permission level and the number of readable files.
create_brainCreates a new, empty brain owned by the user. Refused unless Can create new brains was ticked on the consent screen.
list_directoryFolders and files under a folder, optionally recursive, with size, hash and last change.
read_noteText of a note with its content hash, last modification time and author.
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. 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.
move_pathMoves or renames a note or a folder.
delete_pathDeletes a note, or a folder and everything in it.
create_folderCreates an empty folder.
searchFull-text search: path, title and a plain-text excerpt.
semantic_searchSearch by meaning, across languages: path, title, the most relevant passage and a similarity score. Available where semantic search is enabled.
get_linksOutgoing links, backlinks and unresolved wiki links of a note.
recent_changesLatest changes in a brain: path, operation, author, interface, AI client and time.

Results are small JSON objects. 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, for example by reading the note again.

Safeguards when an assistant writes

  • 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 not overwritten.
  • read_note refuses binary files and notes larger than 1 MiB; the assistant is told to use search instead.
  • Deleted or overwritten notes stay in the history of the brain and can be restored from the web interface.
  • semantic_search runs entirely on the Memex server: the query and the notes are not sent to an embedding service.

Attribution: who changed what, and with which AI

Each change made by an assistant is recorded in the history with three facts: the user it acted for, the interface (mcp) and the name of the AI client. The history view compares any two versions of a note and restores an earlier one. When a note looks wrong, you can see whether a colleague or an assistant wrote the sentence, and undo it.

Revocation

Open Settings → Connected AIs in Memex to see every connected client, what it may access and when it was last used. Revoking a client is immediate: its next request is refused.

Under the hood, each client holds its own credentials. Access tokens last one hour and refresh tokens thirty days, rotating at each use; reusing a refresh token or an authorisation code revokes the whole connection, as OAuth 2.1 requires. Tokens are stored on the server only as hashes.

The full reference is in the product documentation: connecting AIs over MCP. For the security model behind it, see Security and privacy.