A zero-dependency MCP memory server that is easy to set up and runs entirely on your machine. Stores memories, tasks, and a knowledge graph as plain, human-readable markdown files across chats.
LocalMem MCP
An easy-to-install MCP memory server that runs entirely on your machine with zero runtime dependencies. Stores memories, tasks, and a knowledge graph as plain, human-readable markdown files across chats. Syncable via iCloud, Dropbox, Syncthing or similar services.
Tools (20 total)
Memory
| Tool | Description |
|------|-------------|
| save_memory | Create a memory (title, content, category, tags, importance) |
| read_memory | Read a memory - auto-increments access count |
| list_memories | List memories sorted by score or creation date |
| search_memories | Full-text search, results ranked by relevance score |
| update_memory | Overwrite content, tags, or importance |
| delete_memory | Delete a memory file |
| get_context | Snapshot: top memories + active tasks + key entities |
Tasks
| Tool | Description |
|------|-------------|
| create_task | Create a task (title, description, priority, due, tags) |
| list_tasks | List tasks, optionally filtered by status |
| update_task | Update status, priority, due date, or content |
| delete_task | Delete a task |
Knowledge Graph
| Tool | Description |
|------|-------------|
| create_entity | Create a named entity with type, observations, and importance |
| get_entity | Retrieve an entity and all its relations |
| list_entities | List entities sorted by importance, optionally filtered by type |
| add_observation | Append an observation to an existing entity |
| delete_entity | Delete an entity |
| create_relation | Create a directed relation: source -[relation]-> target |
| list_relations | List relations, optionally filtered by entity name |
| delete_relation | Delete a relation by file path |
Fact Checking
| Tool | Description |
|------|-------------|
| check_facts | Check text for similar entity names (possible typos) and relationship claims that contradict the knowledge graph |
Installation
Option A - Download pre-built binary (easiest)
Go to the Releases page and download the archive for your platform:
| File | Platform |
|------|----------|
| localmem-macos-arm64.tar.gz | macOS Apple Silicon (M-Series) |
| localmem-macos-amd64.tar.gz | macOS Intel |
| localmem-windows-amd64.zip | Windows |
| localmem-linux-amd64.tar.gz | Linux |
Extract it and place the binary anywhere on your machine. Note the full path, you will need it in the next step.
Option B - Build from source
1. Install Go
macOS (Homebrew):
brew install go
Windows (winget):
winget install GoLang.Go
Debian / Ubuntu:
sudo apt update && sudo apt install -y golang-go
2. Download LocalMem
Download the repository and open a terminal inside the folder.
3. Build the binary
go mod tidy
go build -o localmem .
This produces a single localmem binary in the current folder. No installer, no dependencies - just one file.
4. Connect to LM Studio
- Open LM Studio
- Go to Settings → MCP Servers
- Add a new server entry:
{
"mcpServers": {
"localmem": {
"command": "/home/user/localmem",
"args": []
}
}
}
Replace /home/user/localmem with the actual path to the binary you built in step 3.
Tip: To find the full path, run
pwdin the terminal where you built it, then append/localmem.
5. (Optional) Choose a memory folder
By default, LocalMem stores files in a memory/ folder next to the binary. To use a custom location - for example a synced folder for cross-device access - add a MEMORY_DIR environment variable:
{
"mcpServers": {
"localmem": {
"command": "/home/user/localmem",
"args": [],
"env": {
"MEMORY_DIR": "/home/user/localmem-memory"
}
}
}
}
6. Verify it's working
Restart LM Studio. In a chat, ask the model to call get_context - it should return an empty context snapshot without errors. You're ready to go.
Other MCP clients
LocalMem works with any MCP-compatible client. The configuration format varies by client but always needs the path to the localmem binary and optionally MEMORY_DIR.
Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"localmem": {
"command": "/home/user/localmem",
"args": []
}
}
}
Claude Desktop (~/.config/Claude/claude_desktop_config.json):
{
"mcpServers": {
"localmem": {
"command": "/home/user/localmem",
"args": []
}
}
}
OpenWebUI: Go to Settings → Tools and add a new tool server pointing to the localmem binary.
Memory layout
memory/
├── general/ ← default category for memories
│ └── my-note.md
├── projects/
│ └── acme.md
├── tasks/ ← tasks & todos
│ └── buy-milk.md
├── entities/ ← knowledge graph nodes
│ └── alice.md
└── relations/ ← knowledge graph edges
└── alice-works-at-acme.md
Relevance scoring
Each memory is scored as:
score = importance × log₂(access_count + 2) / (1 + 0.01 × days_since_access)
Memories decay slowly over time but recover each time they are read. High-importance memories (e.g. importance: 1.0) decay much more slowly than default ones. Tasks are not scored and are unaffected by decay.
Permanent memories
Memories tagged with any of the following tags are immune to decay and always return their raw importance score:
| Tag | Intended use |
|-----|-------------|
| permanent | General-purpose pin |
| core | Fundamental facts that should always be available |
| identity | Information about the user's identity or profile |
| value | Personal values or principles |
| principle | Rules or guidelines the model should always follow |
Example:
---
title: My name is Alex
tags: identity, permanent
importance: 1.0
---
The user's name is Alex. Always address them by name.
Cross-device sync
Set MEMORY_DIR to an iCloud Drive, Dropbox, or any synced folder to share memories across machines.
Suggested system prompt
You have access to a persistent memory system via MCP tools. Use it proactively.
At the start of each conversation, call `get_context` to restore prior context.
Save anything worth remembering across sessions. Before saving, decide on importance (0.0-1.0, default 0.5) and ask the user when unsure. For memories that should never fade, use a permanent tag (`permanent`, `core`, `identity`, `value`, `principle`) and confirm with the user. Search before saving to avoid duplicates.
Use the knowledge graph for people, projects, and named concepts. Add relations to link them, and run `check_facts` before asserting a relationship.
Use tasks for action items, not memories. Ask about priority and due date if not mentioned.
Never wait to be asked. If something contradicts a stored fact, flag it.
Credits
- mcp-go by mark3labs - Go SDK for the Model Context Protocol, used as the server transport layer.
- Model Context Protocol by Anthropic - the open protocol that lets language models communicate with external tools.
- Beledarian's mcp-local-memory - referenced for feature inspiration (knowledge graph, importance scoring, decay, tasks).
- MemPalace - inspiration for the fact-checking feature (similar name detection and relationship mismatch).
- Go - the programming language used to build the binary.