A Model Context Protocol (MCP) server implementation that provides Redis database operations through a standardized interface.
-
Key-Value Operations
- Set/Get values
- Delete keys
- Check key existence
- Get key type and TTL
- List all keys
- Get all values
-
Numeric Operations
- Increment values
- Decrement values
-
List Operations
- Push to head (LPUSH)
- Push to tail (RPUSH)
- Get range of elements
-
Set Operations
- Add members
- Get all members
-
Hash Operations
- Set hash fields
- Get hash fields
- Get all hash fields/values
- Clone the repository
- Install dependencies
- Test the Redis MCP server locally by running redis locally (via docker) and run
npm start
- Add to Your Client (eg Cursor)
- In Cursor IDE settings, add a new MCP server with:
- Name: "Redis"
- Type: command
- Command:
node <your path to repo>/server.js
- The Redis tools will now be available in Cursor's command palette
- In Cursor IDE settings, add a new MCP server with:
- Test with these prompts:
- "Set a key 'user:1' with value 'John Doe'"
- "Get the value for key 'user:1'"
- "Create a list 'todos' with items 'buy milk' and 'walk dog'"
- "Get all items from the 'todos' list"
- "List all keys in the database"
- "Add 'alice' and 'bob' to a set called 'users'"
- "Show all members of the 'users' set"
- "Create a hash 'profile:1' with field 'name' set to 'Alice'"
- "Get all fields and values from hash 'profile:1'"
- "Increment a counter 'visits' and show the new value"
- "Check if key 'user:1' exists"
- "Get the type of value stored at 'todos'"
- "Delete the key 'user:1'"