mcp/redis

Verified Publisher

By mcp

Updated about 2 months ago

Access to Redis database operations.

Image
Machine learning & AI
13

10K+

mcp/redis repository overview

Redis MCP Server

Access to Redis database operations.

What is an MCP Server?

MCP Info

Image Building Info

AttributeDetails
Dockerfilehttps://github.com/redis/mcp-redis/blob/1f35871886f39736a2924cfd5f346eef5adc387b/Dockerfile
Commit1f35871886f39736a2924cfd5f346eef5adc387b
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 (45)

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).
search_redis_documentsSearch Redis documentation and knowledge base to learn about Redis concepts and use cases.
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
diminteger optionalThe dimensionality of the vectors stored under the vector_field.
distance_metricstring optionalThe distance function to use (e.g., 'COSINE', 'L2', 'IP').
index_namestring optionalThe name of the Redis index to create. Unless specifically required, use the default name for the index.
prefixstring optionalThe key prefix used to identify documents to index (e.g., 'doc:'). Unless specifically required, use the default prefix.
vector_fieldstring optionalThe 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_fieldstring optionalThe 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_secondsstring optionalOptional; time in seconds after which the key should expire.

Tool: info

Get Redis server information and statistics.

ParametersTypeDescription
sectionstring optionalThe 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.
pathstring optionalThe 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.
pathstring optionalThe 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 (as JSON string, or will be auto-converted).
expire_secondsstring optionalOptional; 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
expirestring optional

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
expirestring optional

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_secondsstring optionalOptional; 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_sizeinteger optionalNumber of keys to scan per iteration (default 100).
patternstring optionalPattern 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
countinteger optionalHint for the number of keys to return per iteration (default 100).
cursorinteger optionalThe cursor position to start scanning from (0 to start from beginning).
patternstring optionalPattern to match keys against (default is "*" for all keys).

Tool: search_redis_documents

Search Redis documentation and knowledge base to learn about Redis concepts and use cases.

This tool exposes updated and curated documentation, and must be invoked every time the user wants to learn more in areas including:

Common Use Cases:

  • Session Management: User session storage and management
  • Caching: Application-level and database query caching
  • Rate Limiting: API throttling and request limiting
  • Leaderboards: Gaming and ranking systems
  • Semantic Search: AI-powered similarity search
  • Agentic Workflows: AI agent state and memory management
  • RAG (Retrieval-Augmented Generation): Vector storage for AI applications
  • Real-time Analytics: Counters, metrics, and time-series data
  • Message Queues: Task queues and job processing
  • Geospatial: Location-based queries and proximity search Parameters|Type|Description -|-|- question|string|The question about Redis concepts, data structures, features, or use cases

Tool: set

Set a Redis string value with an optional expiration time.

ParametersTypeDescription
keystring
valuestring
expirationstring optional

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_fieldstring optionalThe 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_namestring optionalName of the Redis index. Unless specifically specified, use the default index name.
kinteger optionalNumber of nearest neighbors to return.
return_fieldsstring optionalList of fields to return (optional).
vector_fieldstring optionalName 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
expirationstring optional

Tool: xdel

Delete an entry from a Redis stream.

ParametersTypeDescription
entry_idstring
keystring

Tool: xrange

Read entries from a Redis stream.

ParametersTypeDescription
keystring
countinteger optional

Tool: zadd

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

ParametersTypeDescription
keystring
memberstring
scorenumber
expirationstring optional

Tool: zrange

Retrieve a range of members from a Redis sorted set.

ParametersTypeDescription
endinteger
keystring
startinteger
with_scoresboolean optional

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?

Install from MCP:Hub

Tag summary

Content type

Image

Digest

sha256:c9162917b

Size

149.8 MB

Last updated

about 2 months ago

docker pull mcp/redis

This week's pulls

Pulls:

573

Last week