Skip to main content
Glama

mcp-memories

一个 MCP 服务器,用于捕获代码构建会话并将其发布到共享的团队知识库,通过语义搜索让过往工作变得可发现。

它的功能:

  • 通过 IDE 钩子(Cursor、Claude Code)自动捕获每个代理会话

  • 当你调用 complete_session 时,使用 Grove AI 进行摘要,并使用 Voyage voyage-code-4 进行嵌入

  • 团队成员使用自然语言搜索——向量搜索 + Voyage 重排序返回最相关的过往构建

设置

1. 安装并构建

npm install
npm run build

2. 配置环境

cp .env.example .env
# Fill in MONGODB_URI, MDB_GROVE_API_KEY, GROVE_BASE_URL, VOYAGE_API_KEY, MEMORIES_AUTHOR

3. 注册 MCP 服务器

添加到你的 IDE 的 MCP 配置中(例如 ~/.cursor/mcp.json 或 Claude Desktop 的 config.json):

{
  "mcpServers": {
    "mcp-memories": {
      "command": "node",
      "args": ["/path/to/mcp-memories/dist/index.js"],
      "env": {
        "MONGODB_URI": "mongodb+srv://...",
        "MEMORIES_DB": "mcp_memories",
        "MDB_GROVE_API_KEY": "...",
        "GROVE_BASE_URL": "...",
        "GROVE_MODEL": "claude-3-7-sonnet",
        "VOYAGE_API_KEY": "...",
        "MEMORIES_AUTHOR": "your.name"
      }
    }
  }
}

4. 设置自动捕获钩子

Cursor — hooks.json 已位于 .cursor/hooks.json。它会在每次 stop 事件时自动触发捕获脚本。

Claude Code — 将 hooks/claude/settings-snippet.json 中的片段合并到你的 ~/.claude/settings.json 中,并更新路径以指向此仓库。

Related MCP server: arcane

工具

工具

使用时机

capture_activity

由钩子自动调用,或手动记录你正在处理的内容

complete_session

完成时调用——触发摘要生成和嵌入,并发布到团队

search_memories

查找与你即将开始的工作相关的过往构建

get_overview

查看团队已构建的内容,按语言/标签/仓库分类

list_recent

浏览最近发布的会话

典型工作流程

# During a session — automatic (hook fires) or manual:
capture_activity(session_id="abc123", conversation_context="Built JWT auth middleware...")

# When done:
complete_session(session_id="abc123", final_notes="Ended up using RS256 instead of HS256 because...")

# Later, someone else starting similar work:
search_memories(query="JWT authentication middleware Node.js")

MongoDB Atlas 设置

服务器在启动时会自动创建自己的索引,包括 Atlas 向量搜索索引(memories_vector_index,1024 维,余弦相似度,voyage-code-4)。你需要一个启用了向量搜索的 Atlas 集群。

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Automatically extracts technical concepts from AI coding conversations, organizes them into a searchable knowledge base with hierarchy and categories, and links them to specific locations in your codebase.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides persistent, searchable memory and knowledge capture for AI-assisted development, enabling agents to retain decisions, bugs, and patterns across sessions and projects.
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables cross-session memory and recall for AI coding assistants through a git-synced knowledge base, hybrid semantic and TF-IDF search across tool transcripts, and automatic distillation of insights with secrets scrubbing.
    6
    181 npm
    18
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables teams to capture and distill knowledge from sessions, meetings, and feeds into a searchable, vector-embedded graph, then retrieve or synthesize it conversationally via semantic search and citations.
    17
    24
    Apache 2.0