What is Redis MCP?
Redis MCP is a Redis Management and Control Protocol server implementation that provides tools for managing Redis operations using Spring Boot and Spring AI.
How to use Redis MCP?
To use Redis MCP, configure the Redis connection and run the server. You can interact with the server through its API endpoints for various Redis operations.
Key features of Redis MCP?
- Redis key-value operations (set, get, delete)
- Pattern-based key listing
- Optional key expiration time
- SSE-based MCP implementation
Use cases of Redis MCP?
- Managing Redis key-value pairs in applications.
- Automating Redis operations through API calls.
- Monitoring Redis key patterns and expirations.
FAQ from Redis MCP?
- What are the prerequisites for using Redis MCP?
You need JDK 17 or higher, Maven 3.6 or higher, and a Redis server.
- How do I configure the Redis connection?
You can configure the Redis connection using the
redis.url
system property.
- Is Redis MCP open source?
Yes, Redis MCP is licensed under the MIT License.
Redis MCP Server
A Redis Management and Control Protocol (MCP) server implementation using Spring Boot and Spring AI.
Description
This project implements a Redis MCP server that provides a set of tools for Redis operations. It uses spring-ai-mcp-server-webmvc-spring-boot-starter
to implement MCP Server-Sent Events (SSE) functionality.
Prerequisites
- JDK 17 or higher
- Maven 3.6 or higher
- Redis server
Components
- Spring Boot
- Spring AI
- Spring Data Redis
- Lettuce Redis Client
- Jackson
- spring-ai-mcp-server-webmvc-spring-boot-starter
Features
- Redis key-value operations (set, get, delete)
- Pattern-based key listing
- Optional key expiration time
- SSE-based MCP implementation
Configuration
Server Configuration
The Redis connection can be configured using the redis.url
system property. Default value is redis://localhost:6379
.
Example:
java -Dredis.url=redis://your-redis-host:6379 -jar your-app.jar
Cursor Tool Configuration
To use this MCP server in Cursor, add the following configuration to your Cursor settings:
{
"redis-mcp-server": {
"url": "http://localhost:8080/sse",
"enabled": true
}
}
Building
mvn clean package
Running
java -jar target/redis-mcp-server-{version}.jar
API Endpoints
The server exposes the following MCP tools:
set
: Set a Redis key-value pair with optional expiration timeget
: Get value from Redis by keydelete
: Delete one or multiple keys from Redislist
: List Redis keys matching a pattern
License
This project is licensed under the MIT License.