Back to MCP Catalog

Redis Client MCP Server

DatabasesPython
Interact with Redis servers for caching and key-value storage operations
Available Tools

get_value

Get a value from Redis by key

key

set_value

Set a value in Redis with optional expiry

keyvalueexpiry

delete_key

Delete a key from Redis

key

increment

Increment a numeric value in Redis

keyamount

list_push

Push values to a Redis list

keyvaluesside

list_range

Get range of Redis list values

keystartend

hash_set

Set Redis hash fields

keyfields

hash_get

Get Redis hash fields

keyfields

set_add

Add values to a Redis set

keyvalues

set_members

Get members of a Redis set

key

publish_message

Publish a message to a Redis channel

channelmessage

The Redis Client MCP provides a comprehensive interface to interact with Redis servers, AWS MemoryDB, and other Redis-compatible services. It enables AI assistants to perform key-value operations, manage lists, hashes, sets, and utilize pub/sub functionality directly through Redis. This MCP is ideal for applications requiring fast in-memory data storage, caching solutions, or any use case where key-value based storage is appropriate. It handles connection management automatically and provides a rich set of tools for manipulating data in Redis.

Installation

To use the Redis Client MCP, you'll need to set up the server and configure it to connect to your Redis instance.

Prerequisites

  • Python 3.8 or higher
  • A Redis server or compatible service (like AWS MemoryDB)
  • uv package manager (recommended)

Setup

  1. Clone the repository:
git clone https://github.com/prajwalnayak7/mcp-server-redis.git
cd mcp-server-redis
  1. Create and activate a virtual environment:
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
uv sync
  1. Configure your Redis connection by creating a .env file based on the provided .env.example:
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=  # If required
REDIS_SSL=false  # Set to true for SSL connections
  1. Run the server:
python src/server.py

Integration with Claude or other AI assistants

Add the following configuration to your AI assistant's settings:

"mcpServers": {
  "redis-client": {
    "command": "python",
    "args": [
      "PATH_TO_REPO/mcp-server-redis/src/server.py"
    ]
  }
}

Replace PATH_TO_REPO with the actual path to where you cloned the repository.

Docker Deployment

The MCP can also be run using Docker:

  1. Build the Docker image:
docker build -t redis-mcp-server .
  1. Run the container:
docker run -p 8000:8000 -e REDIS_HOST=your-redis-host -e REDIS_PORT=6379 redis-mcp-server

Usage

Once the MCP is running and connected to your AI assistant, you can interact with Redis through natural language. The MCP provides resources for checking connection status and tools for manipulating data.

Example Interactions

Checking connection status:

User: What's the current Redis connection status?
AI: Let me check the Redis connection status for you.
[Reading resource redis://status]
The Redis server is currently connected and running on localhost:6379, database 0.

Storing data:

User: Can you store my name "Alice" in Redis?
AI: I'll help you store your name in Redis.
[Calling set_value with key="name" value="Alice"]
Successfully set key 'name'

Retrieving data:

User: What's the value of the "name" key?
AI: Let me retrieve that for you.
[Calling get_value with key="name"]
The value for key "name" is "Alice".

Resources

The MCP provides several resources for interacting with Redis:

  • redis://status - Shows the current connection status
  • redis://info - Provides detailed Redis server information
  • redis://keys/{pattern} - Lists keys matching a specified pattern

These resources can be accessed directly by the AI assistant to gather information about the Redis server and its data.

Related MCPs

Milvus Vector Database
DatabasesPython

Connect to Milvus vector database for semantic search and vector operations

MotherDuck DuckDB
DatabasesPython

SQL analytics with DuckDB and MotherDuck for AI assistants

Alibaba Cloud Tablestore
DatabasesJava, Python

Connect to Alibaba Cloud Tablestore for vector search and RAG applications

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.