mcp-server-redis
This project provides a Model Context Protocol (MCP) Server designed for interacting with Redis. It includes a variety of tools and resources to manage connections and perform operations on Redis data structures with error handling and automatic reconnection capabilities.
Overview
This project provides a server implementation for interacting with Redis using the Model Context Protocol (MCP). It includes features for managing Redis connections, retrieving server status, and performing various operations on keys, lists, hashes, sets, and Pub/Sub systems. The server supports automatic reconnection to Redis and offers comprehensive error handling with meaningful responses. Users can utilize tools for basic operations like setting and getting values, managing lists, hashes, and sets, as well as publishing messages via Pub/Sub.
Usage
- Install the required dependencies.
- Configure the Redis connection using the
.env.example
file. - Run the server with
python src/server.py
. - Test using the MCP Inspector or install in Claude Desktop.
Capabilities of this server
- Resources:
- redis://status - Current connection status
- redis://info - Redis server information
- redis://keys/{pattern} - List keys matching a pattern
- Tools:
- Basic operations (get, set, delete, increment values)
- List operations (push, get range)
- Hash operations (set, get fields)
- Set operations (add, get members)
- Pub/Sub (publish messages)
The server facilitates seamless integration with Redis and can be extended for specific use cases by adding more commands.