SM

spences10/mcp-memory-libsql

开发工具

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

87 stars 18 forks 质量 86 趋势 20MIT

spences10/mcp-memory-libsql 是从 https://github.com/spences10/mcp-memory-libsql. 导入的 MCP 服务器候选

概览

spences10/mcp-memory-libsql 是从 https://github.com/spences10/mcp-memory-libsql. 导入的 MCP 服务器候选

概述(AI 翻译)

一个高性能、持久的模型上下文内存系统 由libSQL驱动的协议(MCP),并针对LLM优化了文本搜索 情境效率。

特色

  • 🚀 带相关性排名的高性能文本搜索
  • 💾 实体和关系的持久存储
  • 🔍 具模糊匹配功能的灵活文本搜索
  • 🎯 为LLM效率进行上下文优化
  • 🔄 知识图谱管理
  • 🌐 兼容本地和远程的 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 with optimized text search for LLM context efficiency.

Features

  • 🚀 High-performance text search with relevance ranking
  • 💾 Persistent storage of entities and relations
  • 🔍 Flexible text search with fuzzy matching
  • 🎯 Context-optimized for LLM efficiency
  • 🔄 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 optimized text search:

  • Entity Management
    • Create/Update entities with observations
    • Delete entities
    • Search entities by text with relevance ranking
    • Explore entity relationships
  • 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 with timestamps
  • Observations table: Stores entity observations
  • Relations table: Stores relationships between entities
在 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" } } } }