Back to MCP directory
publicPublicdnsLocal runtime

knowledge-mcp

一个基于Neo4J数据库的知识服务MCP服务器原型,可从Neo4J中提取知识回答问题,支持通过Cursor等客户端使用。

article

README

🚀 知识 - MCP 服务器

这是一个从 Neo4J 数据库提供知识的 MCP 服务器。本项目旨在展示如何从 Neo4J 提取知识,为相关应用提供知识支持。

⚠️ 重要提示

本文档中提供的指南是示例性质的,不真实且仅用于演示如何从 Neo4J 提取知识的目的。这是一个 prototype,尚未准备好投入生产使用!

🚀 快速开始

🐳 运行 Neo4J 在 Docker 容器中

运行 Neo4J Docker 容器,可使用以下命令:

docker run \
    --restart 总是 \
    --publish=7474:7474 \
    --publish=7687:7687 \
    neo4j:latest

在浏览器中登录到 Neo4J http://localhost:7474/,并为用户 neo4j 设置一个新的密码。

📂 运行数据加载程序

运行数据加载程序项目以将一些文档保存到 Neo4J 中。这些文档将被 MCP 服务器用于回答问题。

💡 使用建议

记得修改源代码,使其指向你正在运行的 Neo4J 实例,并设置正确的 Neo4J 用户名和密码。

🏗️ 构建 MCP 服务器

构建服务器以生成所需的二进制文件。

⚙️ 在 Cursor 中配置 MCP 服务器

转到 Cursor 设置并添加一个新的 MCP 服务器。记得将 YOUR_PATHYOUR_OPENAI_API_KEYYOUR_NEO4J_PASSWORD 设置为正确的值。

{
  "mcpServers": {
    "KnowledgeBase": {
      "type": "stdio",
      "command": "YOUR_PATH/knowledge-mcp/src/KnowledgeMcp.Server/bin/Debug/net9.0/KnowledgeMcp.Server",
      "args": [
        "YOUR_OPEN_AI_API_KEY",
        "neo4j://localhost:7687",
        "neo4j",
        "YOUR_NEO4J_PASSWORD"
      ]
    }
  }
}

⚠️ 注意事项

  • 你可以使用任何支持 MCP 的客户端,例如 Claude Desktop。
  • 可能的改进之一是利用 Neo4J 的响应格式来获取用于回答问题的文档引用。
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client