Memory for Cursor, Codex and other MCP clients

Give Cursor, Codex, Gemini CLI or any MCP client a long-term memory shared with your other agents: one setup command each, or a config block for the rest.

On this page

Memorinth gives Cursor, Codex, Gemini CLI and any other tool that speaks MCP the same long-term memory, kept as Markdown files in one cortex on your disk. Connect Cursor, Codex and Gemini CLI with memorinth setup <agent>, or all at once with memorinth init. Any other MCP client gets the memory tools from a few lines of config. Every connected agent reads and writes the same cortex, so what Codex learned this morning, Cursor knows this afternoon.

Agent Connect it with What it gets
Claude Code memorinth setup claude-code Memory tools, briefing and save-reminder hooks, skills
Codex memorinth setup codex Memory tools, a session-start hook, skills
Cursor memorinth setup cursor Memory tools, a session-start hook, skills
Gemini CLI memorinth setup gemini Memory tools, a session-start hook, skills
Any other MCP client A config block with memorinth mcp serve Memory tools only

Before you start

Install the memorinth command (Install the CLI), or the app, which includes it. Then make a cortex and connect every agent installed on this computer in one go:

$ memorinth init

init lists the agents it finds and asks which to connect. The rest of this page is for connecting them one at a time.

Cursor

$ memorinth setup cursor

It adds the MCP server to ~/.cursor/mcp.json and a sessionStart hook to ~/.cursor/hooks.json, so each session starts with the briefing. It applies to every project you open in Cursor.

Codex

$ memorinth setup codex

It adds the MCP server with codex mcp add, in ~/.codex/config.toml, and the hooks in ~/.codex/hooks.json.

Gemini CLI

$ memorinth setup gemini

It adds the MCP server under mcpServers, and a SessionStart hook under hooks, in ~/.gemini/settings.json.

setup needs a cortex chosen first. If you skipped init, pass one: memorinth setup cursor --cortex ~/Memorinth. Connect one agent has every file each agent’s setup changes.

Any other MCP client

Tools that setup doesn’t know take Memorinth’s server in their MCP settings. Most use a block like this:

mcp.json
{
  "mcpServers": {
    "memorinth": {
      "command": "memorinth",
      "args": ["mcp", "serve", "--client", "my-tool"]
    }
  }
}

The server talks over stdio and reads the cortex agents use when a session starts. --client names the agent: what it writes is marked source: agent:my-tool, and memorinth usage counts its calls under that name. --cortex <path> serves another cortex. Some tools name the top-level key differently; check where your tool keeps its MCP servers.

A tool connected this way has no hooks, so nothing hands it the briefing. Tell it to call wake_up first, in whatever instructions file it reads:

AGENTS.md
At the start of a session, call the memorinth `wake_up` tool for the
briefing. Search memory before answering questions about past work, and
save what's worth keeping with write_memory, record_decision and add_fact.

Any MCP client has the server’s options, and MCP tools lists every tool.

One memory, many agents

All of them write to the same three folders and read the same notes:

  • memory/ for what was learned, decisions/ for what was decided and why, facts/ for stable claims with a source.
  • Each note says who wrote it, such as source: agent:codex or source: agent:cursor.
  • Writes go through one engine on your computer, so two agents saving at once never step on each other.

To use one cortex per project instead of one for everything, see One cortex or many.

Check them all

$ memorinth doctor

It shows, for each agent, whether it has the server, the hooks and the skills, which memorinth it runs, and what to fix. Start a new session in each agent after connecting it: sessions already open don’t pick up a new MCP server.

To take Memorinth out of every agent at once, run memorinth agents off; memorinth agents on connects them again.

Updated