Skip to main content

BrainMemory-MCP

A Model Context Protocol (MCP) server that gives AI/LLM agents a durable brain memory — the ability to store, recall, search, summarize, and forget information across sessions through standardized MCP tool calls.

The server runs in two modes:

  • stdio (default) — the server is launched as a subprocess by an MCP client (e.g. via uvx brainmemory-mcp).
  • web — MCP over HTTP + Server-Sent Events (SSE) with --web, so remote MCP-capable clients (Claude, IDE agents, etc.) can connect over the network.

Memory is persisted locally under ~/.brainmemory-mcp (a SQLite database).

Cognitive Tools

Tool Description
store_memory Persist a new memory (content, category, tags, importance).
recall_memory Fetch a single memory by its id.
search_memory Find memories by free text, category, tags and/or importance.
list_memories List stored memories (most important & recent first).
update_memory Modify an existing memory (only supplied fields change).
forget_memory Delete a memory by id.
summarize_memories Summary statistics: totals, categories, top tags.

A read-only resource brainmemory://stats exposes the same summary as JSON.

Install

From PyPI (once published):

python3 -m pip install brainmemory-mcp

From a local checkout:

python3 -m pip install .

Both install the package and a console script named brainmemory-mcp.

For development (editable install):

python3 -m pip install -e ".[dev]"

To build/publish a release, see docs/RELEASING.md.

Run

stdio mode (default)

Best for local MCP clients that launch the server themselves. Memory in ~/.brainmemory-mcp.

brainmemory-mcp

# Or without the console script
python3 -m brainmemory_mcp

# With a custom memory location
brainmemory-mcp --data-dir /path/to/memory

Web mode (HTTP + SSE)

Enable with --web for remote / networked clients.

# Defaults: 127.0.0.1:8765, memory in ~/.brainmemory-mcp
brainmemory-mcp --web

# Custom host/port and memory location
brainmemory-mcp --web --host 0.0.0.0 --port 9000 --data-dir /path/to/memory

Endpoints once running in web mode:

  • SSE stream: http://<host>:<port>/sse
  • Message POST: http://<host>:<port>/messages/

Configuration

Option Env var Default
--web BRAINMEMORY_WEB false (stdio)
--host BRAINMEMORY_HOST 127.0.0.1
--port BRAINMEMORY_PORT 8765
--data-dir BRAINMEMORY_HOME ~/.brainmemory-mcp

Connect a client

stdio (recommended for local use)

Configure the client to launch the server as a subprocess:

{
  "mcpServers": {
    "brainmemory": {
      "command": "uvx",
      "args": ["brainmemory-mcp"]
    }
  }
}

If installed on your PATH, you can use "command": "brainmemory-mcp" with "args": [] instead.

Web (SSE)

Start the server with --web, then point an SSE-capable client at the /sse endpoint:

{
  "mcpServers": {
    "brainmemory": {
      "url": "http://127.0.0.1:8765/sse"
    }
  }
}

How memory is stored

Memories live in ~/.brainmemory-mcp/memory.db (SQLite, WAL mode). Each memory has: id, content, category, tags, importance (1–5), created_at, updated_at. Nothing is ever silently deleted — removal only happens through forget_memory.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brainmemory_mcp-0.3.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brainmemory_mcp-0.3.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file brainmemory_mcp-0.3.1.tar.gz.

File metadata

  • Download URL: brainmemory_mcp-0.3.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for brainmemory_mcp-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b732a4515a3e7a48b1ebc6aafa63a8bb262a7c88d7d44b5f34a24f45ad943080
MD5 b2822bbe441829c0c61436210f27d607
BLAKE2b-256 123d20b5a2197417356fce0b9f3795a454452dde3d14a65f9a3e28889c657323

See more details on using hashes here.

File details

Details for the file brainmemory_mcp-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for brainmemory_mcp-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85e66955994736aaeb5dd13c03481873983a7b03b92d065a8d4852d81a733752
MD5 c53b4be963cbebcf0a2eea66ec370974
BLAKE2b-256 402eefe7f882aba03350c135ddfecc40806cb458e79b91e754c8c4d58b9f0492

See more details on using hashes here.

Release history Release notifications | RSS feed

0.11.9

2 files

0.11.8

2 files

0.11.7

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.5.0

2 files

0.4.0

2 files

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page