Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-memory-libsql

MCP.Pizza Chef: spences10

mcp-memory-libsql is a high-performance, persistent memory server designed for the Model Context Protocol (MCP). Powered by libSQL, it offers advanced vector search capabilities, semantic knowledge storage, and efficient management of knowledge graphs. This server supports both local and remote libSQL databases with secure token-based authentication, making it ideal for AI agents and applications requiring robust, scalable memory and relationship handling. It integrates seamlessly into MCP configurations to enhance real-time context management and retrieval.

Use This MCP server To

Store and retrieve semantic knowledge for AI agents Perform high-speed vector similarity searches Manage complex knowledge graphs persistently Enable secure remote access to memory databases Support real-time context memory in MCP workflows Integrate persistent memory with AI-enhanced applications

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.

Glama badge

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

Due to npm 2FA requirements, publishing needs to be done manually:

  1. Create a changeset (documents your changes):
pnpm changeset
  1. Version the package (updates version and CHANGELOG):
pnpm changeset version
  1. Publish to npm (will prompt for 2FA code):
pnpm release

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

License

MIT License - see the LICENSE file for details.

Acknowledgments

mcp-memory-libsql FAQ

How do I configure mcp-memory-libsql in my MCP setup?
You add it to your MCP server configuration, typically using a command like 'npx mcp-memory-libsql' with appropriate arguments in your MCP client settings.
Can mcp-memory-libsql connect to remote libSQL databases?
Yes, it supports both local and remote libSQL databases with secure token-based authentication for remote connections.
What kind of search capabilities does mcp-memory-libsql provide?
It offers high-performance vector search and semantic search capabilities to efficiently retrieve relevant knowledge.
Is the data stored by mcp-memory-libsql persistent?
Yes, it provides persistent storage of entities and their relationships, ensuring data durability across sessions.
How does mcp-memory-libsql handle security?
For remote databases, it uses secure token-based authentication to protect access and data integrity.
What makes mcp-memory-libsql suitable for AI agents?
Its combination of vector search, semantic knowledge storage, and knowledge graph management enables AI agents to access and reason over rich contextual memory efficiently.
Can mcp-memory-libsql be used with multiple MCP hosts?
Yes, it is designed to integrate with various MCP hosts, providing a centralized persistent memory layer.
Does mcp-memory-libsql support relationship management between entities?
Yes, it efficiently manages relationships within knowledge graphs, supporting complex data interconnections.