Secure MCP server configuration for interacting with Redis key-value stores, inspecting cache hits/misses, and managing Pub/Sub topics.
Redis & KeyDB In-Memory Caching MCP Config
Overview
This configuration equips AI agents with direct read/write tools for Redis and KeyDB clusters. Useful for debugging session storage, monitoring key TTLs, inspecting cache eviction rates, and testing Pub/Sub messaging.
MCP Configuration (mcp_config.json)
{
"mcpServers": {
"redis": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-redis"],
"env": {
"REDIS_URL": "redis://127.0.0.1:6379",
"REDIS_KEY_PREFIX": "dev:"
}
}
}
}
Capabilities
redis_get({ key }): Retrieve cached value or JSON state.
redis_ttl({ key }): Check key expiration in seconds.
redis_keys({ pattern }): Scan key names safely without blocking Redis event loop.
redis_publish({ channel, message }): Test real-time Pub/Sub handlers.