Token导航 LogoToken导航

MCP Server · 数据服务

Mem Fs

基于文件系统设计理念的知识图谱管理系统,结合BM25和模糊搜索实现智能检索,适用于LLM辅助的人文社科研究。

stdio官方级别未说明来源级核验工具 17@qty/memfs
知识图谱JavaScript数据分析

快速开始

作者 / 组织
Qtgcy08
提供方
Qtgcy08
运行时
Node.js

工具数量

17

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

2

仓库热度

收录来源

1 个

MCP World

选型结论

Mem Fs 属于数据服务类 MCP Server,公开资料标注 17 个工具,通过stdio 本地进程接入,客户端适配情况以官方文档为准,有可以直接复制的安装命令;接入前要先准备 访问 Token。

分类

数据服务

传输方式

stdio

认证方式

访问 Token

部署方式

公开资料未说明

安装与配置

安装命令

npx @qty/memfs

客户端配置示例

{
  "mcpServers": {
    "memfs": {
      "command": "npx",
      "args": [
        "@qty/memfs"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 17 个工具,随便调一个只读工具确认能返回结果。

接入前确认

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

详细介绍

🧠 MemFS

A knowledge graph management system based on MCP server-memory, deeply refactored with filesystem-inspired design

💡 Acknowledgments: Original @modelcontextprotocol/server-memory Inspired by it, though heavily reimagined.

🎯 One-Line Description

Bringing modern filesystem concepts to knowledge graph management, combined with BM25 + fuzzy search for intelligent retrieval, designed for LLM-assisted humanities and social sciences research.


🚀 Quick Start

Prerequisites

# Check Node.js version
node --version  # Must be v22.0.0 or higher

Installation & Run

Quickest way (npx):

npx @qty/memfs

Or clone and run:

# 1. Clone or download the project
cd MemFS

# 2. Install dependencies
npm install

# 3. Run server
node index.js

# Or specify custom storage directory
MEMORY_DIR=~/my-knowledge

# Enable Git auto-sync (auto-commits on every save)
GITAUTOCOMMIT=true node index.js

Configure as MCP Server

OpenCode format:

{
  "mcpServers": {
    "memory": {
      "type": "local",
      "command": ["npx", "-y", "@qty/memfs"],
      "enabled": true
    }
  }
}

VSCode / ClaudeCode / Cherry Studio / AstrBot format:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@qty/memfs"],
      "enabled": true
    }
  }
}

📰 What's New in 2.4.12

Git Auto-Commit

New GITAUTOCOMMIT=true environment variable — every operation auto-commits to Git:

auto-commit:[createEntity "Weber"] at [utc:2026-03-28T12:34:56.789Z] [tz:Asia/Shanghai]

searchNode Refactoring

  • Response simplified to { entities, observations, relations }
  • Removed searchMode field
  • observations now includes updatedAt
  • Related entities count limited by limit
  • Unified tokenization: 2~(n-1) gram, no language detection
  • 2-gram penalty ×0.5: short tokens no longer over-match
  • Field weights centralized in DEFAULT_FIELD_WEIGHTS
  • definitionSource added to search index
  • Relation type matching boost

Operation Return Refactoring

  • Write operation messages simplified (less LLM token consumption)
  • Delete operations return full data for potential undo
  • unlinkObservation now uses ID-based input (renamed from deleteObservation)

Auxiliary Tools

  • New getConsole tool to retrieve buffered logs

📖 Core Concepts

ConceptDescriptionAnalogy
EntityNodes in the knowledge graphFile
ObservationProperties/descriptions of entitiesinode
RelationConnections between entitiesSoft link
ReferencePointers from entities to observationsHard link

💡 Core Design Philosophy

1. Transformer-Ready: On-Demand Retrieval

flowchart TD
    LLM["LLM"]
    ATT["Attention Mechanism"]
    MCP["MCP Protocol"]
    MEM["MemFS\nOn-demand structured data"]

    LLM --> ATT --> MCP --> MEM
    MEM -.-> |Returns results| LLM

Core principle: Don't stuff all knowledge into context—retrieve on demand.

2. Lightweight Design

DimensionTraditional SolutionMemFS
DeploymentDatabase + Vector EnginePure Node.js
ResourcesGPU recommended, high memoryCPU only
ExplainabilityBlack-box modelsBM25 transparent & controllable

3. Local JSONL Storage

{"type":"entity","name":"Weber","entityType":"person","definition":"German sociologist","observationIds":[1,2]}
{"type":"observation","id":1,"content":"Author of 'The Protestant Ethic'","createdAt":{"utc":"2026-02-08T13:53:07Z","timezone":"Asia/Shanghai"}}
{"type":"relation","from":"Weber","to":"Durkheim","relationType":"contemporary"}

Advantages: Editable with any text editor, Git-version-controllable, printable.

4. Humanities & Social Sciences Customization

Requirement TypeTraditionalMemFS
Knowledge unitsFunctions/ClassesConcepts/People/Documents
Relationship typesFunction callsInfluence/Reference/Comparison
Update frequencyHigh-frequencyLow-frequency add, high-frequency reference

📦 Complete API Tools (16 total)

Create

ToolFunctionExample
createEntityBatch create entities (with observations)Add concepts, people, documents
createRelationCreate relations between entitiesMark references, comparisons, influences
addObservationAdd observations to existing entitiesSupplement reading notes

Read

ToolFunctionExample
searchNodeBM25 + Fuzzy hybrid searchIntelligent knowledge search
readNodeRead complete entity informationGet detailed attributes and relations
readObservationBatch read observations by IDVerify specific observations
listNodeList all entity overviewsBrowse knowledge structure
listGraphRead entire knowledge graphBatch export, migration
howWorkGet recommended workflow guidanceLearn how to use the system

Update

ToolFunctionExample
updateNodeUpdate entities and observations (Copy-on-Write)Modify definitions, update notes
updateObservationBatch update observation contentBatch correct information

Delete

ToolFunctionExample
deleteEntityDelete entities and relationsRemove outdated entries
deleteRelationDelete specific relationsUnlink entities
unlinkObservationUnlink observations (preserve observation)Remove references
getOrphanObservationFind orphan observationsDiscover invalid data
recycleObservationPermanently delete observationsClean up unused data

Auxiliary

ToolFunctionExample
getConsoleGet console messages and Git commit logsView auto-commit history

🔍 Hybrid Search (searchNode)

Core Features

FeatureDescription
BM25Considers term frequency and document frequency
Fuzzy SearchTolerates typos, supports approximate matching
Query TokenizationTokenize → Search individually → Aggregate → Deduplicate
Weighted FusionBM25 0.7 + Fuzzy 0.3, combined ranking

Parameters

// Default hybrid search
await searchNode("functionalism");  // BM25 + Fuzzy

// Traditional keyword search
await searchNode("functionalism", { basicFetch: true });

// Custom parameters
await searchNode("sociology", {
    limit: 15,          // Return count
    bm25Weight: 0.7,    // BM25 weight
    fuzzyWeight: 0.3,   // Fuzzy search weight
    minScore: 0.01      // Minimum relevance threshold
});

Field Weights

FieldWeightDescription
name5.0Highest - entity name
entityType2.5Entity type
definition2.5Definition description
definitionSource1.5Definition source
observation1.0Observation content

🔧 Filesystem-Inspired Design

Architecture Analogy

Filesystem ConceptMemFS ImplementationSolves
Inode TableCentralized observation storageData redundancy
Hard LinksMultiple entities reference same observationShared reuse
Soft LinksEntity relationsFlexible associations
Copy-on-WriteCopy-on-Write updatesConcurrency safety
Orphan DetectionOrphan observation cleanupResource recovery

Observation Sharing

// Create two entities sharing the same observation
await createEntity([
  { name: "Zhang San", observations: ["Programmer"] },
  { name: "Li Si", observations: ["Programmer"] }
]);

// Under the hood: same observation ID is reused
{
  entities: [
    { name: "Zhang San", observationIds: [1] },
    { name: "Li Si", observationIds: [1] }
  ],
  observations: [
    { id: 1, content: "Programmer" }
  ]
}

Copy-on-Write

// Update a shared observation
await updateNode({
  entityName: "Zhang San",
  observationUpdates: [
    { oldContent: "Programmer", newContent: "Senior Programmer" }
  ]
});

// Result: Zhang San gets new observation, Li Si keeps original
{
  observations: [
    { id: 1, content: "Programmer" },      // Li Si uses
    { id: 2, content: "Senior Programmer" } // Zhang San's new observation
  ]
}

📁 Data Format

JSONL Storage

{"type":"entity","name":"Weber","entityType":"person","definition":"German sociologist","definitionSource":"Wikipedia","observationIds":[1,2]}
{"type":"entity","name":"Durkheim","entityType":"person","definition":"French sociologist","definitionSource":"Wikipedia","observationIds":[3]}
{"type":"observation","id":1,"content":"Author of 'The Protestant Ethic'","createdAt":{"utc":"2026-02-08T13:53:07Z","timezone":"Asia/Shanghai"}}
{"type":"observation","id":2,"content":"Contemporary with Durkheim and Marx","createdAt":{"utc":"2026-02-08T14:00:00Z","timezone":"Asia/Shanghai"},"updatedAt":{"utc":"2026-02-09T10:30:00Z","timezone":"Asia/Shanghai"}}
{"type":"observation","id":3,"content":"Author of 'The Division of Labor in Society'","createdAt":{"utc":"2026-02-08T15:00:00Z","timezone":"Asia/Shanghai"}}
{"type":"relation","from":"Weber","to":"Durkheim","relationType":"contemporary"}

Storage Locations

MethodPath
Default~/.memory/memory.jsonl
Custom directoryMEMORY_DIR=/path/to/data

Environment Variables

VariableDescriptionDefaultStatus
MEMORY_DIRData storage directory~/.memory✅ Recommended
MEMORY_FILE_PATHFull file path (deprecated)~/.memory/memory.jsonl⚠️ Deprecated
GITAUTOCOMMITEnable Git auto-commit on every savefalse✅ Recommended

🔄 Git Auto-Sync

When enabled, every save to the memory file is automatically committed to Git for version control.

# Enable Git auto-commit
GITAUTOCOMMIT=true node index.js

# Or in MCP config
{
  "environment": {
    "MEMORY_DIR": "/path/to/data",
    "GITAUTOCOMMIT": "true"
  }
}

Commit Format

auto-commit:[operationContext] at [utc:YYYY-MM-DDTHH:mm:ss.SSSZ] [tz:Asia/Shanghai]

Example:

auto-commit:[createEntity "Weber"] at [utc:2026-03-22T09:15:30.123Z] [tz:Asia/Shanghai]
auto-commit:[updateNode "Durkheim"] at [utc:2026-03-22T09:16:45.456Z] [tz:Asia/Shanghai]
auto-commit:[deleteRelation "Weber"→"Durkheim"] at [utc:2026-03-22T09:17:00.789Z] [tz:Asia/Shanghai]

auto-sync: (operation_type "details") at UTC YYYY-MM-DDTHH:mm:ss.SSSZ


Example:

auto-sync: (createEntity "Weber") at UTC 2026-03-22T09:15:30.123Z auto-sync: (updateNode "Durkheim") at UTC 2026-03-22T09:16:45.456Z auto-sync: (deleteRelation "Weber"→"Durkheim") at UTC 2026-03-22T09:17:00.789Z


### View Commit History

Use `getConsole` tool:

await getConsole() // Returns text content with buffered logs and Git commits prefixed by "[Git]"


---

## 📦 Legacy Version

The v1.3.0 code is available on the `legacy` branch:

git clone https://github.com/Qtgcy08/MemFS.git cd MemFS git checkout legacy


If you're using `MEMORY_FILE_PATH`, please migrate to `MEMORY_DIR` before upgrading.

---

## 🧪 Testing

Full test suite (22 tests)

node test_mcp_full.mjs

Git Sync tests

node test_gitsync.mjs


---

## ⚙️ Comparison with Original MCP Memory

| Dimension | Original | MemFS |
|-----------|----------|-------|
| **Observation Storage** | Embedded in entities | Centralized + ID reference |
| **Data Sharing** | Not supported | Hard-link style sharing |
| **Update Mechanism** | Direct overwrite | Copy-on-Write |
| **Search Capability** | Simple keyword | BM25 + Fuzzy |
| **Orphan Detection** |理论上不存在孤儿观察 | Supported |
| **Cache Mechanism** | None | 30s TTL |
| **Windows Compatibility** | Unknown | Graceful degradation |

---

## 📚 Design Philosophy

**What? You're still reading? Well, alright.**

Honestly, this project started because:

1. **LLM context is limited** — can't stuff all knowledge into prompts
2. **Filesystem is a great invention** — handling "multiple data sharing same content" is mature
3. **Humanities research has special needs** — concepts, literature, citation relationships
4. **Controllability > SOTA** — no need for black-box vector models

So:

- **Borrow filesystem wisdom**: inode table, hard links, copy-on-write
- **Search uses BM25 + Fuzzy**: lightweight, explainable, transparent, controllable
- **Expose as tools**: 16 MCP tools, LLM calls on demand

**Result?** — A quiet, efficient, unobtrusive knowledge management tool.

---

## 📄 License

Apache License 2.0

---

**Manage knowledge the filesystem way—bringing order to chaos.**

工具与能力

工具数量

17

资源数量

0

提示词数量

0

能力标签

知识图谱JavaScript本地部署文件系统设计BM25搜索模糊搜索人文社科研究

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

用自然语言查库

不用手写 SQL,直接问数据,让模型组织查询语句。

数据巡检

定期拉指标、做对比,把异常项整理成一段说明。

打通业务数据

把数据库、数仓和接口接进同一个上下文,减少导出再上传。

选择建议

值得选的地方

  • 工具数量 17 个,一次接入能覆盖的操作比单点工具更全。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 Node.js,换机器要重新装一遍。
  • 需要自备访问 Token,没有凭据没法直接试。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到访问 Token的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Mem Fs

MCP World · 本页

17stdio有1 个2026-05-17
Memory 9d25f64e

MCP World

9未说明未标注1 个2026-05-17
Prisma MCP Server

MCP World

0stdio有3 个2026-05-17
Astr Bot

MCP World

0stdio有1 个2026-05-17
Getzep MCP

MCP World

9stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Mem Fs 怎么安装?

公开资料给出的安装命令是 npx @qty/memfs,运行环境为 Node.js。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Mem Fs 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Node.js;保存后完全退出客户端再打开,配置才会生效。

Mem Fs 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Mem Fs 需要 API Key 吗?

公开资料标注的认证方式是访问 Token,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

Mem Fs 支持哪些客户端?

公开资料没有标注具体客户端;能配置本地 MCP 命令的客户端都能接,配置方式参照官方文档。

来源信息

继续浏览同类 MCP