@kolivri/memoreal-mcp — Deterministic AI Memory & Code Intelligence MCP for Claude Code, OpenCode, Cursor, Codex & 17 AI Harnesses

@kolivri/memoreal-mcp is the official zero-dependency Node.js ESM Model Context Protocol (MCP) connector (stdio & HTTP) for Memoreal Cloud — giving AI coding and operator agents across 17 local AI agent harnesses (Claude Code, Claude Desktop, Cursor, OpenCode, OpenAI Codex, Windsurf, VS Code / GitHub Copilot, Zed, Gemini CLI, Cline, Roo Code, Kilo Code, Continue, Block Goose, Sourcegraph Amp, AWS Kiro & Amazon Q, Trae, and Aider) deterministic long-term memory, cross-session recall, and polyglot code intelligence powered by memoreal.kolivri.com.
Environment Variables
| Variable |
Required |
Default |
Description |
MEMOREAL_API_KEY |
Yes |
— |
Your Memoreal Cloud API key (mem_dev_..., mem_start_..., or mem_biz_...) from memoreal.kolivri.com/register |
MEMOREAL_API_URL |
Optional |
https://memoreal.kolivri.com |
Memoreal Cloud base URL |
MEMOREAL_NAMESPACE |
Optional |
default |
Default project/workspace namespace when omitted from tool arguments |
Backward Compatibility: Legacy MEMORIA_API_KEY, MEMORIA_API_URL, and MEMORIA_NAMESPACE environment variables remain 100% supported as automatic fallbacks across all transports.
The 5 Market Tracks & Automated Feature Showcases
Memoreal Cloud provides deterministic, high-speed memory architectures tailored to 5 primary market tracks. Each track leverages a dedicated context mode, domain-specific hooks, and live automated feature showcases:
1. Software Developers & Engineering Teams (mode: "organizational")
- Stack & Installation:
npx -y @kolivri/memoreal-mcp setup across Windows, Linux/WSL, and macOS supporting all 17 local AI agent harnesses.
- Polyglot Code Intelligence: Cold-start
bootstrap_project parses instructions (CLAUDE.md, AGENTS.md, README.md) and indexes symbols across 15+ programming languages.
- Belief Revision & Evolution:
Supersedes graph edges dynamically deprecate killed-RFC architectural decisions when new patterns are accepted.
- Architectural Tools: Deep caller/callee trees (
call_tree), blast radius assessment (impact), and gap detection (test_gaps).
- Compaction-Proof Hooks: Session lifecycle hooks provide
70%+ prompt token savings through automated memory recall and compaction survival.
- CI/CD Integration: Seamless integration with GitHub via
/v1/webhooks/github for automatic memory syncing on branch merges.
2. Automated Call & Customer Support Centers (mode: "support")
- Telephony & Helpdesk Connectors: Native voice and support webhooks/SDKs for Kolivri Voice, Twilio, Vapi, LiveKit, WhatsApp, and Zendesk.
- Sub-First-Ring Recall:
12.9 ms* p50 returning-caller memory recall eliminates dead air ($0 LLM dead air delay) before the first phone ring.
- Multilingual Support: Verified across 15 natural languages, including
102/102 = 100.0% on Hebrew LongMemEval benchmark tests.
- Dynamic Customer State:
Supersedes edges track live ticket status, address updates, and preference changes over time.
- Privacy & Safety: Pre-storage PII redaction ensures caller identity data and payment information are protected.
3. Autonomous & Multi-Agent Builders (mode: "operational")
- Agent Frameworks: Streamable HTTP
/v1/mcp transport and REST SDK integrations for LangGraph, CrewAI, OpenAI Agents SDK, AutoGen, and Mastra.
- 5 Specialist Agent Wings: Multi-agent coordination across
architect, reviewer, qa, security, and ops wings via handoff_to_agent and /v1/rooms/handoff.
- Memory Tiering: Isolation between scratchpad ideation in
Buffer tier vs immutable production invariants in Core tier.
- Causal Reasoning: Graph-powered dependency tracking via
downstream_effects and root_cause diagnostics for runtime failure recovery.
4. Sales, CRM & Revenue Operations AI (mode: "sales")
- RevOps Integrations: Native connectors and webhooks for AI SDRs, HubSpot, Salesforce, Gong, n8n, and Make.
- Deterministic Math: Strict numeric reasoning and signed deal arithmetic (e.g.
$25k + $15k = $40k) without LLM hallucination.
- Entity Separation: Strict graph boundary separation between first-party customer facts and competitor/vendor intelligence.
- Pre-Call Briefs: Automated account synthesis using
/v1/extract and /v1/reflect to assemble instant executive briefing documents.
5. Security- & Compliance-First Organizations (mode: "research")
- Cryptographic Access Control: Role-scoped API keys with explicit
Write vs Read-only auditor access.
- Enterprise Team RBAC: Granular role-based access control supporting
owner, admin, manager, and member tiers.
- Zero-Trust Data Protection: Pre-storage PII/secret scrubbing and prompt-injection quarantine prevent memory poisoning.
- Auditability & Provenance: Full memory trust chains via
trace_provenance, immutable audit trails via /v1/trace/recent, and GDPR compliance via /v1/export and right-to-forget endpoints.
Cross-OS Support (Windows · Linux / WSL · macOS)
@kolivri/memoreal-mcp runs natively across all major operating systems with zero external shell dependencies:
- Windows (
win32):
- Full support for
PowerShell and cmd.exe.
- Config paths resolved to
%APPDATA% (Roaming) and %LOCALAPPDATA% with %USERPROFILE%.
- Lifecycle hooks run via pure Node.js (
bin/memoreal-hook.mjs) and Windows batch wrappers (bin/memoreal-ns.cmd), requiring zero /bin/sh or jq.
- Safe OAuth browser launching via
rundll32 (url.dll,FileProtocolHandler), preventing URL query parameters (&) from breaking.
- Linux & WSL (
linux):
- Compliant with
$XDG_CONFIG_HOME (defaulting to ~/.config).
- Seamless WSL integration: automatically detects WSL environments (
WSL_DISTRO_NAME / WSL_INTEROP) and opens the host Windows browser via rundll32.exe.
- macOS (
darwin):
- Idiomatic macOS application paths under
~/Library/Application Support and ~/.config.
- Works out of the box with standard Apple Silicon (
arm64) and Intel (x64) architectures.
Supported Local AI Agent Harnesses (17 Harnesses)
@kolivri/memoreal-mcp automatically detects and provisions MCP configurations, skills, and lifecycle hooks across 17 local AI agent harnesses:
- Claude Code (
~/.claude/settings.json, .claude.json, hooks)
- Claude Desktop (
claude_desktop_config.json on macOS / Windows %APPDATA% / Linux)
- Cursor (
~/.cursor/mcp.json, .cursor/rules/)
- OpenCode (
${XDG_CONFIG_HOME:-~/.config}/opencode/opencode.json, plugins, hooks)
- OpenAI Codex (
~/.codex/config.toml, .codex/skills/, .codex/AGENTS.md)
- Windsurf (
~/.codeium/windsurf/mcp_config.json, memories/global_rules.md)
- VS Code / GitHub Copilot (
~/.vscode/mcp.json, Code/User/mcp.json, .github/copilot-instructions.md)
- Zed (
~/.config/zed/settings.json via context_servers.memoreal)
- Gemini CLI (
~/.gemini/settings.json, .gemini/GEMINI.md)
- Cline (
cline_mcp_settings.json in globalStorage / stdio with cmd /c npx on Windows)
- Roo Code (
mcp_settings.json in globalStorage / stdio)
- Kilo Code (
mcp_settings.json in globalStorage / stdio)
- Continue (
~/.continue/mcpServers/memoreal.json)
- Block Goose (
~/.config/goose/config.yaml via extensions.memoreal)
- Sourcegraph Amp (
~/.config/amp/settings.json via amp.mcpServers)
- AWS Kiro & Amazon Q (
~/.kiro/settings/mcp.json, ~/.aws/amazonq/mcp.json, .kiro/steering/memoreal.md)
- Trae (
Trae/User/mcp.json)
(Also supports conventions for Aider via CONVENTIONS.md)
Installation
1. Interactive CLI Setup & Auto-Hook Provisioning (Recommended)
Run the zero-dependency interactive setup wizard to configure your API key, auto-provision client lifecycle hooks and skills, and index your repository:
# Interactive setup with automatic client detection
npx -y @kolivri/memoreal-mcp setup
# Or alias
npx -y @kolivri/memoreal-mcp init
# Setup with direct API key and target specific client
npx -y @kolivri/memoreal-mcp setup --key "mem_..." --tool opencode
# Setup without cold-start repository indexing
npx -y @kolivri/memoreal-mcp setup --no-bootstrap
What the setup wizard auto-provisions:
- Automated Client Detection: Configures Claude Code, Cursor, OpenCode, Codex, Windsurf, and VS Code MCP configs.
- Agent Lifecycle Hooks & Skills: Copies plugins/skills and configures lifecycle hooks (
SessionStart, PreCompact, PostCompact, UserPromptSubmit, PostToolUse, TaskCompleted, Stop) with .bak safety backups.
- Canonical Worktree Resolver: Installs
~/.memoreal/bin/memoreal-ns (0o755) to ensure git worktrees share canonical repository memory namespaces without org: prefixes.
- Turn-1 Cold-Start Indexing: Automatically indexes repository guidance (
CLAUDE.md, AGENTS.md, README.md) and code symbols into Memoreal Cloud (unless --no-bootstrap is passed).
2. One-Line Auto-Installer (15 AI Clients + Claude Code Lifecycle Hooks)
Automatically configures Claude Code, Cursor, Windsurf, VS Code, Claude Desktop, OpenCode, Cline, Roo Code, Continue, Zed, Goose, PearAI, Trae, Void, and Melty:
# macOS / Linux / WSL
curl -fsSL --proto '=https' --tlsv1.2 https://memoreal.kolivri.com/downloads/install.sh | MEMOREAL_KEY=YOUR_MEMOREAL_API_KEY bash
# Windows PowerShell
$env:MEMOREAL_KEY="YOUR_MEMOREAL_API_KEY"; irm https://memoreal.kolivri.com/downloads/install.ps1 | iex
3. Claude Code (claude mcp add)
claude mcp add memoreal \
-e MEMOREAL_API_KEY="your-memoreal-api-key" \
-- npx -y @kolivri/memoreal-mcp
4. Cursor (~/.cursor/mcp.json) & Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"memoreal": {
"command": "npx",
"args": ["-y", "@kolivri/memoreal-mcp"],
"env": {
"MEMOREAL_API_KEY": "your-memoreal-api-key",
"MEMOREAL_NAMESPACE": "my-project"
}
}
}
}
5. OpenCode (~/.config/opencode/opencode.json)
{
"mcp": {
"memoreal": {
"type": "local",
"command": ["npx", "-y", "@kolivri/memoreal-mcp"],
"environment": {
"MEMOREAL_API_KEY": "your-memoreal-api-key",
"MEMOREAL_NAMESPACE": "my-project"
},
"enabled": true
}
}
}
6. OpenAI Codex (~/.codex/config.toml)
OpenAI Codex uses native TOML configuration (~/.codex/config.toml). Running npx -y @kolivri/memoreal-mcp setup automatically provisions the Streamable HTTP MCP server:
[mcp_servers.memoreal]
url = "https://memoreal.kolivri.com/v1/mcp"
http_headers = { "Authorization" = "Bearer your-memoreal-api-key" }
Alternatively, you can configure local stdio execution:
[mcp_servers.memoreal]
command = "npx"
args = ["-y", "@kolivri/memoreal-mcp"]
env = { MEMOREAL_API_KEY = "your-memoreal-api-key", MEMOREAL_NAMESPACE = "my-project" }
7. Docker
docker build -t memoreal-mcp .
docker run -i --rm \
-e MEMOREAL_API_KEY="your-memoreal-api-key" \
-e MEMOREAL_NAMESPACE="my-project" \
memoreal-mcp
32 MCP Tools (https://memoreal.kolivri.com/v1/mcp)
Core Memory & Context (10 Tools)
| Tool |
Required Args |
Description |
build_context |
query |
Assemble a token-budgeted <memory_context> block grouped into Core Rules, Established Facts, and Recent Context. |
recall_memories |
query |
Retrieve top memories ranked deterministically by Memoreal Cloud within token_budget. |
encode_memory |
content |
Store a new memory in Memoreal Cloud with tier (episodic, semantic, buffer, core), salience (0.0–1.0), namespace, and context pairs. |
batch_encode |
memories |
Atomically encode an array of memories in a single call. |
forget_memory |
id |
Delete a specific memory and its incident graph edges by ID. |
delete_by_context |
key, value |
Delete all memories matching a specific [key, value] context metadata pair. |
feedback |
id, useful |
Record positive/negative utility feedback on a memory and adjust its salience score. |
consolidate |
namespace |
Deduplicate memories within a namespace and promote recurring high-salience episodic memories to Semantic tier. |
health |
(none) |
Return Memoreal Cloud engine health, active memory/edge counts, and tier distribution. |
stats |
namespace |
Return per-namespace memory count, edge count, and tier distribution. |
Code Intelligence & Navigation (9 Tools)