Self-hosted
Databases Basic Auth

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.

Base URL redis://localhost:6379

API Endpoints

MethodEndpointDescription
SET/keySet a string value for a key with optional expiration
GET/keyRetrieve the string value of a key. Returns nil if the key does not exist.
DEL/keyDelete one or more keys from the database
HSET/hash/fieldSet field in hash to value. Creates the hash if it does not exist.
HGET/hash/fieldGet the value of a hash field. Returns nil if field does not exist.
LPUSH/listPrepend one or multiple values to a list
LRANGE/list/rangeGet a range of elements from a list. Requires start and stop indices.
SADD/setAdd one or more members to a set. Returns the count of added members.
SMEMBERS/setGet all members of a set. Returns an array of all set elements.
ZADD/sortedsetAdd members with scores to a sorted set
ZRANGE/sortedset/rangeReturn a range of members in a sorted set by index
PUBLISH/channelPublish a message to a channel for pub/sub messaging
INCR/counterIncrement the integer value of a key by one
EXPIRE/key/ttlSet a timeout on a key in seconds. Key is deleted when timeout expires.
SCAN/keysIncrementally iterate over keys in the database

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.

Build your own Redis MCP →

Related APIs