Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ me memory create "Auth uses bcrypt with cost 12" --tree design.auth
# Search by meaning + keywords
me memory search "how does authentication work"

# Connect to your AI tools (Claude Code, Gemini, Codex, OpenCode)
me mcp install
# Connect to your AI tools
me opencode install
me codex install
me gemini install

# Claude Code uses the Memory Engine plugin
claude plugin marketplace add timescale/memory-engine
claude plugin install memory-engine@memory-engine
```

## How it works
Expand Down
8 changes: 6 additions & 2 deletions docs/agents.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ docs: https://docs.memory.build

# MCP server
mcp:
install: me mcp install
description: Memory engine ships as an MCP server. Install it and your AI tools get memory without any integration work.
install:
opencode: me opencode install
codex_cli: me codex install
gemini_cli: me gemini install
claude_code: claude plugin marketplace add timescale/memory-engine && claude plugin install memory-engine@memory-engine
description: Memory engine ships as an MCP server. OpenCode, Codex CLI, and Gemini CLI use agent-specific install commands. Claude Code uses the Memory Engine plugin.
compatible_clients:
- Claude Code
- Codex CLI
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/me-claude.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ me claude hook --event <name>
This command is not run directly -- the Claude Code plugin calls it. The plugin is installed via Claude Code's native flow:

```bash
claude plugin marketplace add <source>
claude plugin marketplace add timescale/memory-engine
claude plugin install memory-engine@memory-engine [--scope user|project|local]
# then, in a Claude Code session:
/plugin # select memory-engine, Configure, fill api_key/server/tree_prefix
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/me-codex.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ me codex install [options]

If no `--api-key` or `--server` is provided, values are resolved from `~/.config/me/credentials.yaml` (set by `me login` and `me engine use`).

This is equivalent to `me mcp install codex` -- see [me mcp](me-mcp.md) for the multi-tool installer.
For manual MCP client configuration, see [MCP Integration](../mcp-integration.md).

---

Expand Down
2 changes: 1 addition & 1 deletion docs/cli/me-gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ me gemini install [options]

If no `--api-key` or `--server` is provided, values are resolved from `~/.config/me/credentials.yaml` (set by `me login` and `me engine use`).

This is equivalent to `me mcp install gemini` -- see [me mcp](me-mcp.md) for the multi-tool installer.
For manual MCP client configuration, see [MCP Integration](../mcp-integration.md).
49 changes: 15 additions & 34 deletions docs/cli/me-mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ The `me mcp` command runs Memory Engine as a [Model Context Protocol](https://mo
## Commands

- [me mcp](#me-mcp-1) -- run the MCP server
- [me mcp install](#me-mcp-install) -- register with AI tools

---

Expand All @@ -25,44 +24,26 @@ me mcp [options]

The server URL is resolved from `--server` (global option) > `ME_SERVER` env > `https://api.memory.build`.

This command is typically not run directly -- it is invoked by AI tools (Claude Code, Gemini CLI, etc.) based on the MCP configuration created by `me mcp install`.
This command is typically not run directly -- it is invoked by AI tools based on their MCP configuration.

---

## me mcp install
## Installation

Register `me` as an MCP server with AI tools.
MCP registration lives under agent-specific commands:

```
me mcp install [tools...] [options]
```

| Argument | Required | Description |
|----------|----------|-------------|
| `tools...` | no | Tool names to install (default: all detected). |

| Option | Description |
|--------|-------------|
| `--api-key <key>` | API key to embed in the MCP config. |
| `--server <url>` | Server URL to embed in the MCP config. |
| Tool | Command |
|------|---------|
| OpenCode | [`me opencode install`](me-opencode.md#me-opencode-install) |
| Codex CLI | [`me codex install`](me-codex.md#me-codex-install) |
| Gemini CLI | [`me gemini install`](me-gemini.md#me-gemini-install) |
| Claude Code | [`me claude`](me-claude.md) plugin hooks |

Detects installed AI tools on your PATH and registers `me` as an MCP server with each one. Supported tools:
Claude Code uses the Memory Engine plugin instead of MCP registration through the `me` CLI:

| Tool | Binary | Method |
|------|--------|--------|
| Claude Code | `claude` | `claude mcp add` |
| Gemini CLI | `gemini` | `gemini mcp add` |
| Codex CLI | `codex` | `codex mcp add` |
| OpenCode | `opencode` | Edits `~/.config/opencode/opencode.json` |

If no `--api-key` or `--server` is provided, values are resolved from `~/.config/me/credentials.yaml` (set by `me login` and `me engine use`).

### Example

```bash
# Install for all detected tools using stored credentials
me mcp install

# Install for Claude Code only with explicit credentials
me mcp install claude --api-key me.xxx --server https://api.memory.build
```
claude plugin marketplace add timescale/memory-engine
claude plugin install memory-engine@memory-engine [--scope user|project|local]
```

Then start Claude Code, run `/plugin`, select `memory-engine`, and configure `api_key`, `server`, and `tree_prefix`.
2 changes: 1 addition & 1 deletion docs/cli/me-opencode.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ me opencode install [options]

If no `--api-key` or `--server` is provided, values are resolved from `~/.config/me/credentials.yaml` (set by `me login` and `me engine use`).

This is equivalent to `me mcp install opencode` -- see [me mcp](me-mcp.md) for the multi-tool installer.
For manual MCP client configuration, see [MCP Integration](../mcp-integration.md).

---

Expand Down
17 changes: 14 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,24 @@ Starts a local web UI on `http://127.0.0.1:3000` (or the next free port) with a

## Connect to AI tools

Register Memory Engine as an MCP server with your AI coding tools:
Register Memory Engine with your AI coding tools:

```bash
me mcp install
me opencode install
me codex install
me gemini install
```

This auto-detects Claude Code, Gemini CLI, Codex CLI, and OpenCode on your PATH and registers `me` with each one. After installation, your AI agent has access to 10 memory tools -- create, search, get, update, delete, and more.
For Claude Code, install the Memory Engine plugin instead:

```bash
claude plugin marketplace add timescale/memory-engine
claude plugin install memory-engine@memory-engine
```

Then start Claude Code, run `/plugin`, select `memory-engine`, and configure `api_key`, `server`, and `tree_prefix`.

After installation, your AI agent has access to memory tools -- create, search, get, update, delete, and more.

See [MCP Integration](mcp-integration.md) for details.

Expand Down
43 changes: 29 additions & 14 deletions docs/mcp-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,61 @@ You need an API key. Run `me whoami` to see your active engine, or create an API

The server defaults to `https://api.memory.build`. Pass `--server <url>` only if you're running a self-hosted engine.

### Automatic
### Agent-specific installers

```bash
me mcp install
me opencode install
me codex install
me gemini install
```

This detects AI tools on your PATH and registers Memory Engine with each one. It reads your API key and server URL from the credentials file and bakes them into each tool's MCP configuration, so the `me mcp` process can authenticate without the credentials file.
These commands register Memory Engine with the named tool. They read your API key and server URL from the credentials file and bake them into the tool's MCP configuration, so the `me mcp` process can authenticate without the credentials file.

See [`me mcp install`](cli/me-mcp.md) for the full command reference.
See the agent-specific command references for details: [`me opencode install`](cli/me-opencode.md#me-opencode-install), [`me codex install`](cli/me-codex.md#me-codex-install), and [`me gemini install`](cli/me-gemini.md#me-gemini-install).

| Tool | Detection |
|------|-----------|
| Claude Code | `claude` binary |
| Gemini CLI | `gemini` binary |
| Codex CLI | `codex` binary |
| OpenCode | `opencode` binary |
| Tool | Install command |
|------|-----------------|
| OpenCode | `me opencode install` |
| Codex CLI | `me codex install` |
| Gemini CLI | `me gemini install` |
| Claude Code | Claude Code plugin, described below |

### Claude Code

```bash
claude mcp add --scope user me -- me mcp --api-key <key> --server <url>
claude plugin marketplace add timescale/memory-engine
claude plugin install memory-engine@memory-engine [--scope user|project|local]
```

This registers `me` as a user-scoped MCP server. Claude Code will start the `me mcp` process automatically in every conversation.
Claude Code uses the Memory Engine plugin. After installing it, start a Claude Code session, run `/plugin`, select `memory-engine`, and configure `api_key`, `server`, and `tree_prefix`. The plugin provides the MCP server and captures Claude Code session events as memories.

### Gemini CLI

```bash
me gemini install
```

To configure manually:

```bash
gemini mcp add --scope user me me mcp --api-key <key> --server <url>
```

### Codex CLI

```bash
me codex install
```

To configure manually:

```bash
codex mcp add me -- me mcp --api-key <key> --server <url>
```

### OpenCode

`me mcp install` edits `~/.config/opencode/opencode.json` directly, adding an entry under `mcp.me`. To configure manually, add this to that file:
`me opencode install` edits `~/.config/opencode/opencode.json` directly, adding an entry under `mcp.me`. To configure manually, add this to that file:

```json
{
Expand Down Expand Up @@ -193,7 +208,7 @@ me_memory_search({tree: "design.*"})

1. Verify the `me` binary is on your PATH: `which me`
2. Test the server directly: `echo '{}' | me mcp --api-key <key> --server <url>`
3. Re-install: `me mcp install`
3. Re-install with the agent-specific command, for example `me opencode install`, `me codex install`, or `me gemini install`. For Claude Code, open `/plugin` and reconfigure `memory-engine`.

### Agent can't find memories

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/commands/claude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Just one subcommand: `me claude hook --event <name>`. The plugin itself
* is installed via Claude Code's native flow:
*
* claude plugin marketplace add <source> # register marketplace
* claude plugin marketplace add timescale/memory-engine
* claude plugin install memory-engine@memory-engine [--scope user|project|local]
* # then, in a Claude Code session:
* /plugin # select memory-engine, Configure, fill api_key/server/tree_prefix
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/commands/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* Does NOT use the credentials file. API key must be provided
* via --api-key or ME_API_KEY env var.
*
* MCP registration with individual AI tools has moved to per-agent commands:
* me claude install, me opencode install, me gemini install, me codex install
* MCP registration with individual AI tools lives in per-agent commands:
* me opencode install, me gemini install, me codex install
* Claude Code uses the Memory Engine plugin instead of a CLI installer.
*/
import { Command } from "commander";
import { runMcpServer } from "../mcp/server.ts";
Expand Down