mcp -redis
MCP server to interact with Redis Server, AWS Memory DB, etc for caching or other use-cases where in-memory and key-value based storage is appropriate
claude mcp add --transport stdio prajwalnayak7-mcp-server-redis python src/server.py \ --env ENV_FILE=".env or path to environment file" \ --env REDIS_DB="0" \ --env REDIS_HOST="localhost or your Redis host" \ --env REDIS_PORT="6379" \ --env REDIS_PASSWORD="your_redis_password (optional)"
How to use
This MCP server provides Redis integration with a set of resources and tools to interact with a Redis instance. It exposes resources to check the current connection status, view Redis information, and list keys matching a pattern. The available tools cover common Redis operations: basic key-value interactions (get, set with optional expiry, delete, increment), list operations (push and range), hash operations (set and get fields), set operations (add and list members), and a Pub/Sub capability (publish messages). The server automatically reconnects if the Redis connection is lost. To use it, configure your Redis connection in the environment (as described in the installation notes) and start the server. You can then query resources like redis://status or redis://keys/{pattern} and invoke tools such as set_value, get_value, list_push, hash_set, publish_message, etc., through the MCP Inspector or your preferred MCP client.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- Access to a Redis server (local or remote)
- Optional: uv (as described in the project docs) for environment setup
Installation steps:
- Clone the repository containing the MCP server (or download the project files).
- Create and activate a Python virtual environment (recommended):
- python -m venv .venv
- source .venv/bin/activate # macOS/Linux
- .venv\Scripts\activate # Windows
- Install dependencies if a requirements file is provided, or rely on uv tooling as shown in the docs:
- uv venv # if using the uv workflow described in the README
- uv sync # to synchronize the project with the MCP setup (per the docs)
- Copy the example environment configuration and customize Redis connection details:
- cp .env.example .env # then edit REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_DB as needed
- Start the server:
- python src/server.py
Notes:
- Ensure the Redis server is reachable from where you run the MCP server (network/firewall considerations may apply).
- Install any additional dependencies that appear in pyproject.toml or requirements.txt if applicable.
Additional notes
Tips and common issues:
- If the server cannot connect to Redis, verify REDIS_HOST, REDIS_PORT, and authentication settings in your environment (.env).
- The README indicates helper tools and resources; use redis://status for connection status and redis://keys/{pattern} to search keys. Ensure your Redis instance is configured to allow the commands you intend to run.
- The MCP flow includes automatic reconnection; if you see transient errors, check your Redis server logs for intermittent connectivity issues.
- When testing with the MCP Inspector, you can verify capabilities by invoking tools like get_value, set_value, list_push, hash_set, and publish_message to ensure end-to-end operation.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP