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)
- Open Settings → Connectors → Add custom connector.
- Name it
Memexand pastehttps://app.openmemex.dev/mcpas the URL. - Click Connect. The Memex consent screen opens: tick the folders, approve.
- 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/mcpThen 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.
Each client has its own page in the docs, with how to check that it worked: Claude, Claude Code, Cursor, other MCP clients. If authorising answers "You do not have permission to do this", see Troubleshooting.
The consent screen: permissions per folder
The consent screen is where you decide what the assistant may touch. You tick the brains and folders to share and choose, for each one, whether the assistant may only read or also edit. A separate box controls whether it may create new brains.
- Never more than you. An assistant acts for the person who approved it. Its effective right on a folder is the lower of your current right and the limit chosen at consent, evaluated at each request. If you lose access to a folder, so does your assistant, at the same moment.
- What is not shared does not exist. Folders you did not tick are absent from listings and from the results of both search tools, do not influence ranking, and answer "not found" when read, exactly like a path that really does not exist.
- No administration. A connected assistant cannot change who has access to what, manage members or delete a brain, even when you are an owner or an administrator.
- Read-only connections. If you approved the connection without write access, every writing tool answers with a permission error.
Reference: Permissions and consent.
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.
| Tool | What it does |
|---|---|
list_brains | Brains the assistant can access, with its permission level and the number of readable files. |
create_brain | Creates a new, empty brain owned by the user. Refused unless Can create new brains was ticked on the consent screen. |
list_directory | Folders and files under a folder, optionally recursive, with size, hash and last change. |
read_note | Text of a note with its content hash, last modification time and author. |
write_note | Creates a note or replaces its whole content. With expected_hash, the write is refused if the note changed since it was read. |
edit_note | Replaces an exact piece of text. The text must occur exactly once unless replace_all is set. |
append_note | Adds text at the end of a note; creates the note if it does not exist. |
move_path | Moves or renames a note or a folder. |
delete_path | Deletes a note, or a folder and everything in it. |
create_folder | Creates an empty folder. |
search | Full-text search: path, title and a plain-text excerpt. |
semantic_search | Search by meaning, across languages: path, title, the most relevant passage and a similarity score. Available where semantic search is enabled. |
get_links | Outgoing links, backlinks and unresolved wiki links of a note. |
recent_changes | Latest 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.
Every tool with its arguments: MCP tools.
Safeguards when an assistant writes
edit_noteandappend_noteonly 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_noterefuses binary files and notes larger than 1 MiB; the assistant is told to usesearchinstead.- Deleted or overwritten notes stay in the history of the brain and can be restored from the web interface.
semantic_searchruns 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.