npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

personal-memory-mcp-server

v1.0.1

Published

A MCP server for personal memory storage and retrieval across AI models

Readme

Personal Memory MCP Server

一个基于MCP(Model Context Protocol)的个人记忆存储服务,用于解决AI模型之间记忆不互通的问题。通过这个服务,您可以在不同的AI模型之间共享和迁移个人记忆数据。

功能特性

  • 📝 记忆存储: 按日期和内容存储关键信息
  • 🔍 智能搜索: 支持关键词、日期范围、标签搜索
  • 🏷️ 标签管理: 为记忆添加分类标签
  • 重要性等级: 1-5级重要性分级
  • 📊 统计分析: 记忆数量和分布统计
  • 🔗 跨模型兼容: 通过MCP协议支持各种AI模型

技术架构

  • 后端: Node.js(20+) + TypeScript + ES6模块
  • MCP SDK: @modelcontextprotocol/sdk
  • 数据库: Supabase PostgreSQL
  • 接口: MCP工具和资源协议

快速开始(推荐)

使用 npx 一键安装

# 直接运行,无需克隆项目
npx personal-memory-mcp

# 这会自动启动MCP服务器

配置步骤

  1. 准备Supabase数据库
    • 访问 Supabase 创建项目
    • 在SQL编辑器中执行以下Schema创建表结构:
    • 注意一定要执行SQL才可以正常存储数据
-- 创建UUID扩展
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

-- 创建memories表
CREATE TABLE memories (
    id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
    title TEXT NOT NULL,
    content TEXT NOT NULL,
    date DATE NOT NULL,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    tags TEXT[] DEFAULT '{}',
    importance_level INTEGER DEFAULT 1 CHECK (importance_level >= 1 AND importance_level <= 5)
);

-- 创建索引
CREATE INDEX idx_memories_date ON memories(date);
CREATE INDEX idx_memories_created_at ON memories(created_at);
CREATE INDEX idx_memories_importance_level ON memories(importance_level);
CREATE INDEX idx_memories_tags ON memories USING GIN(tags);
CREATE INDEX idx_memories_content_search ON memories USING GIN(to_tsvector('english', content));
CREATE INDEX idx_memories_title_search ON memories USING GIN(to_tsvector('english', title));

-- 更新触发器
CREATE OR REPLACE FUNCTION update_updated_at_column()
RETURNS TRIGGER AS $$
BEGIN
    NEW.updated_at = NOW();
    RETURN NEW;
END;
$$ language 'plpgsql';

CREATE TRIGGER update_memories_updated_at
    BEFORE UPDATE ON memories
    FOR EACH ROW
    EXECUTE FUNCTION update_updated_at_column();
  1. 配置Claude Desktop

在Claude Desktop配置文件中添加:

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

{
  "mcpServers": {
    "personal-memory": {
      "command": "npx",
      "args": ["personal-memory-mcp"],
      "env": {
        "SUPABASE_URL": "https://your-project.supabase.co",
        "SUPABASE_KEY": "your-supabase-anon-key"
      }
    }
  }
}
  1. 重启Claude Desktop,即可开始使用!

手动安装(开发者)

# 克隆项目
git clone <your-repo-url>
cd PersonalMemory

# 安装依赖
npm install

# 构建项目
npm run build

# 运行服务器
npm start

# 开发模式(自动重载)
npm run dev

MCP工具说明

记忆管理工具

create_memory

创建新的个人记忆

参数:

  • title (必需): 记忆标题或时间戳
  • content (必需): 记忆内容
  • date (可选): 日期 (YYYY-MM-DD),默认今天
  • tags (可选): 标签数组
  • importance_level (可选): 重要级别 (1-5)

search_memories

搜索记忆

参数:

  • query (可选): 搜索关键词
  • date_from (可选): 开始日期
  • date_to (可选): 结束日期
  • tags (可选): 标签过滤
  • importance_level (可选): 重要级别过滤
  • limit (可选): 结果数量限制

get_memory

根据ID获取特定记忆

参数:

  • id (必需): 记忆的UUID

update_memory

更新现有记忆

参数:

  • id (必需): 记忆的UUID
  • title (可选): 新标题
  • content (可选): 新内容
  • tags (可选): 新标签
  • importance_level (可选): 新重要级别

delete_memory

删除记忆

参数:

  • id (必需): 记忆的UUID

快速访问工具

get_today_memories

获取今天的所有记忆

get_recent_memories

获取最近的记忆

参数:

  • limit (可选): 数量限制,默认10

get_memory_stats

获取记忆统计信息

参数:

  • date_from (可选): 统计开始日期
  • date_to (可选): 统计结束日期

数据结构

Memory对象

interface Memory {
  id: string;              // UUID
  title: string;           // 标题或时间戳
  content: string;         // 记忆内容
  date: string;            // 日期 (YYYY-MM-DD)
  created_at: Date;        // 创建时间
  updated_at: Date;        // 更新时间
  tags?: string[];         // 标签数组
  importance_level?: number; // 重要程度 (1-5)
}

与AI模型集成

Claude Code集成

  1. 在Claude Code中添加MCP服务器配置
  2. 使用提供的工具进行记忆操作

其他模型集成

任何支持MCP协议的AI模型都可以通过标准MCP接口访问记忆数据。

开发说明

项目结构

src/
├── index.ts              # MCP服务器主入口
├── database/
│   └── connection.ts     # Supabase数据库连接
├── types/
│   └── memory.ts         # 类型定义
└── utils/                # 工具函数

database/
└── schema.sql            # 数据库表结构

dist/                     # 编译输出目录

开发工具

# 类型检查
npm run build

# 实时开发
npm run dev

许可证

MIT License

贡献

欢迎提交Issue和Pull Request来改进这个项目!