Skip to main content
Glama

mcp-内存-libsql

一个由 libSQL 驱动的高性能持久内存系统,用于模型上下文协议 (MCP)。该服务器使用 libSQL 作为后备存储,提供向量搜索功能和高效的知识存储。

特征

  • 🚀 使用 libSQL 进行高性能向量搜索

  • 💾 实体和关系的持久存储

  • 🔍 语义搜索功能

  • 🔄 知识图谱管理

  • 🌐 兼容本地和远程 libSQL 数据库

  • 🔒 针对远程数据库的安全令牌身份验证

Related MCP server: MCP Memory LibSQL Go

配置

此服务器旨在用作 MCP 配置的一部分。以下是不同环境的示例:

克莱恩配置

将其添加到您的 Cline MCP 设置中:

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

带有 WSL 配置的 Claude 桌面

有关在 WSL 中使用 Claude Desktop 设置此服务器的详细指南,请参阅在 WSL 中让 MCP 服务器与 Claude Desktop 协同工作。

将其添加到 WSL 环境的 Claude Desktop 配置中:

{
	"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"
			]
		}
	}
}

数据库配置

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

对于本地 SQLite 数据库:

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

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

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

注意:使用 WSL 时,请确保数据库路径使用 Linux 文件系统格式(例如, /home/username/... )而不是 Windows 格式。

默认情况下,如果没有提供 URL,它将使用当前目录中的file:/memory-tool.db 。

API

该服务器实现了标准 MCP 内存接口,并具有附加矢量搜索功能:

  • 实体管理

    • 使用嵌入创建/更新实体

    • 删除实体

    • 按相似性搜索实体

  • 关系管理

    • 创建实体之间的关系

    • 删除关系

    • 查询相关实体

建筑学

该服务器使用具有以下模式的 libSQL 数据库:

  • 实体表:存储实体信息和嵌入

  • 关系表:存储实体之间的关系

  • 使用 libSQL 的内置向量操作实现向量搜索功能

发展

出版

由于 npm 2FA 要求,发布需要手动完成:

  1. 创建变更集(记录您的变更):

pnpm changeset
  1. 对软件包进行版本控制(更新版本和 CHANGELOG):

pnpm changeset version
  1. 发布到 npm(将提示输入 2FA 代码):

pnpm release

贡献

欢迎贡献代码!提交 PR 前请阅读我们的贡献指南。

执照

MIT 许可证 - 有关详细信息,请参阅LICENSE文件。

致谢

Available Tools

6 tools
create_entitiesC

Create new entities with observations and optional embeddings

Inputs: entities (required).

create_relationsC

Create relations between entities

Inputs: relations (required).

delete_entityA

Delete an entity and all its associated data (observations and relations)

Inputs: name (required).

delete_relationC

Delete a specific relation between entities

Inputs: source (required), target (required), type (required).

read_graphC

Get recent entities and their relations

Inputs: includeEmbeddings.

search_nodesC

Search for entities and their relations using text or vector similarity

Inputs: query (required), includeEmbeddings.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: create_entities and create_relations handle creation of different object types, delete_entity and delete_relation handle deletion of different object types, read_graph retrieves recent data, and search_nodes performs searches. No ambiguity exists between these operations.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case naming: create_entities, create_relations, delete_entity, delete_relation, read_graph, and search_nodes. The naming is perfectly predictable and uniform throughout the set.

    Tool Count5/5

    With 6 tools, this server is well-scoped for a memory/graph database system. Each tool earns its place by covering essential CRUD operations (create, delete, read/search) for both entities and relations, without being overly complex or insufficient.

    Completeness4/5

    The tool set provides strong coverage for core graph operations: creation and deletion of entities/relations, reading recent data, and searching. A minor gap exists in update operations (e.g., update_entity or update_relation), but agents can work around this by deleting and recreating as needed.

    Related MCP Connectors

    Related MCP Servers