Token导航 LogoToken导航TokenDH.com
MCP Knowledge Graph logo
数据服务stdio官方级别未说明来源级核验

MCP Knowledge Graph

MCP Server

@smithery/cli

一个基于本地知识图谱的可定制记忆路径的持久化记忆实现,用于跨聊天记录记住用户信息。

工具数

11

提示词数

0

GitHub Stars

60

资源数

0
知识图谱记忆存储JavaScriptClaudeClaudeCline

安装说明

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

作者 / 组织

itseasy21

提供方

itseasy21

最后核验

2026/5/17 20:22

运行时

Node.js

快速接入

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

命令预览

npx -y @smithery/cli install @itseasy21/mcp-knowledge-graph --client claude

详细介绍

知识图谱存储服务器

](https://smithery.ai/server/@itseasy21/mcp-knowledge-graph)

使用具有可定制内存路径的本地知识图改进持久内存的实现。

这让克劳德在聊天中记住用户的信息。

\[!注意\] 这是原版的叉子 内存服务器 并且不打算使用临时内存npx安装方法。

服务器名称

mcp-knowledge-graph

screen-of-server-name

read-function

核心概念

实体

实体是知识图中的主要节点。每个实体都有:

  • 唯一名称(标识符)
  • 实体类型(例如,“人”、“组织”、“事件”)
  • 观察结果列表
  • 创建日期和版本跟踪

版本跟踪功能有助于维护知识随时间演变的历史背景。

例子:

{
  "name": "John_Smith",
  "entityType": "person",
  "observations": ["Speaks fluent Spanish"]
}

关系

关系定义了实体之间的有向连接。它们总是以主动语态存储,描述实体之间的互动或关系。每个关系包括:

  • 来源和目标实体
  • 关系类型
  • 创建日期和版本信息

此版本控制系统有助于跟踪实体之间的关系如何随时间演变。

例子:

{
  "from": "John_Smith",
  "to": "Anthropic",
  "relationType": "works_at"
}

观察

观察是关于实体的离散信息。他们是:

  • 以字符串形式存储
  • 附属于特定实体
  • 可以独立添加或删除
  • 应该是原子性的(每次观察一个事实)

例子:

{
  "entityName": "John_Smith",
  "observations": [
    "Speaks fluent Spanish",
    "Graduated in 2019",
    "Prefers morning meetings"
  ]
}

API

工具

  • create_entities

- 在知识图中创建多个新实体 - 输入: entities (对象数组) - 每个对象包含: - name (string):实体标识符 - entityType (string):类型分类 - observations (string\[\]):相关观测值 - 忽略具有现有名称的实体

  • 创建关系

- 在实体之间创建多个新关系 - 输入: relations (对象数组) - 每个对象包含: - from (string):源实体名称 - to (string):目标实体名称 - relationType (string):主动语态中的关系类型 - 跳过重复关系

  • 添加观察结果

- 向现有实体添加新的观察结果 - 输入: observations (对象数组) - 每个对象包含: - entityName (string):目标实体 - contents (string\[\]):要添加的新观测值 - 返回每个实体添加的观测值 - 如果实体不存在,则失败

  • 删除内容

- 删除实体及其关系 - 输入: entityNames (字符串\[\]) - 级联删除关联关系 - 如果实体不存在,则进行静默操作

  • 删除观察

- 从实体中删除特定观察结果 - 输入: deletions (对象数组) - 每个对象包含: - entityName (string):目标实体 - observations (string\[\]):要删除的观察值 - 如果不存在观察,则静音操作

  • 删除关系

- 从图中删除特定关系 - 输入: relations (对象数组) - 每个对象包含: - from (string):源实体名称 - to (string):目标实体名称 - relationType (string):关系类型 - 如果关系不存在,则进行静默操作

  • read_graph

- 阅读整个知识图谱 - 无需输入 - 返回包含所有实体和关系的完整图结构

  • 搜索节点

- 基于查询搜索节点 - 输入: query (字符串) - 搜索范围: - 实体名称 - 实体类型 - 观察内容 - 返回匹配的实体及其关系

  • open_nodes

- 按名称检索特定节点 - 输入: names (字符串\[\]) - 退货: - 被请求的实体 - 被请求实体之间的关系 - 静默跳过不存在的节点

使用光标、Cline或Claude桌面

设置

将此添加到您的mcp.json或claude_desktop_config json中:

{
    "mcpServers": {
      "memory": {
        "command": "npx",
        "args": [
          "-y",
          "@itseasy21/mcp-knowledge-graph"
        ],
        "env": {
          "MEMORY_FILE_PATH": "/path/to/your/projects.jsonl"
        }
      }
    }
  }

通过Smithery安装

通过以下方式自动安装克劳德桌面知识图谱内存服务器 史密瑟里:

npx -y @smithery/cli install @itseasy21/mcp-knowledge-graph --client claude

自定义内存路径

您可以通过两种方式为内存文件指定自定义路径:

  1. 使用命令行参数:
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@itseasy21/mcp-knowledge-graph", "--memory-path", "/path/to/your/memory.jsonl"]
    }
  }
}
  1. 使用环境变量:
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@itseasy21/mcp-knowledge-graph"],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/your/memory.jsonl"
      }
    }
  }
}

如果没有指定路径,它将默认为服务器安装目录中的memory.jsonl。

系统提示

使用内存的提示取决于用例。更改提示将有助于模型确定创建记忆的频率和类型。

这是一个聊天个性化提示示例。您可以在“自定义说明”字段中使用此提示 Claude.ai项目.

Follow these steps for each interaction:

1. User Identification:
   - You should assume that you are interacting with default_user
   - If you have not identified default_user, proactively try to do so.

2. Memory Retrieval:
   - Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph
   - Always refer to your knowledge graph as your "memory"

3. Memory
   - While conversing with the user, be attentive to any new information that falls into these categories:
     a) Basic Identity (age, gender, location, job title, education level, etc.)
     b) Behaviors (interests, habits, etc.)
     c) Preferences (communication style, preferred language, etc.)
     d) Goals (goals, targets, aspirations, etc.)
     e) Relationships (personal and professional relationships up to 3 degrees of separation)

4. Memory Update:
   - If any new information was gathered during the interaction, update your memory as follows:
     a) Create entities for recurring organizations, people, and significant events
     b) Connect them to the current entities using relations
     b) Store facts about them as observations

许可证

此MCP服务器根据MIT许可证获得许可。这意味着您可以根据MIT许可证的条款和条件自由使用、修改和分发软件。有关更多详细信息,请参阅项目存储库中的LICENSE文件。

目录标签

目录标签

知识图谱记忆存储JavaScriptClaude本地部署用户信息管理实体关系持久化记忆

支持客户端

ClaudeCline

接入字段

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

stdio

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

none

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

local-only

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

11

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdiononelocal-only

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

安装前确认

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

来源信息

继续浏览同类 MCP