customredis
Redis MCP Server - Python implementation with docker
Documentation
Redis MCP Server
A professional implementation of a Redis server with MCP (Model Control Protocol) integration, containerized with Docker.
Features
- Redis server with persistence
- MCP server integration for Redis operations
- Docker and Docker Compose support
- Comprehensive error handling and logging
- Environment-based configuration
- Health checks for Redis service
Prerequisites
- Docker
- Docker Compose
Quick Start
1. Clone the repository:
git clone https://github.com/cbuitragoh/customRedis.git
cd customredis2. Start the services:
docker-compose up -d3. Check the logs:
docker-compose logs -fAvailable Redis Operations
The MCP server provides the following Redis operations:
- `set_redis_key(key: str, value: str)`: Set a key-value pair
- `get_redis_key(key: str)`: Retrieve a value by key
- `delete_redis_key(key: str)`: Delete a key
- `list_redis_keys(pattern: str = '*')`: List all keys matching a pattern
Configuration
The application can be configured through environment variables:
- `REDIS_HOST`: Redis server host (default: redis)
- `REDIS_PORT`: Redis server port (default: 6379)
- `REDIS_DB`: Redis database number (default: 0)
- `LOG_LEVEL`: Logging level (default: INFO)
Development
Local Development
1. Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate2. Install dependencies:
pip install -r requirements.txt3. Run the server:
python src/server.pyDocker Development
1. Build the image:
docker-compose build2. Run the services:
docker-compose upProject Structure
.
├── src/
│ └── server.py # Main server implementation
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
├── requirements.txt # Python dependencies
├── .env # Environment variables
└── README.md # This fileError Handling
The application includes comprehensive error handling:
- Connection errors
- Redis operation errors
- Server startup/shutdown errors
- Graceful shutdown on keyboard interrupt
Logging
The application uses Python's logging module with the following features:
- Timestamp-based log entries
- Different log levels (INFO, WARNING, ERROR)
- Detailed error messages
- Operation success/failure logging
Using with Claude Desktop
To use this Redis MCP server with Claude Desktop, add the following configuration to your Claude Desktop settings:
{
"mcpServers": {
"redis": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--network",
"customredis_redis-network",
"customredis-mcp-server"]
}
}
}This configuration:
- Uses Docker to run the Redis MCP server
- Connects to Redis using the host machine's Redis instance
- Runs in interactive mode (-i)
- Removes the container after use (--rm)
- Connect the MCP server to same network to Redis container
Make sure:
1. Redis is running in container from docker-compose redis service
2. The Redis port (6379) is accessible
3. Docker is running on your system
License
MIT License
Frequently asked questions
What is customredis?
customredis is Redis MCP Server - Python implementation with docker
How do I install customredis?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is customredis open source?
Yes — it is hosted on GitHub at https://github.com/cbuitragoh/customRedis.
Related MCP tools
Damn Vulnerable MCP Server Python-based implementation. Trusted by 1200+ developers. Trusted by 1200+ developers. Trusted by 1200+ developers.
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases Python-based implementation. Trusted by 900+ developers.
Query MCP enables end-to-end management of Supabase via chat interface: read & write query executions, management API support, automatic migration versioning...
Model Context Protocol with Neo4j Python-based implementation. Trusted by 700+ developers. Trusted by 700+ developers. Trusted by 700+ developers.
An MCP server that provides control over Android devices via adb Python-based implementation. Trusted by 500+ developers.
A Model Context Protocol (MCP) server for PostgreSQL databases with enhanced capabilities for AI agents. Python-based implementation.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP