Token导航 LogoToken导航TokenDH.com
GitHub Memory Server logo
开发工具未说明官方级别未说明来源级核验

GitHub Memory Server

MCP Server

一个高性能的MCP服务器,支持将内存存储在GitHub仓库或本地文件系统中,提供全文搜索、加密和多项目管理功能。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
RustCursor全文搜索Cursor

安装说明

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

作者 / 组织

panosAthDBX

提供方

panosAthDBX

最后核验

2026/5/17 20:19

快速接入

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

详细介绍

MCP GitHub内存服务器

一个高性能的MCP(模型上下文协议)服务器,用Rust编写,将内存存储在GitHub存储库或本地文件系统中。

![License](LICENSE) ](https://www.rust-lang.org)

概述

此MCP服务器提供与基本内存协议的直接兼容性,同时提供以下强大功能:

  • GitHub存储:将内存存储在具有完整版本历史记录的GitHub存储库中
  • 本地存储:适用于气隙环境的离线第一本地文件系统存储
  • 快速搜索:使用milli-core(LMDB)进行嵌入式全文搜索,BM25排名
  • 加密:使用X25519的可选端到端加密
  • 多项目:在孤立的项目中组织记忆
  • 自动同步:每次写入操作后自动推送到远程

快速开始

安装

# Clone the repository
git clone https://github.com/yourusername/mcp-github-memory-server.git
cd mcp-github-memory-server

# Build the release binary
cargo build --release --features backend-github,index-tantivy,encryption,mcp-gitmem-storage-github/remote-git

# Install using the provided script
./scripts/install.sh

macOS用户:如果遇到“Killed:9”错误,请运行:

./scripts/fix-macos-security.sh

docs/故障排除/macos-security.md 了解详情。

配置

  1. 获取GitHub个人访问令牌 (适用于GitHub存储):

- 访问:https://github.com/settings/tokens - 使用创建令牌 repo 范围 - 安全保存令牌

  1. 配置您的MCP客户端 (例如,光标):

创建或编辑 ~/.cursor/mcp.json:

{
  "mcpServers": {
    "gitmem": {
      "command": "/usr/local/bin/gitmem",
      "args": ["serve", "--config", "/path/to/gitmem.yaml"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}
  1. 创建配置文件 (例如。, ~/.config/gitmem.yaml):
server:
  transport: stdio

storage:
  backend: github

github:
  root: /Users/yourname/memory
  auto_push: true
  remote_url: https://github.com/yourusername/memory.git
  credentials:
    mode: token
    username: x-access-token
    secret_env: GITHUB_TOKEN

encryption:
  enabled: false

index:
  engine: tantivy
  1. 重新启动MCP客户端 加载新配置。

建筑

┌─────────────────────────────────────────────────────────────────┐
│                    MCP Client (IDE, Agent)                      │
│           JSON-RPC over stdio or WebSocket                      │
└──────────────┬──────────────────────────────────────────────────┘
               │
        JSON-RPC server (MCP)
               │
┌──────────────▼─────────────────────┐
│        Memory Service Layer        │
│  validation, ID generation, merge  │
└──────────────┬─────────────────────┘
               │
       Storage abstraction
     ┌─────────┴───────────┬────────────┐
     │                     │            │
┌────▼────┐          ┌─────▼─────┐ ┌────▼─────┐
│ GitHub  │          │ Local FS  │ │ Ephemeral│
│ adapter │          │ adapter   │ │ adapter  │
└────┬────┘          └─────┬─────┘ └────┬─────┘
     │                     │            │
     │        ┌────────────▼────────────┐
     │        │   Search Index Engine   │
     │        │  (milli-core or Tantivy)│
     │        └────────────┬────────────┘
     │                     │
     │        ┌────────────▼────────────┐
     │        │   Crypto (optional)     │
     │        │   age X25519            │
     │        └─────────────────────────┘

特性

MCP工具兼容性

与基本内存协议完全兼容,并具有扩展功能:

核心内存操作:

  • memory.save -创造新的回忆
  • memory.get -按ID检索
  • memory.search -带过滤器的全文搜索
  • memory.update -修补现有内存
  • memory.delete -软删除或硬删除
  • memory.import.basic -从JSONL导入
  • memory.sync -与存储后端同步

项目管理:

  • list_memory_projects -列出所有项目
  • create_memory_project -创建新项目
  • delete_memory_project -删除项目

知识库(基本内存兼容性):

  • write_note, read_note, edit_note, delete_note
  • search_notes, recent_activity, build_context
  • move_note -在项目之间移动笔记

外部文件夹链接:

  • project.link_folder -链接外部文件夹(例如黑曜石保险库)
  • project.unlink_folder -删除链接文件夹
  • project.list_links -列出所有文件夹链接

存储后端

GitHub存储:

  • 完整的git历史记录和审计跟踪
  • 设备特定分支(devices/)
  • 每次写入时自动推送(可选)
  • 通过三方合并解决冲突
  • 拉取请求工作流(可选)

本地存储:

  • 离线首次操作
  • 使用fsync进行原子文件操作
  • 用于并发访问的文件锁
  • 与GitHub相同的磁盘布局,便于迁移

搜索和索引

  • 毫内核(默认):嵌入式LMDB指数,BM25评分
  • 坦特维(可选):替代高性能搜索引擎
  • 异步索引:通过后台worker进行非阻塞索引更新
  • TTL执行:查询时自动过期
  • 现场增压:优先考虑标题匹配而非内容

安全

  • 可选加密:年龄X25519端到端加密
  • 多个收件人:安全地共享加密记忆
  • 凭据管理:环境变量、操作系统钥匙链或助手
  • 最小特权:细粒度的GitHub令牌作用域
  • PII编辑:可配置的内容过滤器

文档

发展

先决条件

  • 锈蚀1.89.0或更高版本(在 rust-toolchain.toml)
  • Git
  • 可选:Docker用于容器化构建

建筑

# Default build with milli-core index
cargo build --workspace

# With all features
cargo build --workspace --features backend-github,backend-local,index-tantivy,encryption,transport-stdio,mcp-gitmem-storage-github/remote-git

# With real Tantivy backend (non-Apple ARM)
cargo build --workspace --features real_tantivy,backend-github,index-tantivy,encryption

# Release build
cargo build --release --features backend-github,index-tantivy,encryption,mcp-gitmem-storage-github/remote-git

测试

# Run all tests
cargo test --workspace

# Run with all features
cargo test --workspace --all-features

# Run benchmarks
cargo bench -p mcp-gitmem-benchmarks --bench performance

代码质量

# Format code
cargo fmt --all

# Run linter
cargo clippy --all-targets -- -D warnings -D clippy::pedantic -A clippy::module_name_repetitions

# Check for security issues
cargo audit

项目结构

.
├── crates/
│   ├── core/           # Domain model, validation, types
│   ├── proto/          # MCP protocol definitions
│   ├── storage/
│   │   ├── github/     # GitHub adapter
│   │   ├── local/      # Local filesystem adapter
│   │   └── ephemeral/  # In-memory adapter (testing)
│   ├── index/
│   │   └── tantivy/    # Search index implementations
│   ├── crypto/         # Encryption (age X25519)
│   ├── server/         # MCP server runtime
│   ├── cli/            # Command-line interface
│   ├── compat/         # Basic memory compatibility
│   ├── testing/        # Test utilities and fixtures
│   └── benchmarks/     # Performance benchmarks
├── docs/               # Documentation
├── examples/           # Sample configurations
└── scripts/            # Installation and utility scripts

演出

  • 保存:p50\每秒1k次写入本地索引
  • 记忆:\<50 MiB基线空闲

基准 查看详细的性能数据。

贡献

欢迎投稿!请阅读 代理商.md 用于:

  • 架构指南
  • 编码标准
  • 测试要求
  • 提交流程

开发工作流程

  1. 分叉存储库
  2. 创建要素分支
  3. 按照编码标准进行更改
  4. 运行测试和过梁
  5. 提交拉取请求

路线图

当前版本(v1.0)

  • ✅ 基本内存协议兼容性
  • ✅ GitHub和本地存储后端
  • ✅ 使用milli-core进行全文搜索
  • ✅ 可选加密
  • ✅ 自动推送支持
  • ✅ 外部文件夹链接

v1.1(计划中)

  • Webhook支持远程同步
  • 自动PR工作流程
  • 冲突解决UI
  • 增强可观察性(开放遥测)

v1.2(未来)

  • 可选嵌入本地模型
  • 混合搜索(BM25+矢量)
  • 重新排名策略
  • 链接文件夹的本地平台监视器

v2.0(未来)

  • 多租户支持
  • 每个租户的加密密钥
  • 基于策略的访问控制
  • 协作内存工作流

许可证

根据以下任一方式获得许可:

由您选择。

致谢

支持

  • 问题:
  • 文档: docs/
  • 讨论:

______________________________________________________________________

由以下材料制成❤️ MCP GitMem团队

目录标签

目录标签

RustCursor全文搜索内存存储本地部署GitHub集成数据加密多项目管理

支持客户端

Cursor

接入字段

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

未说明

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

token

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

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

0

权限和风险

未说明token部署方式未说明

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

安装前确认

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

仍需确认:installCommand

来源信息

继续浏览同类 MCP