> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memex.garden/llms.txt
> Use this file to discover all available pages before exploring further.

# Memex plugin

> Install the Memex plugin and connect it to Memex Garden

# Memex Plugin

This is the Memex plugin for [Memex.Garden](https://memex.garden), a bookmarking second brain for humans and agents.

You can save, transcribe, summarize and search anything you come across. Websites, notes, web highlights, YouTube, X, TikTok, Instagram, PDFs, Reddit or images. Here is our [Privacy Policy](https://memex.garden/privacy/) and our [docs](https://docs.memex.garden).

## How to install

1. [Download](https://github.com/WorldBrain/memex-codex/raw/main/memex-codex.zip) the plugin
2. Extract the zip, or clone this repo and use it directly.
3. Start Codex from the extracted directory or repo root.
4. Open Codex's plugin directory.
5. Select the `Memex Plugins` marketplace.
6. Install `Memex`.
7. Connect Memex when your client prompts for authentication.
8. You're done. You can now use Memex from your agent.

The plugin uses only the hosted Memex MCP with OAuth. No local companion process or Node.js installation is required.

## Example prompts

1. `Search my Memex library for pages about MCP authentication and summarize the top results.`
2. `Save https://docs.memex.garden/general/authentication into Memex, and tag it with #tutorials`

## Handoff command

The plugin exposes a dedicated slash command for unprocessed handoffs:

```text theme={null}
/memex:fetch-handoffs
```

That command discovers the cloud-side handoff-listing action and invokes it
through `read_action`. It fetches pending handoffs by default, resolves the
saved Codex project for each handoff, and creates one fresh task per handoff.
The coordinator never performs or drains the handoff itself. Each created task
owns only its handoff and drains it after the requested work is complete.

## Authentication

The default hosted Memex MCP endpoint is:

* `https://memex.garden/api/mcp`

Authentication is OAuth-first. When the plugin calls Memex for the first time,
your client should start the Memex sign-in flow. OAuth clients should register
as `Memex Codex plugin` and, when custom registration metadata is supported,
include `memex_client_source: "memex_codex_plugin"` so Memex can show the
connection as this plugin rather than a generic Codex cloud agent. In Codex
CLI, use:

```bash theme={null}
codex mcp login memex
```

After signing in, start a new thread so the refreshed MCP session and plugin
skills are available.

Advanced fallback: if OAuth is unavailable in your client, export credentials
before launching the agent.

Bearer token mode:

```bash theme={null}
export MEMEX_BEARER_TOKEN="YOUR_OAUTH_ACCESS_TOKEN"
```

You can also use an API key:

```bash theme={null}
export MEMEX_API_KEY="YOUR_MEMEX_API_KEY"
export MEMEX_USER_ID="YOUR_MEMEX_USER_ID"
```

Endpoint override:

```bash theme={null}
export MEMEX_MCP_URL="https://memex.garden/api/mcp"
```

Local backend example:

```bash theme={null}
npm run dev:mcp-proxy
export MEMEX_MCP_URL="http://localhost:8787/mcp"
```

Auth precedence:

* OAuth is the default path when supported by the client
* `MEMEX_BEARER_TOKEN` is the first fallback when present
* otherwise the MCP server may use `MEMEX_API_KEY`
* `MEMEX_USER_ID` is optional
* `MEMEX_MCP_URL` defaults to `https://memex.garden/api/mcp`

Auth docs:

* [Authentication](https://docs.memex.garden/general/authentication.md)

If a client asks for the raw MCP server URL, use
`https://memex.garden/api/mcp` for production or `http://localhost:8787/mcp`
for local development.

## Docs

* The plugin invokes discovered handoff-listing actions through `read_action` and handoff-draining actions through `write_action`.
* Handoff command: `/memex:fetch-handoffs`
* [Available endpoints](https://docs.memex.garden/general/available-endpoints.md)
* [Response shape](https://docs.memex.garden/general/response-shape.md)
* [Buy credits](https://docs.memex.garden/general/buy-credits.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.