mcp-openmemory

mcp-openmemory

Enables Claude to remember conversations and learn over time by storing and recalling messages, memory abstracts, and recent history using a local SQLite database.

Category
访问服务器

README

MCP OpenMemory Server

npm version License: MIT MCP

Gives Claude the ability to remember your conversations and learn from them over time.

https://github.com/user-attachments/assets/aef82b8e-3793-4ebd-b993-ddaef14d52d1

Features

  • Memory Storage: Save and recall conversation messages
  • Memory Abstracts: Maintain summarized memory context across conversations
  • Recent History: Access recent conversations within configurable time windows
  • Local Database: Uses SQLite for persistent storage without external dependencies

⚠️ Important

You must configure MEMORY_DB_PATH to a persistent location to avoid losing your conversation history when Claude Desktop closes. If not configured, the database defaults to ./memory.sqlite in a temporary location that may be cleared when the application restarts.

Configuration

Prerequisites

  • Node.js: Required to run the MCP server. Verify installation with:

    node --version
    

    If not installed, download from nodejs.org

  • Claude Desktop: Download the latest version for macOS or Windows

Claude Desktop Integration

Configuration File Location

The Claude Desktop configuration file is located at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

To access: Open Claude Desktop → Claude menu → Settings → Developer → Edit Config

macOS/Linux

Run directly using npm

{
  "mcpServers": {
    "mcp-openmemory": {
      "command": "npx",
      "args": [
        "@peakmojo/mcp-openmemory@latest"
      ],
      "env": {
        "MEMORY_DB_PATH": "/Users/username/mcp-memory.sqlite"
      }
    }
  }
}

Windows

Run directly using npm

{
  "mcpServers": {
    "mcp-openmemory": {
      "command": "npx",
      "args": [
        "@peakmojo/mcp-openmemory@latest"
      ],
      "env": {
        "MEMORY_DB_PATH": "C:\\Users\\username\\mcp-memory.sqlite"
      }
    }
  }
}

Run from source (all platforms)

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["/path/to/your/repo/server.js"],
      "env": {
        "MEMORY_DB_PATH": "/path/to/your/memory.sqlite"
      }
    }
  }
}

Environment Variables

  • MEMORY_DB_PATH: Path to SQLite database file (default: ./memory.sqlite)

Verification

After configuring and restarting Claude Desktop, you should see:

  1. Slider Icon (🔧) in the bottom left of the input box
  2. Available Tools when clicking the slider:
    • save_memory
    • recall_memory_abstract
    • update_memory_abstract
    • get_recent_memories

Troubleshooting

Server Not Showing Up

  1. Restart Claude Desktop completely
  2. Check JSON syntax in your configuration file
  3. Verify paths are absolute (not relative) and exist
  4. Test manual server start:
    # Test if the server runs correctly
    npx @peakmojo/mcp-openmemory@latest
    

Check Logs

Log Locations:

  • macOS: ~/Library/Logs/Claude/
  • Windows: %APPDATA%\Claude\logs\

View recent logs:

# macOS/Linux
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

# Windows  
type "%APPDATA%\Claude\logs\mcp*.log"

Common Issues

  • ENOENT errors on Windows: Add APPDATA to your env configuration
  • Tool calls failing: Check server logs for errors
  • NPM not found: Install NPM globally with npm install -g npm

For detailed troubleshooting, see the official MCP documentation.

Security Note

⚠️ Claude Desktop runs MCP servers with your user account permissions. Only install servers from trusted sources.

Available Tools

  • save_memory: Store individual conversation messages
  • recall_memory_abstract: Get current memory summary
  • update_memory_abstract: Update the memory summary
  • get_recent_memories: Retrieve recent conversation history

Usage

The server starts automatically when configured with Claude Desktop. The database will be created automatically on first use.

Example System Prompt

# Memory Usage Guidelines

You should use memory tools thoughtfully to enhance conversation continuity and context retention:

## When to Save Memory
- **save_memory**: Store significant conversation exchanges, important decisions, user preferences, or key context that would be valuable to remember in future conversations
- Focus on information that has lasting relevance rather than temporary details
- Save when users share important personal information, project details, or ongoing work context

## When to Update Memory Abstract  
- **update_memory_abstract**: After processing recent conversations, combine new important information with existing context to create an improved summary
- Update when there are meaningful developments in ongoing projects or relationships
- Consolidate related information to maintain coherent context over time

## When to Recall Memory
- **recall_memory_abstract**: Use at the beginning of conversations to understand previous context, or when you need background information to better assist the user
- **get_recent_memories**: Access when you need specific details from recent exchanges that aren't captured in the abstract
- Recall when the user references previous conversations or when context would significantly improve your assistance

## What Constitutes Critical Information
- User preferences and working styles
- Ongoing projects and their current status  
- Important personal or professional context
- Decisions made and their rationale
- Key relationships or collaborations mentioned
- Technical specifications or requirements for recurring tasks

Use these tools to build continuity and provide more personalized assistance, not as error-prevention mechanisms or intent-guessing systems.

🔀 Namespacing Memory by Project

You can separate memory per project in two ways:

1. Hard Separation (Claude vs Cursor)

Use different MEMORY_DB_PATH in each app's config:

  • Claude (claude_desktop_config.json):
"mcpServers": {
  "claude-memory": {
    "command": "npx",
    "args": ["@peakmojo/mcp-openmemory@latest"],
    "env": {
      "MEMORY_DB_PATH": "/Users/you/claude-memory.sqlite"
    }
  }
}
  • Cursor (.cursor/config.json or tool config):
"mcpServers": {
  "cursor-memory": {
    "command": "npx",
    "args": ["@peakmojo/mcp-openmemory@latest"],
    "env": {
      "MEMORY_DB_PATH": "/Users/you/cursor-memory.sqlite"
    }
  }
}

Each app runs its own instance, storing to its own DB.

2. Soft Namespacing via context

When calling memory tools, pass a custom "context":

{ "context": "project-x", "message": "Notes from project X." }

Use this to segment memory logically within the same database.

🔍 Semantic search is not supported yet. Open a GitHub issue if needed.

References

License

MIT License

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选