Neo4j-backed knowledge graph memory server for MCP

Neo4j-backed knowledge graph memory server for MCP

mcp-neo4j-memory-server-jovanhsu•byjovanhsu

An MCP server that stores and retrieves AI-assistant interaction information as a knowledge graph in Neo4j, offering entity, relation and observation operations with fuzzy search.

License: MIT•Runtime: Awaiting documentation review•Category: ai agents-models

WHAT IT DOES

  • •Stores AI-assistant interactions as a knowledge graph using Neo4j as the backend storage engine.
  • •Provides complete CRUD operations for entities, relations and observations.
  • •Combines Neo4j full-text indexing with Fuse.js for exact and fuzzy entity search ranked by relevance.
  • •Supports complex graph queries and traversal, and is compatible with the MCP protocol.

BEST FOR

  • •Building complex knowledge graph applications that need graph querying and scalability.
  • •Giving an AI assistant persistent memory of user identity, behaviors, preferences, goals and relationships.
  • •Applications that need to search stored memory with fuzzy matching and relevance ordering.

ABOUT MCP-NEO4J-MEMORY-SERVER-JOVANHSU

Neo4j-backed knowledge graph memory server for MCP is cataloged as an MCP server attributed to jovanhsu. An MCP server that stores and retrieves AI-assistant interaction information as a knowledge graph in Neo4j, offering entity, relation and observation operations with fuzzy search. It is categorized under ai agents-models. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Neo4j-backed knowledge graph memory server for MCP are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What storage advantage does this server offer over the original memory server?

It uses Neo4j, a native graph database designed for knowledge graph storage and querying with efficient graph traversal and pattern matching via Cypher.

How is the knowledge graph structured in Neo4j?

Entities carry an entity type and name, observations attach to entities via HAS_OBSERVATION, and entities connect to each other through typed relations.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 80ab27b1fffb · 采集于 2026-11-13 09:53:36 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP Neo4j Knowledge Graph Memory Server

npm version License: MIT TypeScript Neo4j

简介

MCP Neo4j Knowledge Graph Memory Server是一个基于Neo4j图数据库的知识图谱记忆服务器,用于存储和检索AI助手与用户交互过程中的信息。该项目是官方Knowledge Graph Memory Server的增强版本,使用Neo4j作为后端存储引擎。

通过使用Neo4j作为存储后端,本项目提供了更强大的图查询能力、更好的性能和可扩展性,特别适合构建复杂的知识图谱应用。

功能特点

  • 🚀 基于Neo4j的高性能图数据库存储
  • 🔍 强大的模糊搜索和精确匹配能力
  • 🔄 实体、关系和观察的完整CRUD操作
  • 🌐 与MCP协议完全兼容
  • 📊 支持复杂的图查询和遍历
  • 🐳 Docker支持,便于部署

安装

前提条件

  • Node.js >= 22.0.0
  • Neo4j数据库(本地或远程)

通过npm安装

# 全局安装
npm install -g @jovanhsu/mcp-neo4j-memory-server

# 或作为项目依赖安装
npm install @jovanhsu/mcp-neo4j-memory-server

使用Docker

# 使用docker-compose启动Neo4j和Memory Server
git clone https://github.com/JovanHsu/mcp-neo4j-memory-server.git
cd mcp-neo4j-memory-server
docker-compose up -d

环境变量配置

服务器使用以下环境变量进行配置:

环境变量描述默认值
NEO4J_URINeo4j数据库URIbolt://localhost:7687
NEO4J_USERNeo4j用户名neo4j
NEO4J_PASSWORDNeo4j密码password
NEO4J_DATABASENeo4j数据库名称neo4j

与Claude集成

在Claude Desktop中配置

在claude_desktop_config.json中添加以下配置:

{
  "mcpServers": {
    "graph-memory": {
      "command": "npx",
      "args": [
        "-y",
        "@izumisy/mcp-neo4j-memory-server"
      ],
      "env": {
        "NEO4J_URI": "neo4j://localhost:7687",
        "NEO4J_USER": "neo4j",
        "NEO4J_PASSWORD": "password",
        "NEO4J_DATABASE": "memory"
      }
    }
  }
}

在Claude Web中使用MCP Inspector

  1. 安装MCP Inspector
  2. 启动Neo4j Memory Server:
    npx @jovanhsu/mcp-neo4j-memory-server
    
  3. 在另一个终端启动MCP Inspector:
    npx @modelcontextprotocol/inspector npx @jovanhsu/mcp-neo4j-memory-server
    
  4. 在浏览器中访问MCP Inspector界面

使用方法

Claude自定义指令

在Claude的自定义指令中添加以下内容:

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 search relevant information from your knowledge graph
   - Create a search query from user words, and search things from "memory". If nothing matches, try to break down words in the query at first ("A B" to "A" and "B" for example).
   - 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

API示例

如果您想在自己的应用程序中使用本服务器,可以通过MCP协议与其通信:

import { McpClient } from '@modelcontextprotocol/sdk/client/mcp.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';

// 创建客户端
const transport = new StdioClientTransport({
  command: 'npx',
  args: ['-y', '@izumisy/mcp-neo4j-memory-server'],
  env: {
    NEO4J_URI: 'bolt://localhost:7687',
    NEO4J_USER: 'neo4j',
    NEO4J_PASSWORD: 'password',
    NEO4J_DATABASE: 'neo4j'
  }
});

const client = new McpClient();
await client.connect(transport);

// 创建实体
const result = await client.callTool('create_entities', {
  entities: [
    {
      name: '用户',
      entityType: '人物',
      observations: ['喜欢编程', '使用TypeScript']
    }
  ]
});

console.log(result);

为什么选择Neo4j?

相比于原始版本使用的JSON文件存储和DuckDB版本,Neo4j提供了以下优势:

  1. 原生图数据库:Neo4j是专为图数据设计的数据库,非常适合知识图谱的存储和查询
  2. 高性能查询:使用Cypher查询语言可以高效地进行复杂的图遍历和模式匹配
  3. 关系优先:Neo4j将关系作为一等公民,使得实体间的关系查询更加高效
  4. 可视化能力:Neo4j提供了内置的可视化工具,方便调试和理解知识图谱
  5. 扩展性:支持集群部署,可以处理大规模知识图谱

实现细节

数据模型

知识图谱在Neo4j中的存储模型如下:

(Entity:EntityType {name: "实体名称"})
(Entity)-[:HAS_OBSERVATION]->(Observation {content: "观察内容"})
(Entity1)-[:RELATION_TYPE]->(Entity2)

模糊搜索实现

本实现结合了Neo4j的全文搜索功能和Fuse.js进行灵活的实体搜索:

  • 使用Neo4j的全文索引进行初步搜索
  • Fuse.js提供额外的模糊匹配能力
  • 搜索结果包括精确和部分匹配,按相关性排序

开发

环境设置

# 克隆仓库
git clone https://github.com/JovanHsu/mcp-neo4j-memory-server.git
cd mcp-neo4j-memory-server

# 安装依赖
pnpm install

# 构建项目
pnpm build

# 开发模式(使用MCP Inspector)
pnpm dev

测试

# 运行测试
pnpm test

发布

# 准备发布
npm version [patch|minor|major]

# 发布到NPM
npm publish

贡献指南

欢迎贡献代码、报告问题或提出改进建议!请遵循以下步骤:

  1. Fork本仓库
  2. 创建您的特性分支 (git checkout -b feature/amazing-feature)
  3. 提交您的更改 (git commit -m 'Add some amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 创建一个Pull Request

相关项目

许可证

本项目采用MIT许可证 - 详见LICENSE文件。

联系方式

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Neo4j-backed knowledge graph memory server for MCP from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-neo4j-memory-server-jovanhsu)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable
Site views (30 UTC days)1

Approximate reported site interactions from 2026-10-27 through 2026-11-25 UTC; not unique visitors or installations.

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related ai agents-models MCP Servers

Alternative and complementary servers in the same category

View all in ai agents-models →
Knowledge Graph Memory
@modelcontextprotocol/server-memory•Model Context Protocol

Store and retrieve entities, relations and observations in a persistent local knowledge graph.

create_entitiescreate_relationsadd_observations+6 more
92K
AI & Multi-Agent
Sequential Thinking
@modelcontextprotocol/server-sequential-thinking•Model Context Protocol

Organize problem solving into revisable, branching thought steps through an MCP tool.

sequential_thinking
92K
AI & Multi-Agent

Query-aware context compression with an MCP plugin for coding agents, plus Python and HTTP interfaces for reducing the context sent to a language model.

146
AI & Multi-Agent