# MCP Pocket Memory
Small MCP server for durable AI memory backed by SQLite.
## Features
- Store, update, delete, and search memories.
- Optional `repo` field for project-specific context.
- Optional custom tags for faster filtering.
- Broad keyword search across key, content, repo, and tags.
- SQLite WAL mode for light parallel agent usage.
- Cached `find_memory` results with TTL.
## Build
```bash
cargo build --release
```
## Install
From crates.io:
https://crates.io/crates/mcp-pocket-memory
```bash
cargo install mcp-pocket-memory
```
From GitHub Releases:
https://github.com/robby031/mcp-pocket-memory/releases
## Init Database
```bash
mcp-pocket-memory init
```
Default database path: `~/.mcp-pocket-memory/pocket_memory.sqlite3`.
## MCP Config
```json
{
"mcpServers": {
"pocket-memory": {
"command": "/path/to/mcp-pocket-memory",
"args": ["serve"],
"env": {
"POCKET_MEMORY_FIND_CACHE_CAPACITY": "512",
"POCKET_MEMORY_FIND_CACHE_TTL_SECS": "30"
}
}
}
}
```
To use a custom database path, set `POCKET_MEMORY_DB`.
## Tools
### `upsert_memory`
Insert or update a memory by key.
```json
{
"key": "repo-error-handling",
"repo": "my-repo",
"tags": ["convention", "error-handling"],
"content": "Use structured errors for service boundaries. Keep user-facing messages separate from internal debug context."
}
```
### `find_memory`
Find relevant memories. Can be called without filters to load recent context.
```json
{
"repo": "my-repo",
"keyword": "error handling",
"tags": ["convention"],
"limit": 10
}
```
### `delete_memory`
Delete a memory by exact key.
```json
{
"key": "repo-error-handling"
}
```
## Release
GitHub Actions builds release binaries when pushing a tag:
```bash
git tag v0.4.0
git push origin v0.4.0
```