Redis

Redis

Access to Redis database operations.

6.6K

8

44 Tools

Signed
Built by Docker
Requires Secrets
Add to Docker Desktop

Version 4.43 or later needs to be installed to add the server automatically

About

Redis MCP Server

Access to Redis database operations.

What is an MCP Server?

Characteristics

AttributeDetails
Docker Imagemcp/redis
Authorredis
Repositoryhttps://github.com/redis/mcp-redis
Dockerfilehttps://github.com/redis/mcp-redis/blob/main/Dockerfile
Docker Image built byDocker Inc.
Docker Scout Health ScoreDocker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/redis --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceMIT License

Available Tools (44)

Tools provided by this ServerShort Description
client_listGet a list of connected clients to the Redis server.
create_vector_index_hashCreate a Redis 8 vector similarity index using HNSW on a Redis hash.
dbsizeGet the number of keys stored in the Redis database
deleteDelete a Redis key.
expireSet an expiration time for a Redis key.
getGet a Redis string value.
get_index_infoRetrieve schema and information about a specific Redis index using FT.INFO.
get_indexed_keys_numberRetrieve the number of indexed keys by the index
get_indexesList of indexes in the Redis database
get_vector_from_hashRetrieve a vector from a Redis hash and convert it back from binary blob.
hdelDelete a field from a Redis hash.
hexistsCheck if a field exists in a Redis hash.
hgetGet the value of a field in a Redis hash.
hgetallGet all fields and values from a Redis hash.
hsetSet a field in a hash stored at key with an optional expiration time.
infoGet Redis server information and statistics.
json_delDelete a JSON value from Redis at a given path.
json_getRetrieve a JSON value from Redis at a given path.
json_setSet a JSON value in Redis at a given path with an optional expiration time.
llenGet the length of a Redis list.
lpopRemove and return the first element from a Redis list.
lpushPush a value onto the left of a Redis list and optionally set an expiration time.
lrangeGet elements from a Redis list within a specific range.
publishPublish a message to a Redis channel.
renameRenames a Redis key from old_key to new_key.
rpopRemove and return the last element from a Redis list.
rpushPush a value onto the right of a Redis list and optionally set an expiration time.
saddAdd a value to a Redis set with an optional expiration time.
scan_all_keysScan and return ALL keys matching a pattern using multiple SCAN iterations.
scan_keysScan keys in the Redis database using the SCAN command (non-blocking, production-safe).
setSet a Redis string value with an optional expiration time.
set_vector_in_hashStore a vector as a field in a Redis hash.
smembersGet all members of a Redis set.
sremRemove a value from a Redis set.
subscribeSubscribe to a Redis channel.
typeReturns the string representation of the type of the value stored at key
unsubscribeUnsubscribe from a Redis channel.
vector_search_hashPerform a KNN vector similarity search using Redis 8 or later version on vectors stored in hash data structures.
xaddAdd an entry to a Redis stream with an optional expiration time.
xdelDelete an entry from a Redis stream.
xrangeRead entries from a Redis stream.
zaddAdd a member to a Redis sorted set with an optional expiration time.
zrangeRetrieve a range of members from a Redis sorted set.
zremRemove a member from a Redis sorted set.

Tools Details

Tool: client_list

Get a list of connected clients to the Redis server.

Tool: create_vector_index_hash

Create a Redis 8 vector similarity index using HNSW on a Redis hash.

This function sets up a Redis index for approximate nearest neighbor (ANN) search using the HNSW algorithm and float32 vector embeddings.

ParametersTypeDescription
dimintegeroptionalThe dimensionality of the vectors stored under the vector_field.
distance_metricstringoptionalThe distance function to use (e.g., 'COSINE', 'L2', 'IP').
index_namestringoptionalThe name of the Redis index to create. Unless specifically required, use the default name for the index.
prefixstringoptionalThe key prefix used to identify documents to index (e.g., 'doc:'). Unless specifically required, use the default prefix.
vector_fieldstringoptionalThe name of the vector field to be indexed for similarity search. Unless specifically required, use the default field name

Tool: dbsize

Get the number of keys stored in the Redis database

Tool: delete

Delete a Redis key.

ParametersTypeDescription
keystring

Tool: expire

Set an expiration time for a Redis key.

ParametersTypeDescription
expire_secondsintegerTime in seconds after which the key should expire.
namestringThe Redis key.

Tool: get

Get a Redis string value.

ParametersTypeDescription
keystring

Tool: get_index_info

Retrieve schema and information about a specific Redis index using FT.INFO.

ParametersTypeDescription
index_namestring

Tool: get_indexed_keys_number

Retrieve the number of indexed keys by the index

ParametersTypeDescription
index_namestring

Tool: get_indexes

List of indexes in the Redis database

Returns: str: A JSON string containing the list of indexes or an error message.

Tool: get_vector_from_hash

Retrieve a vector from a Redis hash and convert it back from binary blob.

ParametersTypeDescription
namestringThe Redis hash key.
vector_fieldstringoptionalThe field name inside the hash. Unless specifically required, use the default field name

Tool: hdel

Delete a field from a Redis hash.

ParametersTypeDescription
keystringThe field name inside the hash.
namestringThe Redis hash key.

Tool: hexists

Check if a field exists in a Redis hash.

ParametersTypeDescription
keystringThe field name inside the hash.
namestringThe Redis hash key.

Tool: hget

Get the value of a field in a Redis hash.

ParametersTypeDescription
keystringThe field name inside the hash.
namestringThe Redis hash key.

Tool: hgetall

Get all fields and values from a Redis hash.

ParametersTypeDescription
namestringThe Redis hash key.

Tool: hset

Set a field in a hash stored at key with an optional expiration time.

ParametersTypeDescription
keystringThe field name inside the hash.
namestringThe Redis hash key.
valuestringThe value to set.
expire_secondsintegeroptionalOptional; time in seconds after which the key should expire.

Tool: info

Get Redis server information and statistics.

ParametersTypeDescription
sectionstringoptionalThe section of the info command (default, memory, cpu, etc.).

Tool: json_del

Delete a JSON value from Redis at a given path.

ParametersTypeDescription
namestringThe Redis key where the JSON document is stored.
pathstringoptionalThe JSON path to delete (default: root '$').

Tool: json_get

Retrieve a JSON value from Redis at a given path.

ParametersTypeDescription
namestringThe Redis key where the JSON document is stored.
pathstringoptionalThe JSON path to retrieve (default: root '$').

Tool: json_set

Set a JSON value in Redis at a given path with an optional expiration time.

ParametersTypeDescription
namestringThe Redis key where the JSON document is stored.
pathstringThe JSON path where the value should be set.
valuestringThe JSON value to store.
expire_secondsintegeroptionalOptional; time in seconds after which the key should expire.

Tool: llen

Get the length of a Redis list.

ParametersTypeDescription
namestring

Tool: lpop

Remove and return the first element from a Redis list.

ParametersTypeDescription
namestring

Tool: lpush

Push a value onto the left of a Redis list and optionally set an expiration time.

ParametersTypeDescription
namestring
valuestring
expireintegeroptional

Tool: lrange

Get elements from a Redis list within a specific range.

Returns: str: A JSON string containing the list of elements or an error message.

ParametersTypeDescription
namestring
startinteger
stopinteger

Tool: publish

Publish a message to a Redis channel.

ParametersTypeDescription
channelstringThe Redis channel to publish to.
messagestringThe message to send.

Tool: rename

Renames a Redis key from old_key to new_key.

ParametersTypeDescription
new_keystring
old_keystring

Tool: rpop

Remove and return the last element from a Redis list.

ParametersTypeDescription
namestring

Tool: rpush

Push a value onto the right of a Redis list and optionally set an expiration time.

ParametersTypeDescription
namestring
valuestring
expireintegeroptional

Tool: sadd

Add a value to a Redis set with an optional expiration time.

ParametersTypeDescription
namestringThe Redis set key.
valuestringThe value to add to the set.
expire_secondsintegeroptionalOptional; time in seconds after which the set should expire.

Tool: scan_all_keys

Scan and return ALL keys matching a pattern using multiple SCAN iterations.

This function automatically handles the SCAN cursor iteration to collect all matching keys. It's safer than KEYS * for large databases but will still collect all results in memory.

⚠️ WARNING: With very large datasets (millions of keys), this may consume significant memory. For large-scale operations, consider using scan_keys() with manual iteration instead.

ParametersTypeDescription
batch_sizeintegeroptionalNumber of keys to scan per iteration (default 100).
patternstringoptionalPattern to match keys against (default is "*" for all keys).

Tool: scan_keys

Scan keys in the Redis database using the SCAN command (non-blocking, production-safe).

⚠️ IMPORTANT: This returns PARTIAL results from one iteration. Use scan_all_keys() to get ALL matching keys, or call this function multiple times with the returned cursor until cursor becomes 0.

The SCAN command iterates through the keyspace in small chunks, making it safe to use on large databases without blocking other operations.

ParametersTypeDescription
countintegeroptionalHint for the number of keys to return per iteration (default 100).
cursorintegeroptionalThe cursor position to start scanning from (0 to start from beginning).
patternstringoptionalPattern to match keys against (default is "*" for all keys).

Tool: set

Set a Redis string value with an optional expiration time.

ParametersTypeDescription
keystring
valuestring
expirationintegeroptional

Tool: set_vector_in_hash

Store a vector as a field in a Redis hash.

ParametersTypeDescription
namestringThe Redis hash key.
vectorarrayThe vector (list of numbers) to store in the hash.
vector_fieldstringoptionalThe field name inside the hash. Unless specifically required, use the default field name

Tool: smembers

Get all members of a Redis set.

ParametersTypeDescription
namestringThe Redis set key.

Tool: srem

Remove a value from a Redis set.

ParametersTypeDescription
namestringThe Redis set key.
valuestringThe value to remove from the set.

Tool: subscribe

Subscribe to a Redis channel.

ParametersTypeDescription
channelstringThe Redis channel to subscribe to.

Tool: type

Returns the string representation of the type of the value stored at key

ParametersTypeDescription
keystring

Tool: unsubscribe

Unsubscribe from a Redis channel.

ParametersTypeDescription
channelstringThe Redis channel to unsubscribe from.

Tool: vector_search_hash

Perform a KNN vector similarity search using Redis 8 or later version on vectors stored in hash data structures.

ParametersTypeDescription
query_vectorarrayList of floats to use as the query vector.
index_namestringoptionalName of the Redis index. Unless specifically specified, use the default index name.
kintegeroptionalNumber of nearest neighbors to return.
return_fieldsarrayoptionalList of fields to return (optional).
vector_fieldstringoptionalName of the indexed vector field. Unless specifically required, use the default field name

Tool: xadd

Add an entry to a Redis stream with an optional expiration time.

ParametersTypeDescription
fieldsobject
keystring
expirationintegeroptional

Tool: xdel

Delete an entry from a Redis stream.

ParametersTypeDescription
entry_idstring
keystring

Tool: xrange

Read entries from a Redis stream.

ParametersTypeDescription
keystring
countintegeroptional

Tool: zadd

Add a member to a Redis sorted set with an optional expiration time.

ParametersTypeDescription
keystring
memberstring
scorenumber
expirationintegeroptional

Tool: zrange

Retrieve a range of members from a Redis sorted set.

ParametersTypeDescription
endinteger
keystring
startinteger
with_scoresbooleanoptional

Tool: zrem

Remove a member from a Redis sorted set.

ParametersTypeDescription
keystring
memberstring

Use this MCP Server

{
  "mcpServers": {
    "redis": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "REDIS_HOST",
        "-e",
        "REDIS_PORT",
        "-e",
        "REDIS_USERNAME",
        "-e",
        "REDIS_SSL",
        "-e",
        "REDIS_CA_PATH",
        "-e",
        "REDIS_SSL_KEYFILE",
        "-e",
        "REDIS_SSL_CERTFILE",
        "-e",
        "REDIS_CERT_REQS",
        "-e",
        "REDIS_CA_CERTS",
        "-e",
        "REDIS_CLUSTER_MODE",
        "-e",
        "REDIS_PWD",
        "mcp/redis"
      ],
      "env": {
        "REDIS_HOST": "127.0.0.1",
        "REDIS_PORT": "6379",
        "REDIS_USERNAME": "default",
        "REDIS_SSL": "False",
        "REDIS_CA_PATH": "",
        "REDIS_SSL_KEYFILE": "",
        "REDIS_SSL_CERTFILE": "",
        "REDIS_CERT_REQS": "required",
        "REDIS_CA_CERTS": "",
        "REDIS_CLUSTER_MODE": "False",
        "REDIS_PWD": ""
      }
    }
  }
}

Why is it safer to run MCP Servers with Docker?

Manual installation

You can install the MCP server using:

Installation for

Related servers