MCP Memory Server
Provides persistent vector memory storage and semantic search capabilities for the Windsurf editor, allowing for project-specific context retrieval and documentation ingestion.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Memory Serversearch for architectural decisions in project-thaama"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Fremem (formerly MCP Memory Server)
A persistent vector memory server for Windsurf, VS Code, and other MCP-compliant editors.
π Philosophy
Privacy-first, local-first AI memory: Your data stays on your machine.
No vendor lock-in: Uses open standards and local files.
Built for MCP: Designed specifically to enhance Windsurf, Cursor, and other MCP-compatible IDEs.
Related MCP server: Vector Memory MCP Server
βΉοΈ Status (v0.2.0)
Stable:
β Local MCP memory with Windsurf/Cursor
β Multi-project isolation
β Ingestion of Markdown docs
Not stable yet:
π§ Auto-ingest (file watching)
π§ Memory pruning
π§ Remote sync
Note: There are two ways to run this server:
Local IDE (stdio): Used by Windsurf/Cursor (default).
Docker/Server (HTTP): Used for remote deployments or Docker (exposes port 8000).
π₯ Health Check
To verify the server binary runs correctly:
# From within the virtual environment
python -m fremem.server --helpβ Quickstart (5-Minute Setup)
There are two ways to set this up: Global Install (recommended for ease of use) or Local Dev.
Option A: Global Install (Like npm -g)
This method allows you to run fremem from anywhere without managing virtual environments manually.
1. Install pipx (if not already installed):
MacOS (via Homebrew):
brew install pipx
pipx ensurepath
# Restart your terminal after this!Linux/Windows: See pipx installation instructions.
2. Install fremem:
# Install from PyPI
pipx install fremem
# Verify installation
fremem --helpConfigure Windsurf / VS Code:
Since pipx puts the executable in your PATH, the config is simpler:
{
"mcpServers": {
"memory": {
"command": "fremem",
"args": [],
"env": {
"MCP_MEMORY_PATH": "/Users/YOUR_USERNAME/mcp-memory-data"
}
}
}
}Note on
MCP_MEMORY_PATH: This is wherefrememwill store its persistent database. You can point this to any directory you like (checks locally or creating it if it doesn't exist). We recommend something like~/mcp-memory-dataor~/.fremem-data. It must be an absolute path.
Option B: Local Dev Setup
1. Clone and Setup
git clone https://github.com/iamjpsharma/fremem.git
cd fremem
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies AND the package in editable mode
pip install -e .2. Configure Windsurf / VS Code (Local Dev)
Add this to your mcpServers configuration (e.g., ~/.codeium/windsurf/mcp_config.json):
Note: Replace /ABSOLUTE/PATH/TO/fremem with the actual full path to the cloned directory.
{
"mcpServers": {
"memory": {
"command": "/ABSOLUTE/PATH/TO/fremem/.venv/bin/python",
"args": ["-m", "fremem.server"],
"env": {
"MCP_MEMORY_PATH": "/ABSOLUTE/PATH/TO/fremem/mcp_memory_data"
}
}
}
}In local dev mode, it's common to store the data inside the repo (ignored by git), but you can use any absolute path.
π Usage
0. HTTP Server (New)
You can run the server via HTTP (SSE) if you prefer:
# Run on port 8000
python -m fremem.server_httpAccess the SSE endpoint at http://localhost:8000/sse and send messages to http://localhost:8000/messages.
π³ Run with Docker
To run the server in a container:
# Build the image
docker build -t fremem .
# Run the container
# Mount your local data directory to /data inside the container
docker run -p 8000:8000 -v $(pwd)/mcp_memory_data:/data frememThe server will be available at http://localhost:8000/sse.
1. Ingestion (Adding Context)
Use the included helper script ingest.sh to add files to a specific project.
# ingest.sh <project_name> <file1> <file2> ...
# Example: Project "Thaama"
./ingest.sh project-thaama \
docs/architecture.md \
src/main.py
# Example: Project "OpenClaw"
./ingest.sh project-openclaw \
README.md \
CONTRIBUTING.mdπ‘ Project ID Naming Convention
It is recommended to use a consistent prefix for your project IDs to avoid collisions:
project-thaamaproject-openclawproject-myapp
2. Connect in Editor
Once configured, the following tools will be available to the AI Assistant:
memory_search(project_id, q, filter=None): Semantic search. Supports metadata filtering (e.g.,filter={"type": "code"}). Returns distance scores.memory_add(project_id, id, text): Manual addition.memory_list_sources(project_id): specific files ingested.memory_delete_source(project_id, source): Remove a specific file.memory_stats(project_id): Get chunk count.memory_reset(project_id): Clear all memories for a project.
The AI will effectively have "long-term memory" of the files you ingested.
π Troubleshooting
"fremem: command not found" after installing:
This means
pipxinstalled the binary to a location not in your system's PATH (e.g.,~/.local/bin).Fix: Run
pipx ensurepathand restart your terminal.Manual Fix: Add
export PATH="$PATH:$HOME/.local/bin"to your shell config (e.g.,~/.zshrc).
"No MCP server found" or Connection errors:
Check the output of
pwdto ensure your absolute paths inmcp_config.jsonare 100% correct.Ensure the virtual environment (
.venv) is created and dependencies are installed.
"Wrong project_id used":
The AI sometimes guesses the project ID. You can explicitly tell it: "Use project_id 'project-thaama'".
Embedding Model Downloads:
On the first run, the server downloads the
all-MiniLM-L6-v2model (approx 100MB). This may cause a slight delay on the first request.
ποΈ Uninstalling
To remove fremem from your system:
If installed via pipx (Global):
pipx uninstall frememIf installed locally (Dev): Just delete the directory.
π Repo Structure
/
βββ src/fremem/
β βββ server.py # Main MCP server entry point
β βββ ingest.py # Ingestion logic
β βββ db.py # LanceDB wrapper
βββ ingest.sh # Helper script
βββ requirements.txt # Top-level dependencies
βββ pyproject.toml # Package config
βββ mcp_memory_data/ # Persistent vector storage (gitignored)
βββ README.mdπΊοΈ Roadmap
β Completed (v0.1.x)
Local vector storage (LanceDB)
Multi-project isolation
Markdown ingestion
PDF ingestion
Semantic chunking strategies
Windows support + editable install fixes
HTTP transport wrapper (SSE)
Fix resource listing errors (clean MCP UX)
Robust docs + 5-minute setup
Multi-IDE support (Windsurf, Cursor-compatible MCP)
π Near-Term (v0.2.x β Production Readiness)
π§ Memory Governance
List memory sources per project
Delete memory by source (file-level deletion)
Reset memory per project
Replace / reindex mode (prevent stale chunks)
Memory stats (chunk count, last updated, size)
π― Retrieval Quality
Metadata filtering (e.g., type=decision | rules | context)
Similarity scoring in results
Hybrid search (semantic + keyword)
Return evidence + similarity scores with search results
Configurable top_k defaults per project
βοΈ Dev Workflow
Auto-ingest on git commit / file change
mcp-memory init <project-id>bootstrap commandProject templates (PROJECT_CONTEXT.md, DECISIONS.md, AI_RULES.md)
π§ Advanced RAG (v0.3.x β Differentiators)
Hierarchical retrieval (summary-first, detail fallback)
Memory compression (old chunks β summaries)
Temporal ranking (prefer newer decisions)
Scoped retrieval (planner vs coder vs reviewer agents)
Query rewrite / expansion for better recall
π’ Team / SaaS Mode (Optional)
Philosophy: Local-first remains the default. SaaS is an optional deployment mode.
π Auth & Multi-Tenancy
Project-level auth (API keys or JWT)
Org / team separation
Audit logs for memory changes
βοΈ Remote Storage Backends (Pluggable)
S3-compatible vector store backend
Postgres / pgvector backend
Sync & Federation (Local β Remote)
π« Non-Goals
β No mandatory cloud dependency
β No vendor lock-in
β No chat history as βmemoryβ by default (signal > noise)
β No model fine-tuning
Available Tools
6 toolsmemory_addB
Add a new memory fragment/document to the project's vector store.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique ID for this memory fragment (to support updates) | |
| meta | No | Optional JSON metadata | |
| text | Yes | The text content to verify | |
| project_id | Yes | Unique identifier for the project scope |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must cover behavioral traits. It only states 'add' without disclosing whether it overwrites on duplicate ID, side effects, permissions needed, or what happens if the project doesn't exist.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, concise and to the point. It could be slightly more informative without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 4 parameters, 3 required, a nested object, and no output schema, the description is too sparse. It omits important details such as return value, duplicate handling, and project existence behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% (all parameters described), so baseline is 3. The description does not add additional meaning beyond the schema, e.g., the update behavior implied by the 'id' parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Add') and the resource ('memory fragment/document') with context ('to the project's vector store'). It distinguishes itself from sibling tools that perform deletion, listing, reset, search, or stats.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for adding new memories, but it does not explicitly state when to use this tool versus alternatives, nor does it mention when not to use it or provide any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_delete_sourceB
Delete all memories associated with a specific file source.
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | The exact source (e.g., file path) to delete. | |
| project_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden for behavioral disclosure. It only mentions deletion but does not describe traits like irreversibility, required permissions, error behavior, or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no wasted words, efficiently conveying the tool's action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there is no output schema and it's a destructive tool, the description lacks completeness: it does not explain return values, prerequisites, or what constitutes a valid source. It serves as a minimal definition.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 50%. The description adds meaning to the 'source' parameter (exact source like file path), but does not mention 'project_id' or clarify its relationship to the deletion scope. Partially compensates for schema gaps.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb (delete), resource (memories), and condition (associated with a specific file source). It distinguishes from sibling tools like memory_add or memory_search, which do not involve deletion.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like memory_reset (which might delete all memories) or when not to use it. The description only states what it does.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_list_sourcesB
List all files/sources ingested for a project.
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden. It does not disclose behavioral traits such as whether the operation is read-only, pagination, or performance implications. The description simply states what it does without additional transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that front-loads the key action. It is efficient with no wasted words, though it could include more useful information without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the low complexity and full schema coverage, the description is minimally adequate. However, it lacks any information about the output format (no output schema), which is important for a list tool. Sibling tools are not compared.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already covers the single parameter project_id with a description ('Project ID'), so schema_description_coverage is 100%. The description adds no extra meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'List all files/sources ingested for a project.' It uses a specific verb ('list') and resource ('files/sources'), and distinguishes it from sibling tools like memory_add and memory_delete_source.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives (e.g., memory_search). The description does not mention prerequisites, context, or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_resetC
Reset (clear) all memories for a project.
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. The description only says 'clear all memories', implying destructive action but lacking details on irreversibility, permissions, or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, which is concise but lacks necessary detail. It is front-loaded but insufficient for full understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's destructive nature and no output schema, the description should explain what 'memories' are and the impact of resetting; it fails to provide this context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The only parameter 'project_id' is not explained in the description; schema coverage is 0%, so the description adds no semantic value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'reset' and the resource 'all memories for a project', distinguishing it from sibling tools that add, delete, search, or stat memories.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like memory_delete_source or memory_add; no mention of prerequisites or potential issues.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_searchA
Search the semantic memory for a specific project using a natural language query.
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Number of results to return (default: 5) | |
| q | Yes | The search query | |
| filter | No | Optional metadata filter (e.g. {'type': 'decision'}) | |
| project_id | Yes | Unique identifier for the project scope |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states it is a search operation, implying read-only behavior, but does not disclose any other behavioral traits such as required permissions, rate limits, or non-destructiveness. The description adds minimal beyond the tool name.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is concise and front-loaded with the action and resource. Every word is meaningful and contributes to understanding the tool's core function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 4 parameters, including a nested filter object, and no output schema, the description could provide more context about return values or how to use optional parameters. However, the schema covers parameter details, and the description at least clarifies the scope (specific project). It is adequate but not rich.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description does not add any additional meaning for parameters beyond what the schema already provides. It does not synthesize or explain parameter interactions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: searching semantic memory with a natural language query for a specific project. The verb 'Search' and resource 'semantic memory' are specific, and the context distinguishes it from sibling tools (add, delete, list, reset, stats).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not explicitly provide guidelines on when to use this tool versus alternatives. However, the purpose is distinct from sibling tools, so the usage is implied. No explicit when-not or alternative naming is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
memory_statsC
Get statistics for a project's memory (chunk count).
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but only says 'get statistics' implying read-only. No disclosure of return format, side effects, permissions, or rate limits. Minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is front-loaded and to the point, but it is under-specified given the tool's context.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one required parameter and no output schema, the description lacks return value details, error conditions, and context about the chunk count statistic. Incomplete for effective usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% and the description provides no additional meaning for the project_id parameter beyond the schema's type and required flag. No format, source, or usage hints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the verb 'Get' and resource 'statistics for a project's memory (chunk count)', clearly indicating it retrieves memory usage statistics. It distinguishes from sibling tools like memory_add or memory_reset which perform different actions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives like memory_list_sources or memory_search. No prerequisites or context for usage are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.2.1- First observed
memory_add - First observed
memory_delete_source - First observed
memory_list_sources - First observed
memory_reset - First observed
memory_search - First observed
memory_stats
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: add, delete by source, list sources, reset, search, and stats. No overlapping functionality between them.
All tools follow a consistent verb_noun pattern with 'memory_' prefix, e.g., memory_add, memory_delete_source. No mixing of conventions.
6 tools is well-scoped for a memory management server covering core CRUD-like operations plus search and stats. Not too few nor too many.
Covers add, delete by source, list sources, search, and stats. Lacks individual memory item update or delete, but for vector stores these are less critical. Minor gap.
Maintenance
Related MCP Connectors
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Persistent memory for AI agents β log and recall conversation context over MCP.
- memnodeOAuthdev.memnode
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- AlicenseAqualityCmaintenanceA local, fully-offline MCP memory server that enables persistent storage and retrieval of information using SQLite with both keyword and semantic vector search capabilities.1019 npm13MIT
- AlicenseNot gradedqualityCmaintenanceProvides local vector-based semantic memory storage for AI assistants to persist context and decisions across sessions using local embeddings and LanceDB. It enables private semantic search and session handoff capabilities to maintain long-term project context.81 npm5MIT
- AlicenseBqualityDmaintenanceMCP server that provides cross-session persistent memory for AI coding assistants using local vector database and semantic search, enabling automatic recall of project context, issues, and tasks.925 PyPI91Apache 2.0
- AlicenseNot gradedqualityCmaintenanceProvides a local, persistent long-term memory service for MCP-compatible AI agents, enabling them to store, search, and recall information across sessions.1GPL 3.0