Skip to content

Commit 0f543f6

Browse files
committed
feat: 🎉 init from presonal tool
0 parents  commit 0f543f6

11 files changed

Lines changed: 914 additions & 0 deletions

File tree

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Database Configuration
2+
# LIBSQL_URL="libsql://your-database-name.turso.io"
3+
# LIBSQL_AUTH_TOKEN="your-auth-token"
4+
5+
# Local Development (uncomment for local development)
6+
LIBSQL_URL="file:memory-tool.db"

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Dependencies
2+
node_modules/
3+
.pnpm-store/
4+
5+
# Build output
6+
dist/
7+
build/
8+
9+
# Environment variables
10+
.env
11+
.env.local
12+
.env.*.local
13+
14+
# IDE
15+
.vscode/
16+
.idea/
17+
*.swp
18+
*.swo
19+
20+
# Logs
21+
*.log
22+
npm-debug.log*
23+
pnpm-debug.log*
24+
25+
# Testing
26+
coverage/
27+
28+
# Database files
29+
*.db
30+
*.db-journal
31+
32+
# OS
33+
.DS_Store
34+
Thumbs.db

README.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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)

package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "libsql-memory",
3+
"version": "0.0.1",
4+
"description": "LibSQL-based persistent memory tool for MCP",
5+
"type": "module",
6+
"main": "dist/index.js",
7+
"types": "dist/index.d.ts",
8+
"bin": {
9+
"libsql-memory": "./dist/index.js"
10+
},
11+
"scripts": {
12+
"build": "tsc && chmod +x dist/index.js",
13+
"start": "node dist/index.js",
14+
"dev": "node --loader ts-node/esm src/index.ts",
15+
"test": "jest",
16+
"migrate": "node --loader ts-node/esm src/db/migrations/run.ts",
17+
"prepare": "pnpm run build"
18+
},
19+
"dependencies": {
20+
"@libsql/client": "^0.14.0",
21+
"@modelcontextprotocol/sdk": "1.1.1",
22+
"@types/node": "^22.10.6",
23+
"dotenv": "^16.4.7"
24+
},
25+
"devDependencies": {
26+
"@types/jest": "^29.5.14",
27+
"jest": "^29.7.0",
28+
"ts-jest": "^29.2.5",
29+
"ts-node": "^10.9.2",
30+
"typescript": "^5.7.3"
31+
},
32+
"volta": {
33+
"node": "22.13.0"
34+
}
35+
}

0 commit comments

Comments
 (0)