|
| 1 | +# mcp-memory-libsql |
| 2 | + |
| 3 | +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. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- 🚀 High-performance vector search using libSQL |
| 8 | +- 💾 Persistent storage of entities and relations |
| 9 | +- 🔍 Semantic search capabilities |
| 10 | +- 🔄 Knowledge graph management |
| 11 | +- 🌐 Compatible with local and remote libSQL databases |
| 12 | +- 🔒 Secure token-based authentication for remote databases |
| 13 | + |
| 14 | +## Installation |
| 15 | + |
| 16 | +```bash |
| 17 | +npm install mcp-memory-libsql |
| 18 | +``` |
| 19 | + |
| 20 | +Or with pnpm: |
| 21 | + |
| 22 | +```bash |
| 23 | +pnpm add mcp-memory-libsql |
| 24 | +``` |
| 25 | + |
| 26 | +## Usage |
| 27 | + |
| 28 | +### Starting the Server |
| 29 | + |
| 30 | +You can start the server using npx: |
| 31 | + |
| 32 | +```bash |
| 33 | +npx mcp-memory-libsql |
| 34 | +``` |
| 35 | + |
| 36 | +### Configuration |
| 37 | + |
| 38 | +The server can be configured by passing environment variables when starting the server: |
| 39 | + |
| 40 | +```bash |
| 41 | +# For a local SQLite database: |
| 42 | +LIBSQL_URL=file:/path/to/your/database.db npx mcp-memory-libsql |
| 43 | + |
| 44 | +# For a remote libSQL database (e.g., Turso): |
| 45 | +LIBSQL_URL=libsql://your-database.turso.io LIBSQL_AUTH_TOKEN=your-auth-token npx mcp-memory-libsql |
| 46 | +``` |
| 47 | + |
| 48 | +By default, if no URL is provided, it will use `file:/memory-tool.db` in the current directory. |
| 49 | + |
| 50 | +### Claude Desktop Configuration |
| 51 | + |
| 52 | +Add this to your Claude Desktop configuration: |
| 53 | + |
| 54 | +```json |
| 55 | +{ |
| 56 | + "mcpServers": { |
| 57 | + "memory": { |
| 58 | + "command": "npx", |
| 59 | + "args": ["-y", "mcp-memory-libsql"] |
| 60 | + } |
| 61 | + } |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +## Development |
| 66 | + |
| 67 | +### Prerequisites |
| 68 | + |
| 69 | +- Node.js 22.13.0 or higher |
| 70 | +- pnpm (recommended) or npm |
| 71 | + |
| 72 | +### Setup |
| 73 | + |
| 74 | +1. Clone the repository: |
| 75 | + |
| 76 | +```bash |
| 77 | +git clone https://github.com/yourusername/mcp-memory-libsql.git |
| 78 | +cd mcp-memory-libsql |
| 79 | +``` |
| 80 | + |
| 81 | +2. Install dependencies: |
| 82 | + |
| 83 | +```bash |
| 84 | +pnpm install |
| 85 | +``` |
| 86 | + |
| 87 | +3. Run database migrations: |
| 88 | + |
| 89 | +```bash |
| 90 | +pnpm run migrate |
| 91 | +``` |
| 92 | + |
| 93 | +4. Build the project: |
| 94 | + |
| 95 | +```bash |
| 96 | +pnpm run build |
| 97 | +``` |
| 98 | + |
| 99 | +### Running Tests |
| 100 | + |
| 101 | +```bash |
| 102 | +pnpm test |
| 103 | +``` |
| 104 | + |
| 105 | +### Development Mode |
| 106 | + |
| 107 | +```bash |
| 108 | +pnpm run dev |
| 109 | +``` |
| 110 | + |
| 111 | +## API |
| 112 | + |
| 113 | +The server implements the standard MCP memory interface with additional vector search capabilities: |
| 114 | + |
| 115 | +- Entity Management |
| 116 | + - Create/Update entities with embeddings |
| 117 | + - Delete entities |
| 118 | + - Search entities by similarity |
| 119 | +- Relation Management |
| 120 | + - Create relations between entities |
| 121 | + - Delete relations |
| 122 | + - Query related entities |
| 123 | + |
| 124 | +## Architecture |
| 125 | + |
| 126 | +The server uses a libSQL database with the following schema: |
| 127 | + |
| 128 | +- Entities table: Stores entity information and embeddings |
| 129 | +- Relations table: Stores relationships between entities |
| 130 | +- Vector search capabilities implemented using libSQL's built-in vector operations |
| 131 | + |
| 132 | +## Contributing |
| 133 | + |
| 134 | +Contributions are welcome! Please read our contributing guidelines before submitting pull requests. |
| 135 | + |
| 136 | +## License |
| 137 | + |
| 138 | +MIT License - see the [LICENSE](LICENSE) file for details. |
| 139 | + |
| 140 | +## Acknowledgments |
| 141 | + |
| 142 | +- Built on the [Model Context Protocol](https://github.com/modelcontextprotocol) |
| 143 | +- Powered by [libSQL](https://github.com/tursodatabase/libsql) |
0 commit comments