slow_groovin_unstorage_mcp

slow_groovin_unstorage_mcp

by slow-groovin
A Key-Value storage MCP server based on unjs/unstorage, supporting drivers like redis, mongodb, and filesystem.

Key-Value Storage MCP Server

Overview

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.

Supported Drivers

  • Memory
  • Filesystem
  • Redis
  • HTTP Server
  • MongoDB

Tools

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)

Installation

Minimal Configuration

{
  "mcpServers": {
    "unstorage": {
      "command": "npx",
      "args": ["/y", "@slow-groovin/unstorage-mcp"]
    }
  }
}

Maximum Configuration

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

For Cline+Windows

{
  "mcpServers": {
    "unstorage": {
      "command": "cmd",
      "args": ["/c", "npx", "/y", "@slow-groovin/unstorage-mcp"]
    }
  }
}

Environment Variables

Redis

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

MongoDB

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

Filesystem

Syntax Description Default Value Optional
FS_BASE Base of filesystem driver - No
FS_MOUNT_POINT Mount point of this storage "/" Yes

HTTP Server

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

Memory

If no mount is set on the root ("/"), a memory driver will be automatically mounted.

Extending the Server

  1. Clone the repository.
  2. Copy src/storage/redis.ts to a new file and modify it to create a custom driver.
  3. Test and verify the new driver.
  4. (Optional) Submit a merge request.

Prompts for Cursor/Cline Assisted Programming

@/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.

Debugging

MCP Inspector

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

TSX MCP Server Config for Local Development

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

License

This project is licensed under the MIT License.

Resources

Features & Capabilities

Categories
mcp_server model_context_protocol javascript typescript redis mongodb filesystem api_integration

Implementation Details

Stats

0 Views
0 Favorites
0 GitHub Stars

Repository Info

slow-groovin Organization

Similar Servers

continuedev_continue by continuedev
0
0
0