An MCP server that provides persistent cross-project memory for coding assistants by searching previously saved solutions before reasoning and saving confirmed solutions afterward. It uses hybrid semantic and keyword search over a local or shared database, with support for Ollama or OpenAI embeddings.
From the registry: Persistent cross-project memory for Cursor and Claude Code using local semantic search.
$ pipx install longmem$ ollama pull nomic-embed-texthttps://ollama.com$ pip install 'longmem[openai]'$ longmem initPlease install the `longmem` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Install longmem** — Install the Longmem MCP server package globally using pipx. Run: `pipx install longmem`
- **Python 3.11+** — Python 3.11 or newer is required to run longmem. (https://www.python.org)
- **Install Ollama and pull embedding model** — Default configuration uses a local Ollama instance for embeddings. Install Ollama, then pull the nomic-embed-text model. Run: `ollama pull nomic-embed-text` (https://ollama.com)
- **Run one-time setup** — Initializes Longmem by checking Ollama, pulling the embedding model, and writing IDE config. Run: `longmem init`
Optional prerequisites:
- Or install OpenAI extras — If using OpenAI embeddings instead of Ollama, install the optional OpenAI dependency extra. Run: `pip install 'longmem[openai]'`
Canonical MCP server config (stdio transport):
- command: `longmem`
- args: []
- required environment variables:
- `OPENAI_API_KEY`: OpenAI API key for embeddings when configured to use OpenAI embedder instead of the default local Ollama setup. (example: `<your-openai-api-key>`)
- optional environment variables:
- `LANCEDB_API_KEY`: LanceDB Cloud API key when using a LanceDB Cloud db_uri. (example: `<your-lancedb-api-key>`)
Note: The MCP server runs over stdio via `longmem` with no arguments. Default behavior relies on configuration in ~/.longmem/config.toml and a local Ollama instance rather than MCP config env vars. AWS environment variables may also be required if using an S3 db_uri, but the README does not name specific variables.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.OPENAI_API_KEYAPI key for OpenAI embeddings when using the OpenAI embedder.LANCEDB_API_KEYAPI key for LanceDB Cloud when using a cloud database URI.MCP server for interacting with the Supabase platform