← Back to directory
M

Mengram MCP Server

Official
Long-term memory for AI agents that actually learns
Category
Dev Tools #158 of 438
Stars
★ 205 Very popular
Transport
Streamable HTTP · stdio (local process)
Runtime
Python · Hosted (no local runtime)
Credentials
API key / credential required
License
Apache-2.0
Last commit
57FMRS · C

Mengram is a memory MCP server for AI agents whose distinguishing feature is covering semantic, episodic, and procedural memory at once, with procedures that evolve on failure and carry derived preconditions. It ships a free API key, Python and JS SDKs, LangChain, CrewAI, and OpenClaw integrations, and connects to Claude Desktop, Cursor, Codex, Windsurf, and Cline via a hosted streamable-http endpoint or a local stdio server. It fits coding agents and autonomous-agent developers that need persistent cross-session memory, but not single-turn or strictly component-free local setups. The main trade-offs are that cloud mode uploads content to a third party and that automatic hooks and self-evolving procedures shape both context and pre-command prompts.

Strongest · Documentation 13/20 Weakest · Reliability 9/20

Reliability
9/20
Security and permissions
11/20
Maintenance
12/20
Documentation
13/20
Setup experience
12/20
Why each score
Reliability 9/20
Static evidence consists of server.json declaring one streamable-http remote (https://mengram.io/mcp) with a bearer auth header at version 2.25.4, plus README claims of 30 tools, auto-recall/auto-save hooks, a policy gate, and a local memfmt folder mode. No real CI workflow or committed test files are present in the supplied material, so the static calibration cap of 12 applies. There is no source-level proof of the tool list, MCP init handshake, error codes, timeouts, or dependency pinning, and the hosted endpoint's availability and tool-behavior fidelity cannot be confirmed. Deductions: no reproducible handshake or tool-behavior evidence, no tests or CI, error handling and dependency controllability undisclosed.
Security and permissions 11/20
The manifest requires an Authorization: Bearer API key (isSecret, isRequired), which is the right direction, but all memory content (code, commands, file paths, session history) is uploaded to the third-party cloud mengram.io; the README concedes even local mode needs a model for extraction and failure revision, i.e., a hosted path by default. Data boundaries, retention, encryption, and subprocessors are not stated. The policy gate only 'asks' before git push/deploy/migrate/rm -rf and explicitly 'never denies' — mitigation, not enforced confirmation. Hooks can auto-inject context and write files (~/.mengram/, hooks.json, Claude/Cursor/Codex configs). Install examples use placeholder om-... keys, so no red-line credential leak was found. Deductions: default cloud upload without data-flow/retention disclosure, automatic edits to client config files, dangerous commands only gated by a prompt rather than blocked, and third-party embedding/inference (Cohere) with no stated boundary.
Maintenance 12/20
The license is clear (Apache-2.0), the repository is not archived, it has 196 stars and 25 open issues, and version 2.25.4 indicates ongoing releases. However, the supplied material shows no commit log, release cadence, issue response times, dependency-update policy, or security-response channel (no SECURITY.md evidence), so governance and versioning are incomplete. Popularity is a discovery signal only and adds nothing. Deductions: no verifiable issue/PR responsiveness or security disclosure channel, no dependency-update or release-process documentation.
Documentation 13/20
The docs are unusually layered: quick start, three memory types (semantic/episodic/procedural), ask-with-citations, cognitive profile, multi-user isolation, async client, metadata filters, webhooks, quota response headers, Ollama self-hosting model-size constraints, Claude Code hooks plus policy gate, LangChain/CrewAI/OpenClaw integrations, example templates, and an API endpoint table. Gaps and hidden assumptions remain: free-tier numbers, rate limits, data retention/deletion policy, and pricing tiers (Pro/Growth/Business) lack evidence; the 23-language scope is asserted without substantiation; troubleshooting is absent; and endpoints are inconsistent between documents (/mcp vs /mcp/sse for Claude Managed Agents). Deductions: no cost, quota-limit, privacy, or troubleshooting coverage.
Setup experience 12/20
It offers pip/npm install, a one-command mengram setup, manual client JSON config examples (Claude Desktop/Cursor), an npm package, plugin-marketplace install, and an agent-install.txt onboarding guide; steps are clear with multiple client examples. But it first requires registering for an API key, the 'one-prompt install' depends on an external guide text and automated edits to local configs, and no committed CI or test verifies the connection is reachable; local mode needs a bring-your-own model provider key. The static cap of 15 applies and, given the absence of verifiable execution evidence or platform-compatibility testing, 12 is appropriate. Deductions: no test/CI support for the key path, dependency on registering with the hosted service, and unstated rollback if automated config edits fail.

Static review · not runListed 2026-09-18

Read the FMRS scoring method →

Fit and risk

What it can accessUses the network

Best for

  • Coding agents and CLI workflows that need persistent memory across sessions and machines (Claude Code, Codex, Cursor)
  • Developers building autonomous agents that need semantic, episodic, and evolving procedural memory
  • Teams using LangChain, CrewAI, or OpenClaw who want a ready memory backend
  • Apps that need multi-user data isolation under a single API key
  • Teams wanting an account-free, folder-based memory that uses their own model provider (Anthropic, OpenAI, or Ollama)

Not for

  • Single-turn chats or scenarios with no need for cross-session state
  • Environments requiring a fully local setup with no SDK or CLI installed (local mode still needs pip install mengram-ai and your own model key)
  • High-concurrency writes demanding whole-folder crash-atomic transactions (the folder is not a single crash-atomic transaction and external editors do not participate in the lock)
  • Self-hosters expecting good extraction from models under 8B parameters or with less than an 8K context window

Required permissions

  • A Mengram API key sent as an Authorization: Bearer header for cloud memory reads and writes
  • In cloud mode, conversations are sent to mengram.io for extraction, embedding, and retrieval
  • Claude Code hooks can read session history and working state and re-inject context before and after compaction
  • `mengram import claude-code` reads local Claude Code session history (the README states secrets are redacted on your machine before upload)
  • The policy gate looks up learned workflows before workflow-shaped Bash commands and can be pointed at a local memory folder via MENGRAM_MEMORY_DIR

Risks and side effects

  • Cloud mode uploads conversations and file content to a third-party service, which may include sensitive data; local mode avoids this but needs your own model key
  • Auto-save and auto-recall hooks read and write memory in the background, which can introduce unwanted context
  • Incorrect memories get re-recalled and injected into system prompts, with a persistent effect
  • Procedures evolve automatically and the policy gate can prompt before command execution, so misconfiguration may cause false alarms
  • In folder mode concurrent external edits are not lock-protected and can be overwritten; local search matches words and does not use embeddings or translation

Setup

Before you start

Runtime:Python · Hosted (no local runtime)

MENGRAM_API_KEY requiredsecret Mengram API key (format om-...), free at https://mengram.io.
Other optional settings (3)
MENGRAM_MEMORY_DIR optional Path to a local memfmt Markdown memory folder (e.g. ./memory) used for fully offline policy-gate lookups.
MENGRAM_POLICY_MIN_RELIABLE optional Minimum reliability threshold (default 70) below which learned workflows trigger an ask before running.
MENGRAM_POLICY_PATTERN optional Custom regex controlling which commands trigger policy-gate lookups (by default workflow-shaped commands like git push or deploy).
  1. Get a free API key at https://mengram.io/#signup (format om-...).
  2. Install the SDK: pip install mengram-ai or npm install mengram-ai.
  3. Option A (hosted remote): point your client at https://mengram.io/mcp and authenticate with the Authorization: Bearer <your key> header.
  4. Option B (local stdio): add an mcpServers entry with command mengram, args ["server", "--cloud"], and env MENGRAM_API_KEY.
  5. Alternatively run mengram setup, which handles the account, Claude Code hooks, MCP configs for detected tools (Cursor, Claude Desktop, Windsurf), and history import.
  6. Verify the round-trip with a search or ask call.
claude_desktop_config.json
{
  "mcpServers": {
    "mengram": {
      "command": "mengram",
      "args": ["server", "--cloud"],
      "env": { "MENGRAM_API_KEY": "om-..." }
    }
  }
}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "mengram": {
      "command": "mengram",
      "args": [
        "server",
        "--cloud"
      ],
      "env": {
        "MENGRAM_API_KEY": "om-..."
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add mengram -e MENGRAM_API_KEY=om-... -- mengram server --cloud

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

After connecting the Mengram MCP server in a client like Claude Desktop or Cursor, the tool list should show 30 memory tools; ask "What's my tech stack?" after adding a memory — an answer citing the stored facts confirms the connection.

Troubleshooting

  1. Confirm the Authorization header uses Bearer <om-...> with a valid key; call GET /v1/me to verify the account
  2. If cloud calls are rejected, check quota headers X-Quota-Add-Used/Limit and X-Quota-Search-Used/Limit, or inspect .quota from the SDK
  3. Distinguish transports on connection failure: the hosted endpoint is streamable-http at https://mengram.io/mcp; local stdio requires the `mengram` command on PATH
  4. If self-hosted Ollama results are poor, switch to a model with 8B+ parameters and 8K+ context (e.g. llama3.1:8b, mistral:7b, gemma2:9b)
  5. If a file upload returns no result, poll job status with m.job_status(job_id)
  6. Tune policy-gate behavior with MENGRAM_POLICY_MIN_RELIABLE and MENGRAM_POLICY_PATTERN, or disable it with `mengram hook install --no-policy`
  7. In folder mode, conflicting edits require a reload rather than overwriting; check the folder lock state

Things to try

Once connected, you can ask your AI assistant things like:

  • Remember that I use Python and deploy to Railway
  • What's my tech stack?
  • Search my memory for deployment issues
  • Generate my cognitive profile

Use cases

Keep coding-agent context alive across /clear, auto-compaction, machine switches, and team handoffs
Store what an autonomous agent learns each run and recall it before the next decision
Record deployment failures so a Deploy procedure evolves with new steps and preconditions
Generate a personalization system prompt from all memories via the Cognitive Profile call
Import existing data (Claude Code sessions, ChatGPT exports, Obsidian vaults, text files) to skip the cold start
Run multilingual memory retrieval and cited answers across 23 languages

Supported clients

Claude Desktop
CursorPartial support
CodexPartial support
Windsurf
Cline
Claude Code
OpenClaw
LangChain
CrewAI

Listed from the project's documentation, not tested by this site.

Overview

Mengram is a long-term memory service for AI agents, storing three memory types: semantic (facts and preferences), episodic (events and decisions), and procedural (workflows). Procedures evolve into new versions when failures are reported, recording the assumption that turned out false and deriving preconditions carried at recall time. Mengram offers a free API key, Python and JavaScript SDKs, and LangChain, CrewAI, and OpenClaw integrations, and exposes an MCP server to Claude Desktop, Cursor, Codex, Windsurf, and Cline (the README mentions 30 tools). The server is hosted at https://mengram.io/mcp over streamable-http and requires an Authorization: Bearer <API key> header. It includes native multilingual retrieval across 23 languages, an ask endpoint returning synthesized answers with citations, and a Cognitive Profile that generates a system prompt from all memories. The project is Apache-2.0 licensed and can be self-hosted with Ollama.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 64.1k · Tools 2 Compare with this →

Source revision 88a50abbae54 Data synced 2026-11-02 Read the FMRS scoring method