Redis REST API
In-memory data structure store for caching and real-time apps
Redis is an open-source, in-memory data structure store used as a database, cache, message broker, and streaming engine. Developers use Redis for real-time applications requiring sub-millisecond latency, including session management, caching, leaderboards, rate limiting, and pub/sub messaging. It supports various data structures like strings, hashes, lists, sets, sorted sets, bitmaps, and streams.
redis://localhost:6379
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| SET | /key | Set a string value for a key with optional expiration |
| GET | /key | Retrieve the string value of a key. Returns nil if the key does not exist. |
| DEL | /key | Delete one or more keys from the database |
| HSET | /hash/field | Set field in hash to value. Creates the hash if it does not exist. |
| HGET | /hash/field | Get the value of a hash field. Returns nil if field does not exist. |
| LPUSH | /list | Prepend one or multiple values to a list |
| LRANGE | /list/range | Get a range of elements from a list. Requires start and stop indices. |
| SADD | /set | Add one or more members to a set. Returns the count of added members. |
| SMEMBERS | /set | Get all members of a set. Returns an array of all set elements. |
| ZADD | /sortedset | Add members with scores to a sorted set |
| ZRANGE | /sortedset/range | Return a range of members in a sorted set by index |
| PUBLISH | /channel | Publish a message to a channel for pub/sub messaging |
| INCR | /counter | Increment the integer value of a key by one |
| EXPIRE | /key/ttl | Set a timeout on a key in seconds. Key is deleted when timeout expires. |
| SCAN | /keys | Incrementally iterate over keys in the database |
Sponsor this page
AvailableReach developers actively building with Redis. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
# Using redis-cli or HTTP wrapper like Upstash REST API
curl https://your-redis-instance.upstash.io/set/session:12345/user_data \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"value": "{\"userId\": 123, \"name\": \"John\"}", "ex": 3600}'
Use Redis from Claude / Cursor / ChatGPT
Redis is a self-hosted protocol — it lives on a host you operate (default redis://localhost:6379). A
hosted MCP gateway can't reach localhost on your machine, so the usual one-click setup doesn't apply.
These are the tools an MCP for Redis would expose:
redis_cache_set
Store data in Redis cache with optional TTL for fast retrieval in AI workflows
redis_cache_get
Retrieve cached data from Redis to avoid redundant computations or API calls
redis_rate_limit
Implement rate limiting for AI API calls using Redis counters and expiration
redis_session_manager
Manage user session data for multi-turn AI conversations with automatic expiration
redis_queue_tasks
Queue AI processing tasks using Redis lists for asynchronous job processing
Run an Redis MCP locally
The local-CLI version of these tools is on the way (npx @meru/rest-mcp --vendor=redis · BYO connection string · zero secrets sent to us). For now use the patterns below in your own MCP server, or self-host one from the IOX templates.