Memory-Man

Memory-Man

MCP server that provides persistent long-term memory for Claude Code, enabling storage, search, and retrieval of project knowledge across sessions.

Category
访问服务器

README

Memory-Man 🧠

A persistent memory system for Claude Code that solves the context window problem by storing and retrieving project knowledge across sessions.

What is Memory-Man?

Memory-Man is an MCP (Model Context Protocol) server that acts as Claude's long-term memory. Instead of losing context when the conversation window fills up, Claude can now:

  • Store important information about your projects
  • Search through past conversations and decisions
  • Retrieve relevant context when working on similar problems
  • Track patterns across multiple projects

Features

  • 🗂️ Project-Aware Storage - Memories are organized by project
  • 🔍 Smart Search - Find relevant memories by content, tags, or category
  • 📊 Usage Analytics - Track which memories are most valuable
  • 🏷️ Intelligent Tagging - Categorize memories for easy retrieval
  • ⚡ Fast SQLite Backend - Efficient local storage
  • 🔧 Easy Integration - Works with Claude Code out of the box

Quick Start

  1. Install Dependencies:

    source venv/bin/activate
    pip install -r requirements-core.txt
    
  2. Test the Server:

    python test_server.py
    
  3. Configure Claude Code (see Integration Guide below)

Memory Categories

  • architecture - System design decisions and patterns
  • setup - Project configuration and environment
  • bug_fix - Solutions to bugs and issues
  • todo - Future work and planned features
  • pattern - Reusable code patterns and best practices
  • command - Useful commands and scripts

Integration with Claude Code

Method 1: Global MCP Configuration

Add to your global Claude Code config (~/.claude/mcp_servers.json):

{
  "mcpServers": {
    "memory-man": {
      "command": "python",
      "args": ["-m", "memory_man"],
      "env": {
        "PYTHONPATH": "/home/beano/DevProjects/python/memory-man/src"
      }
    }
  }
}

Method 2: Project-Specific Configuration

Add mcp_config.json to any project:

{
  "mcpServers": {
    "memory-man": {
      "command": "python",
      "args": ["-m", "memory_man"],
      "env": {
        "PYTHONPATH": "/home/beano/DevProjects/python/memory-man/src"
      }
    }
  }
}

Usage Examples

🚀 Smart Auto-Store (Recommended)

# Just provide the content - everything else is auto-detected!
memory_auto_store(
    content="We use JWT tokens with Redis for session management. Tokens expire after 24 hours."
)

# Auto-detects:
# - Project: current directory name
# - Category: architecture (based on content)  
# - Tags: ["jwt", "redis", "auth", "database"]
# - Framework: detected from project files

🔍 Smart Project Detection

# Analyze your current project
project_detect()

# Returns project info + suggestions:
# - Technology stack (Python, JavaScript, etc.)
# - Framework (Django, React, FastAPI, etc.) 
# - Recommended memory categories
# - Setup suggestions

🧠 Context-Aware Suggestions

# Get relevant memories for current work
memory_suggest_related(context="authentication setup")

# Returns:
# - Related memories from current project
# - Similar patterns from other projects
# - Smart suggestions based on context

📝 Manual Storage (When You Need Control)

# Store architecture decision manually
memory_store(
    content="We use Redis for session storage with 24-hour TTL",
    category="architecture", 
    project="my-web-app",
    tags=["redis", "sessions", "auth"],
    importance=8
)

# Search memories
memory_search(query="authentication", project="my-web-app")

# Get project overview
project_summary(project="my-web-app")

Available Tools

Core Tools

Tool Description
memory_store Store new memories with project context
memory_search Search memories by query, project, or category
memory_retrieve Get a specific memory by ID
memory_update Update existing memories
memory_delete Delete memories
project_summary Get summary of a project's memories
memory_list_projects List all projects with memories

Smart Tools ✨

Tool Description
memory_auto_store Auto-detect project, category, and tags
project_detect Analyze current project and get suggestions
memory_suggest_related Find relevant memories for current context

Advanced Tools 🔧

Tool Description
memory_summarize_project Generate intelligent project summaries
memory_analyze_storage Analyze and optimize memory usage
memory_suggest_archival Find memories ready for archival
memory_archive Archive memories manually
memory_unarchive Restore archived memories
memory_cleanup Automatic memory lifecycle management

Configuration

Environment variables (optional):

# Database location
MEMORY_MAN_DATABASE_URL=sqlite+aiosqlite:///./data/memories.db

# Storage directory
MEMORY_MAN_DATA_DIR=./data

# Search settings
MEMORY_MAN_SEARCH_LIMIT=20
MEMORY_MAN_MAX_MEMORY_SIZE=10000

# Logging
MEMORY_MAN_LOG_LEVEL=INFO
MEMORY_MAN_DEBUG=false

Development

Running Tests

python test_server.py

Code Quality

# Format code
black src/

# Lint code
ruff check src/

# Type checking
mypy src/

Adding New Features

  1. Models: Add to src/memory_man/models/
  2. Tools: Add to src/memory_man/server.py
  3. Config: Update src/memory_man/config.py

Troubleshooting

Server Won't Start

  • Check Python path in MCP configuration
  • Ensure virtual environment is properly set up
  • Verify all dependencies are installed

Memory Search Issues

  • Check if database exists in data/memories.db
  • Verify project names match exactly
  • Try broader search terms

Performance Issues

  • Database will be created automatically on first run
  • Consider adding indexes for large datasets
  • Use importance levels to prioritize memories

Contributing

This is designed as a personal tool for your Claude Code workflow. Feel free to modify:

  • Add new memory categories
  • Implement semantic search
  • Add memory expiration
  • Create backup/sync features

License

MIT License - Feel free to use and modify as needed.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选