The Key-Value Storage MCP Server is a robust server implementation based on unjs/unstorage. It supports multiple storage drivers, including Redis, MongoDB, filesystem, and HTTP server, making it a versatile solution for key-value storage needs.
The server provides a variety of tools for managing key-value pairs:
- showMounts()
- getItem(key)
- getItems(items)
- getItemRaw(key)
- getMeta(key, nativeOnly)
- getKeys(base, maxDepth)
- setItem(key, value)
- setItems(items)
- setItemRaw(key, value)
- setMeta(key, meta)
- removeItem(key, removeMeta)
- removeMeta(key)
{
"mcpServers": {
"unstorage": {
"command": "npx",
"args": ["/y", "@slow-groovin/unstorage-mcp"]
}
}
}
{
"mcpServers": {
"unstorage": {
"command": "npx",
"env": {
"REDIS_URL": "redis://default:123456@localhost:6379",
"REDIS_BASE": "visits:date:api:",
"REDIS_MOUNT_POINT": "redis_storage",
"FS_BASE": "D:/tmp",
"FS_MOUNT_POINT": "fs_storage",
"HTTP_BASE": "http://localhost:3001",
"HTTP_MOUNT_POINT": "http_storage",
"HTTP_HEADERS": "Authorization=Bear 123;A=3;B=4;C=5",
"MONGODB_URL": "mongodb://root:123456@localhost:27017/",
"MONGODB_DB_NAME": "test",
"MONGODB_COLLECTION_NAME": "unstorage",
"MONGODB_MOUNT_POINT": "mongo_storage"
},
"args": ["/y", "@slow-groovin/unstorage-mcp", "--disable-modify"]
}
}
}
{
"mcpServers": {
"unstorage": {
"command": "cmd",
"args": ["/c", "npx", "/y", "@slow-groovin/unstorage-mcp"]
}
}
}
Syntax | Description | Default Value | Optional |
---|---|---|---|
REDIS_URL |
Redis connect URL | - | No |
REDIS_BASE |
Base of Redis driver | - | Yes |
REDIS_MOUNT_POINT |
Mount point of this storage | "/" | Yes |
Syntax | Description | Default Value | Optional |
---|---|---|---|
MONGODB_URL |
MongoDB connect URL | - | No |
MONGODB_DB_NAME |
MongoDB database name | - | No |
MONGODB_COLLECTION_NAME |
MongoDB collection name | - | No |
MONGODB_MOUNT_POINT |
Mount point of this storage | "/" | Yes |
Syntax | Description | Default Value | Optional |
---|---|---|---|
FS_BASE |
Base of filesystem driver | - | No |
FS_MOUNT_POINT |
Mount point of this storage | "/" | Yes |
Syntax | Description | Default Value | Optional |
---|---|---|---|
HTTP_BASE |
Base of HTTP driver | - | No |
HTTP_MOUNT_POINT |
Mount point of this storage | "/" | Yes |
HTTP_HEADERS |
Headers for HTTP requests | - | Yes |
If no mount is set on the root ("/"), a memory driver will be automatically mounted.
src/storage/redis.ts
to a new file and modify it to create a custom driver.@/src/storage/mongodb.ts , please implement this file:
1. You need to fetch information using the storage type's corresponding Doc URL (https://unstorage.unjs.io/drivers/<storage type>).
2. You can refer to examples in @/src/adapter/redis.ts and @/src/storage/http.ts.
3. You are only responsible for generating the code and do not need to perform testing.
mcp-inspector -e HTTP_BASE=http://localhost:3001 -e HTTP_MOUNT_POINT=http_storage -e FS_BASE=D:/temp -e FS_MOUNT_POINT=fs_storage -e HTTP_HEADERS="Authorization=Bear 123;" tsx ./src/index.ts
{
"mcpServers": {
"command": "cmd",
"env": {
"REDIS_URL": "redis://default:123456@localhost:6379",
"REDIS_BASE": "my:mcp:values:",
"REDIS_MOUNT_POINT": "redis_storage"
},
"args": ["/c", "tsx", "D:/xxx/projects/unstorage-mcp/src/index.ts"]
}
}
This project is licensed under the MIT License.