Documentation

Wire memory into your agent.

Memexa exposes 20 tools over the MCP protocol. No code to write — paste a config into your agent and it’s connected.

Get started

Quickstart

  1. 1
    Create an account
    Sign up and create a project. An API key is generated.
  2. 2
    Grab key + project
    Copy your API key (API Keys) and the project ID (project page).
  3. 3
    Paste the config
    Add the MCP block to your agent (below), then restart it.
MCP

Install per agent

Replace the values memexa_sk_prod_••• and your-project-id.

Cursor .cursor/mcp.json
mcp.json
{
  "mcpServers": {
    "memexa": {
      "command": "npx",
      "args": ["-y", "@memexa/mcp-server"],
      "env": {
        "MEMEXA_API_KEY": "memexa_sk_prod_•••",
        "MEMEXA_API_URL": "https://api.memexa.tech/v1",
        "MEMEXA_PROJECT_ID": "your-project-id"
      }
    }
  }
}
Claude Code CLI
macOS / Linux bash · zsh
terminal
claude mcp add memexa --env MEMEXA_API_KEY=memexa_sk_prod_••• --env MEMEXA_API_URL=https://api.memexa.tech/v1 --env MEMEXA_PROJECT_ID=your-project-id -- npx -y @memexa/mcp-server
Windows PowerShell
PowerShell
claude mcp add-json memexa '{"command":"npx","args":["-y","@memexa/mcp-server"],"env":{"MEMEXA_API_KEY":"memexa_sk_prod_•••","MEMEXA_API_URL":"https://api.memexa.tech/v1","MEMEXA_PROJECT_ID":"your-project-id"}}'

On PowerShell the “--” separator is swallowed by the shell, so use add-json (a single JSON argument, nothing to mangle).

opencode opencode.json
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "memexa": {
      "type": "local",
      "command": ["npx", "-y", "@memexa/mcp-server"],
      "enabled": true,
      "env": {
        "MEMEXA_API_KEY": "memexa_sk_prod_•••",
        "MEMEXA_API_URL": "https://api.memexa.tech/v1",
        "MEMEXA_PROJECT_ID": "your-project-id"
      }
    }
  }
}

Any MCP-compatible client works with the mcpServers block above.

ENV

Environment variables

MEMEXA_API_KEYreq
Your API key. From the dashboard → API Keys.
MEMEXA_API_URLreq
The API URL. Use https://api.memexa.tech/v1.
MEMEXA_PROJECT_IDreq
Project ID. From the project page.
MEMEXA_AGENTopt
Agent label shown in activity (e.g. cursor, claude-code).
Model

Concepts

Context entry
A decision, bug, convention or progress snapshot. Versioned, queryable.
Snapshot / commit
Aggregated, immutable state of a session, shown in the graph.
Proposal (PR)
A suggested change to an entry, pending approval.
Contradiction
Two entries that semantically conflict.
Tools

Session & context

get_context
Restores the compressed, relevant project context at session start.
update_context
Updates context at session end: decisions, bugs, progress.
get_project_status
Quick summary of the project state.
validate_context
Analyzes context coherence and returns a health report.
get_insights
Pre-computed insights: patterns, health score, alerts, trajectory.
get_contradictions
Entries that semantically contradict each other, to resolve.
Tools

Knowledge

add_decision
Records a decision with context, alternatives and full reasoning.
log_bug
Records a bug: description, root cause, fix.
get_decision_history
Chronological timeline of architectural decisions.
search_memory
Semantic search across the full project history.
search_cross_project
Semantic search across all of the user’s projects.
compare_sessions
Structured diff between now and N sessions ago.
Tools

Collaboration (proposals)

propose_change
Proposes a change to an entry — a PR pending approval.
list_proposals
Lists proposals (pending, approved, rejected).
merge_proposal
Approves and merges a proposal. Creates a new version.
reject_proposal
Rejects a proposal without applying it.
Tools

Versions

get_entry_versions
Version history of an entry.
restore_version
Restores an entry to an earlier version.
Tools

State commits

create_commit
Aggregated snapshot (decisions, bugs, PRs) shown in the graph.
list_commits
Lists all state commits of the project.
Automate

Agent rules (automatic)

An MCP agent only calls the tools when it knows to. Drop this file at the root of your project (CLAUDE.md for Claude Code, .cursorrules for Cursor, project rules for opencode): the agent will load and save memory on its own, every session — without you asking.

CLAUDE.md · .cursorrules
# Memexa — persistent project memory (MCP)

This project uses Memexa: shared memory that persists across AI coding sessions.
Every new session starts amnesic — Memexa restores what previous sessions knew.
Use the tools yourself, proactively; do not wait to be asked.

## Session protocol
1. At the START of every session, before anything else:
   - get_context — load the project's memory (decisions, bugs, conventions, progress).
   - Empty result = new project: start fresh and begin recording.
2. WHILE working, record as you go (never batch to the end):
   - add_decision — on every architectural/technical choice, with reasoning + rejected alternatives.
   - log_bug — on every bug found or fixed, with root cause + fix.
3. Before ENDING a task:
   - update_context — persist this session's progress, decisions and bugs.
   - create_commit — snapshot the session so it shows in the project timeline.

## Reach for these when relevant
- search_memory — before building something, check if it was already decided/tried here.
- search_cross_project — how you solved a similar problem in your other projects.
- get_decision_history — the chronological trail of architectural decisions.
- get_contradictions — surface entries that now conflict; resolve them.
- get_project_status / validate_context / get_insights — health of the memory (coherence, patterns, alerts).
- compare_sessions — diff the current state against N sessions ago.
- get_entry_versions / restore_version — inspect or roll back a specific entry.
- propose_change / list_proposals / merge_proposal / reject_proposal — with multiple agents, suggest edits as reviewable changes instead of overwriting.
- list_commits — list the project's state snapshots.

## Rules
- Load memory FIRST; never re-ask for what is already in memory.
- Record decisions and bugs the moment they happen, concisely, in your own words.
- Update or search existing entries instead of creating duplicates.

New project = empty memory on the first get_context: that’s expected — the agent fills it over the sessions.

Access

API keys & project

Your API key authenticates the agent (X-Memexa-Key header). The project ID targets the right memory.

Never commit your key (memexa_sk_ prefix).

© 2026 Memexa · https://api.memexa.tech/v1