Get the FREE Ultimate OpenClaw Setup Guide →

redis

A Redis Management and Control Protocol (MCP) server implementation using Spring Boot and Spring AI

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio yyue9527-redis-mcp-server docker run -i redis-mcp-server \
  --env REDIS_URL="redis connection string, e.g. redis://localhost:6379 (optional; defaults to localhost if not provided)"

How to use

This MCP server implements a Redis management interface over MCP with Server-Sent Events (SSE). It exposes tools for common Redis operations such as setting and getting key-value pairs, deleting keys, and listing keys by pattern. The server is built on Spring Boot with Spring AI MCP Server middleware and uses a Redis client (Lettuce) to communicate with the Redis backend. Clients can subscribe to the SSE endpoint and issue MCP tool commands to interact with Redis in real time, enabling streaming updates and command results.

To use it, first ensure the server is running (see installation). Once running, connect to the SSE endpoint configured for MCP (as described in the configuration section). You can then invoke the available MCP tools: set to store a key with an optional expiration, get to retrieve a value by key, delete to remove one or more keys, and list to fetch keys matching a pattern. The server supports optional expiration for keys and returns results through the MCP streaming interface, enabling lightweight, event-driven client integrations.

How to install

Prerequisites:

  • JDK 17 or higher
  • Maven 3.6 or higher
  • Redis server (or access to a Redis instance)
  1. Clone the repository git clone <repository-url> cd redis-mcp-server

  2. Build the project mvn clean package

  3. Run the server locally (example) java -jar target/redis-mcp-server-{version}.jar

  4. Run via Docker (optional)

    • Build the Docker image if a Dockerfile is provided, or pull a prebuilt image if available
    • Run: docker run -p 8080:8080 redis-mcp-server
  5. Verify installation

    • Ensure Redis is reachable at the configured URL (default redis://localhost:6379)
    • Access the MCP SSE endpoint (as per configuration) to verify tools like set, get, delete, and list are available

Additional notes

Tips and potential issues:

  • The Redis connection is configured via the redis.url property; ensure it points to a reachable Redis instance (default is redis://localhost:6379).
  • If running behind a reverse proxy or SSL terminator, ensure SSE endpoints are accessible and CORS settings are configured as needed.
  • When using the list tool, be mindful of keyspace patterns and potential performance implications on large datasets.
  • If you encounter authentication errors with Redis, verify access credentials and Redis ACLs.
  • For local development, you can override Redis URL using environment variable REDIS_URL if your deployment strategy supports it.
  • Ensure Java 17+ and Maven are installed and available in your PATH when building or running locally.

Related MCP Servers

Sponsor this space

Reach thousands of developers