Token导航 LogoToken导航TokenDH.com
Memory Forge logo
运维云端未说明官方级别未说明来源级核验

Memory Forge

MCP Server

Memory Forge是一个为AI助手提供持久记忆和上下文感知的完整基础设施解决方案,支持多种存储后端和部署选项。

工具数

0

提示词数

0

GitHub Stars

12

资源数

0
AI记忆TypeScriptClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

cpretzinger

提供方

cpretzinger

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

🧠 Memory Forge-通用AI上下文和存储系统

](https://smithery.ai/server/@cpretzinger/ai-assistant-simple) ![MIT License](https://opensource.org/licenses/MIT)

一个生产就绪的MCP(模型上下文协议)服务器,用于跨Claude、ChatGPT和任何LLM的持久AI内存。

🎯 什么是记忆锻造?

Memory Forge是一个完整的基础设施解决方案,为AI助手提供持久的内存和上下文感知。它包括:

  • MCP服务器:遵循模型上下文协议的基于TypeScript的上下文服务器
  • 多存储:PostgreSQL用于持久化+Redis用于速度+Qdrant用于向量搜索
  • 自动保存:每30秒自动备份一次对话
  • 多用户:支持具有孤立上下文的无限用户
  • 随时随地部署:当地Docker、铁路、Vercel或Smithery

🚀 快速入门(不到5分钟!)

选项1:一个命令设置(推荐)

curl -sSL https://raw.githubusercontent.com/cpretzinger/memory-forge/main/scripts/setup.sh | bash

选项2:手动设置

git clone https://github.com/cpretzinger/memory-forge.git
cd memory-forge
npm install
npm run setup

📦 包含什么

memory-forge/
├── src/                    # TypeScript source code
│   ├── server.ts          # Main MCP server
│   ├── handlers/          # Request handlers
│   ├── storage/           # Storage adapters
│   └── types/             # TypeScript definitions
├── docs/                   # Documentation
│   ├── SERVICES.md        # Service architecture
│   ├── DOCKER.md          # Docker setup guide
│   ├── RAILWAY.md         # Railway deployment
│   └── SMITHERY.md        # Smithery deployment
├── scripts/               # Setup & deployment scripts
│   ├── setup.sh          # Universal setup script
│   ├── deploy.ts         # Deployment helper
│   └── test.ts           # System test script
├── config/               # Configuration files
│   ├── docker-compose.yml
│   ├── railway.toml
│   └── smithery.yml
└── examples/             # Example implementations
    ├── .env.example      # Environment template
    └── claude-config.json

🛠️ 安装

先决条件

  • Node.js 20+
  • Docker(用于本地部署)
  • 最低2GB RAM
  • 10GB磁盘空间

逐步设置

  1. 克隆并安装
git clone https://github.com/cpretzinger/memory-forge.git
cd memory-forge
npm install
  1. 配置环境
cp examples/.env.example .env
# Edit .env with your settings (see Configuration section)
  1. 运行安装脚本
npm run setup
# This will:
# - Check prerequisites
# - Generate secure passwords
# - Set up databases
# - Configure services
# - Start everything
  1. 试验装置
npm test
# Should show all services as ✅ Running

⚙️ 配置

环境变量

创建一个 .env 示例中的文件:

# Project Configuration
PROJECT_NAME=my-ai-assistant
NODE_ENV=production

# Database Credentials (generated by setup script)
POSTGRES_PASSWORD=
REDIS_PASSWORD=
QDRANT_API_KEY=

# MCP Configuration
MCP_AUTH_TOKEN=
MCP_PORT=3005

# API Keys (optional - add your own)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...

# Service URLs (for production)
DATABASE_URL=postgresql://user:pass@host:5432/dbname
REDIS_URL=redis://:password@host:6379
QDRANT_URL=http://host:6333

Claude代码配置

添加到您的Claude桌面配置(~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "memory-forge": {
      "command": "node",
      "args": ["/path/to/memory-forge/dist/bridge.js"],
      "env": {
        "MCP_SERVER_URL": "http://localhost:3005/mcp",
        "MCP_AUTH_TOKEN": "your-token-here",
        "AUTO_SAVE": "true"
      }
    }
  }
}

🚢 部署选项

本地Docker(开发)

npm run docker:up
# Access at http://localhost:3005

铁路(生产)

npm run deploy:railway
# Follow prompts to configure

Smithery(管理MCP)

npm run deploy:smithery
# Or use Smithery CLI:
smithery publish cpretzinger/memory-forge

Vercel(无服务器)

npm run deploy:vercel
# Configure environment variables in Vercel dashboard

🔌 与Smithery一起使用

从Smithery注册表安装

  1. 查找服务器:
smithery search memory-forge
  1. 直接安装到Claude中:
smithery install cpretzinger/memory-forge
  1. 或者手动添加到配置中:
{
  "mcpServers": {
    "memory-forge": {
      "command": "npx",
      "args": ["-y", "@smithery/memory-forge"],
      "env": {
        "API_KEY": "your-api-key"
      }
    }
  }
}

发布你自己的叉子

  1. 创建Smithery帐户:
smithery auth
  1. 配置smithery.yml:
name: memory-forge
version: 1.0.0
description: Universal AI memory system
author: yourname
runtime: typescript
  1. 发布:
smithery publish

📊 建筑

服务概述

服务目的港口技术
MCP服务器上下文API3005TypeScript/Express
PostgreSQL持久存储5432PostgreSQL 16
Redis缓存和会话6379 Redis 7
Qdrant矢量搜索6333Qdrant
n8n自动化5678n8n(可选)

数据流

graph LR
    A[Claude/LLM] -->|MCP Protocol| B[MCP Server]
    B --> C[Redis Cache]
    B --> D[PostgreSQL]
    B --> E[Qdrant Vectors]
    C -->|Fast Read| B
    D -->|Persistent| B
    E -->|Semantic Search| B

🔧 api参考

可用工具

store_context

使用自动保存功能存储对话上下文

{
  sessionId?: string,  // Optional, auto-generated if not provided
  userId?: string,     // Optional user identifier
  context: object,     // Required context data
  metadata?: object    // Optional metadata
}

retrieve_context

检索对话上下文

{
  sessionId?: string,  // Optional, gets latest if not provided
  userId?: string      // Optional user filter
}

search_context

搜索所有上下文

{
  query: string,       // Required search query
  limit?: number,      // Optional result limit (default: 10)
  semantic?: boolean   // Use vector search (default: false)
}

list_sessions

列出所有可用会话

{
  userId?: string,     // Optional user filter
  limit?: number       // Optional limit (default: 10)
}

🧪 测试

运行所有测试

npm test

测试特定服务

npm run test:mcp      # Test MCP server
npm run test:storage  # Test storage layer
npm run test:e2e      # End-to-end tests

手动测试

# Test MCP endpoint
curl -X POST http://localhost:3005/mcp \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

🔒 安全

默认安全功能

  • 自动生成的安全密码(32+个字符)
  • 所有端点上的承载令牌身份验证
  • 孤立的用户上下文
  • 敏感数据的加密存储
  • 日志或错误消息中没有密码

生产硬化

  1. 使用环境特定 .env 文件
  2. 在生产环境中启用HTTPS/TLS
  3. 设置防火墙规则
  4. 使用机密管理(AWS机密管理器等)
  5. 启用审核日志记录

📈 监控

健康检查

# Check all services
npm run health

# Individual checks
curl http://localhost:3005/health

指标

  • 请求延迟
  • 存储使用情况
  • 活动会话
  • 缓存命中率

🤝 贡献

我们欢迎捐款!请看 贡献.md 作为指导方针。

开发设置

# Install dev dependencies
npm install --save-dev

# Run in development mode
npm run dev

# Run with hot reload
npm run dev:watch

📝 许可证

MIT许可证-请参阅 许可证 文件

🆘 支持

常见问题

Q: 服务无法启动?

# Reset everything
npm run reset
npm run setup

Q: 无法连接到MCP服务器?

# Check if running
npm run health

# Check logs
docker logs memory-forge-mcp

Q: 如何升级?

git pull
npm install
npm run migrate

获得帮助

🚀 路线图

  • \[\]OpenAI函数调用支持
  • \[\]LangChain集成
  • \[\]Web UI仪表板
  • \[\]备份/恢复工具
  • \[\]多区域支持
  • \[\]GraphQL API

______________________________________________________________________

内置于❤️ 由Memory Forge团队提供

目录标签

目录标签

AI记忆TypeScriptClaude本地部署上下文感知持久存储多用户支持向量搜索

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP