AI代理持久记忆服务

一个为AI编码代理提供跨会话持久记忆的MCP服务器,支持语义搜索和本地运行。

  • by InnVinceable
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 InnVinceable/agent-memcp

使用说明

代理memcp

一个MCP(模型上下文协议)服务器,为AI编码代理提供跨会话的持久内存。代理可以记住项目约定、决策、陷阱以及会话结束时丢失的任何其他上下文。

用途 语义(向量)搜索 由...驱动 all-MiniLM-L6-v2 本地运行-不需要GPU或外部API。

作为一个 stdio MCP服务器 --您的MCP客户端通过以下方式自动将其作为子进程启动 npx,无需管理单独的服务器进程。


安装

无需全局安装。以下所有MCP客户端都使用 npx agent-memcp 它按需下载并运行包,在本地缓存它。

如果您更喜欢全局安装:

npm install -g agent-memcp

连接到您的代理

开源代码

添加到您的OpenCode配置(~/.config/opencode/config.json 或项目级别 .opencode/config.json):

{
  "mcp": {
    "agent-memcp": {
      "type": "local",
      "command": ["npx", "agent-memcp"],
      "enabled": true
    }
  }
}

克劳德桌面版

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "agent-memcp": {
      "command": "npx",
      "args": ["agent-memcp"]
    }
  }
}

重新启动克劳德桌面。记忆工具将自动出现。

克劳德代码

claude mcp add agent-memcp npx agent-memcp

或者手动添加到您的Claude Code MCP配置中:

{
  "mcpServers": {
    "agent-memcp": {
      "command": "npx",
      "args": ["agent-memcp"]
    }
  }
}

光标

增添 .cursor/mcp.json 在项目根目录中,或 ~/.cursor/mcp.json 供全球使用:

{
  "mcpServers": {
    "agent-memcp": {
      "command": "npx",
      "args": ["agent-memcp"]
    }
  }
}

帆板运动

增添 ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "agent-memcp": {
      "command": "npx",
      "args": ["agent-memcp"]
    }
  }
}

其他MCP客户端

任何支持MCP stdio传输的客户端都可以连接。命令是:

npx agent-memcp

要传递环境变量(例如自定义存储路径):

{
  "command": "npx",
  "args": ["agent-memcp"],
  "env": {
    "MEMCP_STORAGE_DIR": "/path/to/custom/dir"
  }
}