Skip to main content
Glama
delorenj

MCP Memory Server with Qdrant Persistence

by delorenj

具有 Qdrant Persistence 的 MCP 内存服务器

铁匠徽章

该 MCP 服务器提供了由 Qdrant 矢量数据库支持的具有语义搜索功能的知识图谱实现。

特征

  • 基于图的知识表示,包括实体和关系

  • 基于文件的持久性(memory.json)

  • 使用 Qdrant 矢量数据库进行语义搜索

  • OpenAI 语义相似性嵌入

  • HTTPS 支持与反向代理兼容

  • Docker 支持,轻松部署

Related MCP server: Qdrant MCP Server

环境变量

需要以下环境变量:

# OpenAI API key for generating embeddings
OPENAI_API_KEY=your-openai-api-key

# Qdrant server URL (supports both HTTP and HTTPS)
QDRANT_URL=https://your-qdrant-server

# Qdrant API key (if authentication is enabled)
QDRANT_API_KEY=your-qdrant-api-key

# Name of the Qdrant collection to use
QDRANT_COLLECTION_NAME=your-collection-name

设置

本地设置

  1. 安装依赖项:

npm install
  1. 构建服务器:

npm run build

Docker 设置

  1. 构建 Docker 镜像:

docker build -t mcp-qdrant-memory .
  1. 使用所需的环境变量运行 Docker 容器:

docker run -d \
  -e OPENAI_API_KEY=your-openai-api-key \
  -e QDRANT_URL=http://your-qdrant-server:6333 \
  -e QDRANT_COLLECTION_NAME=your-collection-name \
  -e QDRANT_API_KEY=your-qdrant-api-key \
  --name mcp-qdrant-memory \
  mcp-qdrant-memory

添加到 MCP 设置:

{
  "mcpServers": {
    "memory": {
      "command": "/bin/zsh",
      "args": ["-c", "cd /path/to/server && node dist/index.js"],
      "env": {
        "OPENAI_API_KEY": "your-openai-api-key",
        "QDRANT_API_KEY": "your-qdrant-api-key",
        "QDRANT_URL": "http://your-qdrant-server:6333",
        "QDRANT_COLLECTION_NAME": "your-collection-name"
      },
      "alwaysAllow": [
        "create_entities",
        "create_relations",
        "add_observations",
        "delete_entities",
        "delete_observations",
        "delete_relations",
        "read_graph",
        "search_similar"
      ]
    }
  }
}

工具

实体管理

  • create_entities :创建多个新实体

  • create_relations :创建实体之间的关系

  • add_observations :向实体添加观察结果

  • delete_entities :删除实体及其关系

  • delete_observations :删除特定观察结果

  • delete_relations :删除特定关系

  • read_graph :获取完整的知识图谱

语义搜索

  • search_similar :搜索语义相似的实体和关系

    interface SearchParams {
      query: string;     // Search query text
      limit?: number;    // Max results (default: 10)
    }

实现细节

服务器维护两种形式的持久性:

  1. 基于文件(memory.json):

    • 完整的知识图谱结构

    • 快速访问完整图表

    • 用于图形操作

  2. Qdrant 向量数据库:

    • 实体和关系的语义嵌入

    • 启用相似性搜索

    • 自动与文件存储同步

同步

当实体或关系被修改时:

  1. 更改写入memory.json

  2. 使用 OpenAI 生成嵌入

  3. 向量存储在 Qdrant 中

  4. 两个存储系统保持一致

搜索过程

搜索时:

  1. 查询文本转换为嵌入

  2. Qdrant 执行相似性搜索

  3. 结果包括实体和关系

  4. 结果按语义相似度排序

示例用法

// Create entities
await client.callTool("create_entities", {
  entities: [{
    name: "Project",
    entityType: "Task",
    observations: ["A new development project"]
  }]
});

// Search similar concepts
const results = await client.callTool("search_similar", {
  query: "development tasks",
  limit: 5
});

HTTPS 和反向代理配置

服务器支持通过 HTTPS 和反向代理连接到 Qdrant。此功能在以下情况下尤其有用:

  • 在 Nginx 或 Apache 等反向代理后面运行 Qdrant

  • 使用自签名证书

  • 需要自定义 SSL/TLS 配置

设置反向代理

  1. 配置您的反向代理(使用 Nginx 的示例):

server {
    listen 443 ssl;
    server_name qdrant.yourdomain.com;

    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;

    location / {
        proxy_pass http://localhost:6333;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
  1. 更新您的环境变量:

QDRANT_URL=https://qdrant.yourdomain.com

安全注意事项

服务器通过以下方式实现强大的 HTTPS 处理:

  • 自定义 SSL/TLS 配置

  • 适当的证书验证选项

  • 连接池和保持活动

  • 使用指数退避算法自动重试

  • 可配置超时

HTTPS 连接故障排除

如果您遇到连接问题:

  1. 验证您的证书:

openssl s_client -connect qdrant.yourdomain.com:443
  1. 测试直接连接:

curl -v https://qdrant.yourdomain.com/collections
  1. 检查任何代理设置:

env | grep -i proxy

贡献

  1. 分叉存储库

  2. 创建功能分支

  3. 进行更改

  4. 提交拉取请求

执照

麻省理工学院

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Transforms text or web content into structured knowledge graphs using local AI models with MCP integration for persistent storage in Neo4j and Qdrant.
    4
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables semantic search and document management using a local Qdrant vector database with OpenAI embeddings. Supports natural language queries, metadata filtering, and collection management for AI-powered document retrieval.
    164
    36
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables semantic search and retrieval-augmented generation (RAG) using Qdrant vector database. Supports indexing documents from URLs and local directories, with flexible embedding options using Ollama or OpenAI.
    2

View all related MCP servers

Related MCP Connectors

  • Persistent memory and knowledge graph for AI assistants — keyword + vector + graph search.

  • Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.

  • Shared semantic graph for AI reviews, classification and structured memory across AI assistants.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/delorenj/mcp-qdrant-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server