JM

joleyline/mcp-memory-libsql

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

24 stars 7 forks 质量 69 趋势 10MIT

🧠 高性能的持久内存系统,适用于模型上下文协议(MCP),由libSQL驱动。具备向量搜索、语义知识存储和高效关系管理功能——完美......

概览

一个高性能、持久的内存系统,用于模型上下文协议(MCP),由 libSQL 驱动。该服务器提供向量搜索功能和高效的知识存储,使用 libSQL 作为后备存储。 - 🚀 使用 libSQL 实现高性能矢量搜索 - 💾 实体和关系的持久存储 - 🔍 语义搜索功能 - 🔄 知识图谱管理 - 🌐 兼容本地和远程 libSQL 数据库 - 🔒 基于安全令牌的远程数据库认证 该服务器设计为作为MCP配置的一部分使用。以下是不同环境的示例: 关于如何在WSL中使用Claude Desktop设置该服务器的详细指南,请参见“在WSL中与Claude Desktop共事MCP服务器”。 将以下内容添加到你的 Claude Desktop 配置中,适用于 WSL 环境: 服务器通过LIBSQL_URL环境变量支持本地SQLite和远程libSQL数据库: 对于远程的libSQL数据库(例如,

概述(AI 翻译)

一个高性能、持久的模型上下文内存系统 由 libSQL 驱动的协议(MCP)。该服务器提供向量搜索功能 利用libSQL作为 后台商店。

特色

  • 🚀 使用libSQL的高性能向量搜索
  • 💾 实体和关系的持久存储
  • 🔍 语义搜索功能
  • 🔄 知识图谱管理
  • 🌐 兼容本地和远程的 libSQL 数据库
  • 🔒 远程数据库的安全令牌认证

配置

该服务器设计为作为MCP配置的一部分使用。 以下是不同环境的示例:

克莱恩配置

把这个加到你的Cline MCP设置里:

带WSL配置的Claude桌面

关于如何用Claude Desktop搭建服务器的详细指南 WSL,参见 如何在WSL中让MCP服务器在Claude Desktop上正常工作。

将以下内容添加到你的 Claude Desktop 配置中,适用于 WSL 环境:

数据库配置

该服务器支持本地SQLite和远程libSQL数据库 通过LIBSQL_URL环境变量:

对于本地SQLite数据库:

对于远程 libSQL 数据库(例如 Turso):

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

mcp-memory-libsql

A high-performance, persistent memory system for the Model Context Protocol (MCP) powered by libSQL. This server provides vector search capabilities and efficient knowledge storage using libSQL as the backing store.

Features

  • 🚀 High-performance vector search using libSQL
  • 💾 Persistent storage of entities and relations
  • 🔍 Semantic search capabilities
  • 🔄 Knowledge graph management
  • 🌐 Compatible with local and remote libSQL databases
  • 🔒 Secure token-based authentication for remote databases

Configuration

This server is designed to be used as part of an MCP configuration. Here are examples for different environments:

Cline Configuration

Add this to your Cline MCP settings:

{
	"mcpServers": {
		"mcp-memory-libsql": {
			"command": "npx",
			"args": ["-y", "mcp-memory-libsql"],
			"env": {
				"LIBSQL_URL": "file:/path/to/your/database.db"
			}
		}
	}
}

Claude Desktop with WSL Configuration

For a detailed guide on setting up this server with Claude Desktop in WSL, see Getting MCP Server Working with Claude Desktop in WSL.

Add this to your Claude Desktop configuration for WSL environments:

{
	"mcpServers": {
		"mcp-memory-libsql": {
			"command": "wsl.exe",
			"args": [
				"bash",
				"-c",
				"source ~/.nvm/nvm.sh && LIBSQL_URL=file:/path/to/database.db /home/username/.nvm/versions/node/v20.12.1/bin/npx mcp-memory-libsql"
			]
		}
	}
}

Database Configuration

The server supports both local SQLite and remote libSQL databases through the LIBSQL_URL environment variable:

For local SQLite databases:

{
	"env": {
		"LIBSQL_URL": "file:/path/to/database.db"
	}
}

For remote libSQL databases (e.g., Turso):

{
	"env": {
		"LIBSQL_URL": "libsql://your-database.turso.io",
		"LIBSQL_AUTH_TOKEN": "your-auth-token"
	}
}

Note: When using WSL, ensure the database path uses the Linux filesystem format (e.g., /home/username/...) rather than Windows format.

By default, if no URL is provided, it will use file:/memory-tool.db in the current directory.

API

The server implements the standard MCP memory interface with additional vector search capabilities:

  • Entity Management
    • Create/Update entities with embeddings
    • Delete entities
    • Search entities by similarity
  • Relation Management
    • Create relations between entities
    • Delete relations
    • Query related entities

Architecture

The server uses a libSQL database with the following schema:

  • Entities table: Stores entity information and embeddings
  • Relations table: Stores relationships between entities
  • Vector search capabilities implemented using libSQL’s built-in vector operations

Development

Publishing

在 GitHub 查看完整 README

安装

npx -y mcp-memory-libsql
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-memory-libsql": { "command": "npx", "args": ["-y", "mcp-memory-libsql"], "env": { "LIBSQL_URL": "file:/path/to/your/database.db" } } } }