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.
Quickstart
- 1Create an accountSign up and create a project. An API key is generated.
- 2Grab key + projectCopy your API key (API Keys) and the project ID (project page).
- 3Paste the configAdd the MCP block to your agent (below), then restart it.
Install per agent
Replace the values memexa_sk_prod_••• and your-project-id.
{
"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 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-serverclaude 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).
{
"$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.
Environment variables
MEMEXA_API_KEYreqMEMEXA_API_URLreqMEMEXA_PROJECT_IDreqMEMEXA_AGENToptConcepts
Session & context
get_contextupdate_contextget_project_statusvalidate_contextget_insightsget_contradictionsKnowledge
add_decisionlog_bugget_decision_historysearch_memorysearch_cross_projectcompare_sessionsCollaboration (proposals)
propose_changelist_proposalsmerge_proposalreject_proposalVersions
get_entry_versionsrestore_versionState commits
create_commitlist_commitsAgent 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.
# 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.
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).