Skip to main content
Glama
jameslovespancakes

Hippocampus Memory MCP Server

๐Ÿง  Hippocampus Memory MCP Server

Persistent, Semantic Memory for Large Language Models

Python 3.9+ MCP License: MIT

Features โ€ข Installation โ€ข Quick Start โ€ข Documentation โ€ข Architecture


๐Ÿ“– Overview

A Python-based Model Context Protocol (MCP) server that gives LLMs persistent, hippocampus-inspired memory across sessions. Store, retrieve, consolidate, and forget memories using semantic similarity search powered by vector embeddings.

Why Hippocampus? Just like the human brain's hippocampus consolidates short-term memories into long-term storage, this server intelligently manages LLM memory through biological patterns:

  • ๐Ÿ”„ Consolidation - Merge similar memories to reduce redundancy

  • ๐Ÿงน Forgetting - Remove outdated information based on age/importance

  • ๐Ÿ” Semantic Retrieval - Find relevant memories through meaning, not keywords

Related MCP server: Recall

โœจ Features

Feature

Description

๐Ÿ—„๏ธ Vector Storage

FAISS-powered semantic similarity search

๐ŸŽฏ MCP Compliant

Full MCP 1.2.0 spec compliance via FastMCP

๐Ÿงฌ Bio-Inspired

Hippocampus-style consolidation and forgetting

๐Ÿ”’ Security

Input validation, rate limiting, injection prevention

๐Ÿ”Ž Semantic Search

Sentence transformer embeddings (CPU-optimized)

โ™พ๏ธ Unlimited Storage

No memory count limits, only per-item size limits

๐Ÿ†“ 100% Free

Local embedding model - no API costs

๐Ÿš€ Quick Start

5 Core MCP Tools

memory_read         # ๐Ÿ” Retrieve memories by semantic similarity
memory_write        # โœ๏ธ  Store new memories with tags & metadata
memory_consolidate  # ๐Ÿ”„ Merge similar memories
memory_forget       # ๐Ÿงน Remove memories by age/importance/tags
memory_stats        # ๐Ÿ“Š Get system statistics

๐Ÿ“ฆ Installation

pip install hippocampus-memory-mcp

Prerequisites: Python 3.9+ โ€ข ~200MB disk space (for embedding model)

Claude Desktop Integration

Add to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "memory": {
      "command": "python",
      "args": ["-m", "memory_mcp_server.server"]
    }
  }
}

๐ŸŽ‰ That's it! Claude will now have persistent memory across conversations.

Install from Source (Alternative)

# Clone the repository
git clone https://github.com/jameslovespancakes/Memory-MCP.git
cd Memory-MCP

# Install dependencies
pip install -r requirements.txt

# Run the server
python -m memory_mcp_server.server

๐Ÿ“š Documentation

Memory Operations via MCP

Once connected to Claude, use natural language:

"Remember that I prefer Python for backend development"
โ†’ Claude calls memory_write()

"What do you know about my programming preferences?"
โ†’ Claude calls memory_read()

"Consolidate similar memories to clean up storage"
โ†’ Claude calls memory_consolidate()

Direct API Usage

โœ๏ธ Writing Memories

from memory_mcp_server.storage import MemoryStorage
from memory_mcp_server.tools import MemoryTools

storage = MemoryStorage(storage_path="my_memory")
await storage._ensure_initialized()
tools = MemoryTools(storage)

# Store with tags and importance
await tools.memory_write(
    text="User prefers dark mode UI",
    tags=["preference", "ui"],
    importance_score=3.0,
    metadata={"category": "settings"}
)

๐Ÿ” Reading Memories

# Semantic search
result = await tools.memory_read(
    query_text="What are my UI preferences?",
    top_k=5,
    min_similarity=0.3
)

# Filter by tags and date
result = await tools.memory_read(
    query_text="Python learning",
    tags=["learning", "python"],
    date_range_start="2024-01-01"
)

๐Ÿ”„ Consolidating Memories

# Merge similar memories (threshold: 0.85)
result = await tools.memory_consolidate(similarity_threshold=0.85)
print(f"Merged {result['consolidated_groups']} groups")

๐Ÿงน Forgetting Memories

# Remove by age
await tools.memory_forget(max_age_days=30)

# Remove by importance
await tools.memory_forget(min_importance_score=2.0)

# Remove by tags
await tools.memory_forget(tags_to_forget=["temporary"])

Testing

Run the included test suite:

python test_memory.py

This tests all 5 operations with sample data.

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  MCP Client (Claude Desktop, etc.)                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚ JSON-RPC over stdio
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  FastMCP Server (server.py)                         โ”‚
โ”‚  โ”œโ”€ memory_read                                     โ”‚
โ”‚  โ”œโ”€ memory_write                                    โ”‚
โ”‚  โ”œโ”€ memory_consolidate                              โ”‚
โ”‚  โ”œโ”€ memory_forget                                   โ”‚
โ”‚  โ””โ”€ memory_stats                                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Memory Tools (tools.py)                            โ”‚
โ”‚  โ”œโ”€ Input validation & sanitization                โ”‚
โ”‚  โ””โ”€ Rate limiting (100 req/min)                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Storage Layer (storage.py)                         โ”‚
โ”‚  โ”œโ”€ Sentence Transformers (all-MiniLM-L6-v2)       โ”‚
โ”‚  โ”œโ”€ FAISS Vector Index (cosine similarity)         โ”‚
โ”‚  โ””โ”€ JSON persistence (memories.json)               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”„ Memory Lifecycle

Step

Process

Technology

๐Ÿ“ Write

Text โ†’ 384-dim vector embedding

Sentence Transformers (CPU)

๐Ÿ’พ Store

Normalized vector โ†’ FAISS index

FAISS IndexFlatIP

๐Ÿ” Search

Query โ†’ embedding โ†’ top-k similar

Cosine similarity

๐Ÿ”„ Consolidate

Group similar (>0.85) โ†’ merge

Vector clustering

๐Ÿงน Forget

Filter by age/importance/tags โ†’ delete

Metadata filtering

๐Ÿ”’ Security

Protection

Implementation

๐Ÿ›ก๏ธ Injection Prevention

Regex filtering of script tags, eval(), path traversal

โฑ๏ธ Rate Limiting

100 requests per 60-second window per client

๐Ÿ“ Size Limits

50KB text, 5KB metadata, 20 tags per memory

โœ… Input Validation

Pydantic models + custom sanitization

๐Ÿ” Safe Logging

stderr only (prevents JSON-RPC corruption)

โš™๏ธ Configuration

Environment Variables

MEMORY_STORAGE_PATH="memory_data"           # Storage directory
EMBEDDING_MODEL="all-MiniLM-L6-v2"          # Model name
RATE_LIMIT_REQUESTS=100                     # Max requests
RATE_LIMIT_WINDOW=60                        # Time window (seconds)

Storage Limits

  • โœ… Unlimited total memories (no count limit)

  • โš ๏ธ Per-memory limits: 50KB text, 5KB metadata, 20 tags

๐Ÿ› Troubleshooting

First run downloads all-MiniLM-L6-v2 (~90MB). Ensure internet connection and ~/.cache/ write permissions.

pip uninstall torch transformers sentence-transformers -y
pip install torch==2.1.0 transformers==4.35.2 sentence-transformers==2.2.2

The model runs on CPU. Ensure 2GB+ free RAM. Reduce top_k in read operations if needed.

๐Ÿ“ License

MIT License - feel free to use in your projects!

๐Ÿค Contributing

PRs welcome! Please:

  • Follow MCP security guidelines

  • Add tests for new features

  • Update documentation

๐Ÿ”— Resources


Built with ๐Ÿง  for persistent LLM memory

Report Bug ยท Request Feature

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides AI agents with persistent, searchable memory that survives across conversations using semantic search, temporal versioning, and smart organization. Enables long-term context retention and cross-session continuity for AI assistants.
    14
    -
  • F
    license
    A
    quality
    Not graded
    maintenance
    Provides long-term memory storage for AI assistants with semantic search, enabling persistent storage of preferences, decisions, and context with relationship tracking between memories.
    19
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides persistent AI agent memory using a local vector database for long-term semantic storage and short-term session scratchpads. It enables low-latency memory operations including search, storage, and bulk management without external cloud dependencies.
    -
  • A
    license
    A
    quality
    D
    maintenance
    Provides persistent long-term memory for AI agents through semantic search and automated knowledge graph extraction. It enables agents to store, recall, and reason over facts, preferences, and relationships across multiple conversations and sessions.
    14
    19
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jameslovespancakes/Memory-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server