Redis MCP server tools: which ones delete your keys, and how to make your agent ask
All 53 tools of Redis's official MCP server (redis-mcp-server 0.5.1), checked by running it against Redis 8 with ACL users: why there is no read-only mode, how an add with an expiry deletes the whole key, which read claims stream jobs, and the Claude Code settings that make the rest ask.
Checked on by running redis-mcp-server 0.5.1 (PyPI, run with uvx) from redis/mcp-redis and reading its tools/list answer. Each tier is the tool risk checker’s reading, with our reason wherever we changed it. Written by the people who make VariantGate.
The short answer
It has no read-only mode and no way to switch tools off, so the Redis user is the only real limit. Connect as an ACL user with +@read -@dangerous on the keys it needs; 25 of its 53 tools can then run on their own, and every write is refused by Redis. Add +@pubsub and channels if it should use the subscribe tools.
- Can run on their own
- 25
- Should ask a person
- 28
Which Redis server this is
This page is about Redis’s own server, redis/mcp-redis, published on PyPI as redis-mcp-server. We ran 0.5.1, the latest release, with uvx against Redis 8 in Docker, once as the default user and once as ACL users with fewer rights. It offers all 53 tools every time: there is no read-only mode, no flag to switch tools off, and the tools give no read-only or destructive hints. It has no tool that runs an arbitrary command or a Lua script. The limit is the Redis user it connects as.
An add with an expiry can delete the whole key
hset, sadd, json_set, lpush, rpush, zadd and xadd take an optional expiry. It is set on the whole key, not on the field or entry being added, and Redis deletes a key whose expiry is 0 or less. We tried it on keys that held data:
hsetof one field withexpire_seconds: 0on a hash with three fields answered “set successfully”. The hash was gone.saddandjson_setdid the same.lpush,rpush,zaddandxaddignore 0 but not -1: the list, sorted set and stream were each deleted.- A positive expiry is a timer on everything: one field with 60 seconds gave the whole user hash 60 seconds to live.
Three more writes replace data without saying so. set on a hash key turned it into a string. rename onto an existing key overwrote it. expire with 0 deleted a counter at once.
Reads that are not quite reads
xreadgroup reads a stream through a consumer group, and that claims the entries for the consumer it names. We read three jobs as claude; the group’s real worker then asked for new jobs and got none, and all three sat pending under claude.
scan_all_keys loops SCAN to the end. On a million keys it took about 10 seconds and returned 12.9 million characters. scan_keys passes its count straight to Redis: one call with a count of 2,000,000 held the server for 82 ms by its own slow log, and every other client waited. search_redis_documents sends its question to redis.io unless MCP_DOCS_SEARCH_URL is set to empty.
What we did not find: info with section everything and client_list returned no password or password hash from a Redis with requirepass and ACL users. client_list does show every connection’s address and ACL user name.
Give it an ACL user that can only read
ACL SETUSER agent on >… resetkeys ~app:* resetchannels -@all +@read -@dangerous +info +ft._list +ft.infoclaude mcp add redis -e REDIS_USERNAME=agent -e REDIS_PWD=… -- uvx --from redis-mcp-server@0.5.1 redis-mcp-server --host redis.internal --port 6379 --sslAs this user, and as the same user without the last three commands, the reads worked and Redis refused every write we tried: set, delete, expire, hset, json_set, rename, lpop, publish, xack, xreadgroup and create_vector_index_hash. -@dangerous alone also blocks info, get_indexes and get_index_info, hence the three commands added back. Two cautions. Key patterns do not limit SCAN, so scan_all_keys still listed key names outside app:*, while reading their values was refused. And refusals come back as ordinary answers starting with “Error”, not as failed calls.
Pass the host, port and --ssl as flags. The command’s own defaults override REDIS_HOST, REDIS_PORT, REDIS_DB and REDIS_SSL: with REDIS_SSL=true and REDIS_DB=3 set, it connected without TLS and wrote to database 0. The user name and password are read from the environment as documented.
All 53 tools
Hard to undo20 toolsAsk a person every time. Consider two people, or deny it if the agent never needs it.
hsetSet a field in a hash stored at key with an optional expiration time.
Server gives no read-only or destructive hint
Our call: Its expiry is set on the whole key, not the new entry, and an expiry of 0 or below deletes the key. We added one field with 0 and the whole key was gone, reported as a success.
hdelDelete a field from a Redis hash.
Server gives no read-only or destructive hint
json_setSet a JSON value in Redis at a given path with an optional expiration time.
Server gives no read-only or destructive hint
Our call: Its expiry is set on the whole key, not the new entry, and an expiry of 0 or below deletes the key. We added one field with 0 and the whole key was gone, reported as a success.
json_delDelete a JSON value from Redis at a given path.
Server gives no read-only or destructive hint
lpushPush a value onto the left of a Redis list and optionally set an expiration time.
Server gives no read-only or destructive hint
Our call: Its expiry is set on the whole key, not the new entry, and a negative expiry deletes the key. We added one entry with -1 and the whole key was gone, reported as a success.
rpushPush a value onto the right of a Redis list and optionally set an expiration time.
Server gives no read-only or destructive hint
Our call: Its expiry is set on the whole key, not the new entry, and a negative expiry deletes the key. We added one entry with -1 and the whole key was gone, reported as a success.
lpopRemove and return the first element from a Redis list.
Server gives no read-only or destructive hint
rpopRemove and return the last element from a Redis list.
Server gives no read-only or destructive hint
lremRemove elements from a Redis list.
Server gives no read-only or destructive hint
deleteDelete a Redis key.
Server gives no read-only or destructive hint
expireSet an expiration time for a Redis key.
Server gives no read-only or destructive hint
Our call: An expiry of 0 deletes the key at once. We set 0 on a counter and it was gone.
renameRenames a Redis key from old_key to new_key.
Server gives no read-only or destructive hint
Our call: Uses RENAME, not RENAMENX, so a key already under the new name is overwritten. We renamed app:a onto app:b and the old value of app:b was lost.
saddAdd a value to a Redis set with an optional expiration time.
Server gives no read-only or destructive hint
Our call: Its expiry is set on the whole key, not the new entry, and an expiry of 0 or below deletes the key. We added one field with 0 and the whole key was gone, reported as a success.
sremRemove a value from a Redis set.
Server gives no read-only or destructive hint
zaddAdd a member to a Redis sorted set with an optional expiration time.
Server gives no read-only or destructive hint
Our call: Its expiry is set on the whole key, not the new entry, and a negative expiry deletes the key. We added one entry with -1 and the whole key was gone, reported as a success.
zremRemove a member from a Redis sorted set.
Server gives no read-only or destructive hint
xaddAdd an entry to a Redis stream with an optional expiration time.
Server gives no read-only or destructive hint
Our call: Its expiry is set on the whole key, not the new entry, and a negative expiry deletes the key. We added one entry with -1 and the whole key was gone, reported as a success.
xdelDelete an entry from a Redis stream.
Server gives no read-only or destructive hint
xgroup_destroyDestroy a consumer group for a Redis stream.
Server gives no read-only or destructive hint
setSet a Redis string value with an optional expiration time.
Server gives no read-only or destructive hint
Our call: Replaces whatever the key held, of any type. We set a string on a hash key and its fields were gone.
Reaches people1 toolAsk a person: once it reaches someone, it cannot be unsent.
publishPublish a message to a Redis channel.
Server gives no read-only or destructive hint
Not sure2 toolsAsk a person until you have checked what it does.
scan_keysScan keys in the Redis database using the SCAN command (non-blocking, production-safe).
Server gives no read-only or destructive hint
Our call: Reads only key names, but its count goes straight to SCAN. One call with count 2000000 on a million keys held Redis for 82 ms, and every other client waited.
scan_all_keysScan and return ALL keys matching a pattern using multiple SCAN iterations.
Server gives no read-only or destructive hint
Our call: Loops SCAN until it has every matching name. On a million keys it took about 10 seconds and returned 12.9 million characters to the model.
Changes data5 toolsAsk a person. Once it is routine, a standing rule can answer.
set_vector_in_hashStore a vector as a field in a Redis hash.
Server gives no read-only or destructive hint
create_vector_index_hashCreate a Redis 8 vector similarity index using HNSW on a Redis hash.
Server gives no read-only or destructive hint
xgroup_createCreate a consumer group for a Redis stream.
Server gives no read-only or destructive hint
xreadgroupRead entries from a Redis stream using a consumer group.
Server gives no read-only or destructive hint
Our call: Sounds like a read, but it claims the entries for the consumer it names. We read three jobs as claude, and the group's real worker then got none.
xackAcknowledge entries that were processed by a consumer group.
Server gives no read-only or destructive hint
Our call: Takes entries off the group's pending list, so the group never retries them.
Only looks25 toolsLet it run. It only looks.
hgetGet the value of a field in a Redis hash.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
hgetallGet all fields and values from a Redis hash.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
hexistsCheck if a field exists in a Redis hash.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
get_vector_from_hashRetrieve a vector from a Redis hash and convert it back from binary blob.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
json_getRetrieve a JSON value from Redis at a given path.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
lrangeGet elements from a Redis list within a specific range.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
llenGet the length of a Redis list.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
typeReturns the string representation of the type of the value stored at key.
Server gives no read-only or destructive hint
Our call: Runs only TYPE and TTL on the key.
search_redis_documentsSearch Redis documentation and knowledge base to learn about Redis concepts and use cases.
Server gives no read-only or destructive hint
Our call: Reads public docs, but sends the question to redis.io, so whatever the model puts in it leaves your machine. An empty MCP_DOCS_SEARCH_URL switches it off.
subscribeSubscribe to a Redis channel and return a reusable subscription handle.
Server gives no read-only or destructive hint
Our call: Only listens, through a connection the server keeps open. It sends nothing to the channel.
psubscribeSubscribe to Redis channels using a pattern.
Server gives no read-only or destructive hint
Our call: Only listens, through a connection the server keeps open. It sends nothing to the channel.
read_messagesRead pending pub/sub messages for an existing subscription.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
unsubscribeUnsubscribe and close an existing pub/sub subscription.
Server gives no read-only or destructive hint
Our call: Closes only a subscription this server opened, by the handle it returned.
get_indexesList of indexes in the Redis database.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
get_index_infoRetrieve schema and information about a specific Redis index using FT.INFO.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
get_indexed_keys_numberRetrieve the number of indexed keys by the index.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
vector_search_hashPerform a KNN vector similarity search using Redis 8 or later version on vectors stored in hash data structures.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
hybrid_searchPerform a hybrid search combining a Redis filter expression with KNN vector similarity.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
dbsizeGet the number of keys stored in the Redis database.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
infoGet Redis server information and statistics.
Server gives no read-only or destructive hint
Our call: Server details and statistics. We ran it with section everything against a Redis with requirepass and ACL users, and no password or hash came back.
client_listGet a list of connected clients to the Redis server.
Server gives no read-only or destructive hint
Our call: Lists every connection's address, ACL user name and last command name. Against a Redis with requirepass and ACL users, no password came back.
smembersGet all members of a Redis set.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
zrangeRetrieve a range of members from a Redis sorted set.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
xrangeRead entries from a Redis stream.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
getGet a Redis string value.
Server gives no read-only or destructive hint
Our call: Runs one Redis read command on the key or index it is given and returns what it finds. The server gives no hints, so we read its code.
Let the reads run in Claude Code
Claude Code asks before every MCP tool it has no rule for. Added as redis, this server’s tools are named mcp__redis__<tool>. These allow rules, in .claude/settings.json or ~/.claude/settings.json, let the tools that only look run without a prompt. Everything else keeps asking, including any tool a later version of the server adds.
{
"permissions": {
"allow": [
"mcp__redis__hget",
"mcp__redis__hgetall",
"mcp__redis__hexists",
"mcp__redis__get_vector_from_hash",
"mcp__redis__json_get",
"mcp__redis__lrange",
"mcp__redis__llen",
"mcp__redis__type",
"mcp__redis__search_redis_documents",
"mcp__redis__subscribe",
"mcp__redis__psubscribe",
"mcp__redis__read_messages",
"mcp__redis__unsubscribe",
"mcp__redis__get_indexes",
"mcp__redis__get_index_info",
"mcp__redis__get_indexed_keys_number",
"mcp__redis__vector_search_hash",
"mcp__redis__hybrid_search",
"mcp__redis__dbsize",
"mcp__redis__info",
"mcp__redis__client_list",
"mcp__redis__smembers",
"mcp__redis__zrange",
"mcp__redis__xrange",
"mcp__redis__get"
]
}
}The command that adds the server:
claude mcp add redis -e REDIS_USERNAME=agent -e REDIS_PWD=… -- uvx --from redis-mcp-server@0.5.1 redis-mcp-server --host redis.internal --port 6379 --sslSend the rest to a person, not the terminal
A prompt in the terminal only works while someone is watching it. With this hook, every other tool of the server becomes a request in your VariantGate inbox, on your phone or in Slack, and Claude Code waits for the answer. The matcher names the look-only tools, so a tool added later is sent too. Put the key in VARIANTGATE_KEY, or run the one-command setup for Claude Code first.
{
"hooks": {
"PreToolUse": [
{
"matcher": "mcp__redis__(?!(hget|hgetall|hexists|get_vector_from_hash|json_get|lrange|llen|type|search_redis_documents|subscribe|psubscribe|read_messages|unsubscribe|get_indexes|get_index_info|get_indexed_keys_number|vector_search_hash|hybrid_search|dbsize|info|client_list|smembers|zrange|xrange|get)$).*",
"hooks": [
{ "type": "command", "command": "variantgate hook claude-code", "timeout": 180 }
]
}
]
}
}Disagree with a tier, or run the server with other flags? Open these tools in the tool risk checker, change what you like, and copy the settings for your own setup. It runs in your browser and starts from its own reading, so a tool we marked as only looking by hand asks there until you change it.
Any MCP client: put the proxy in front
Claude Desktop, Cursor and most other MCP clients have no hook to send a call to a person. The VariantGate MCP proxy does it in the server’s place: it starts the server, lets the look-only tools above through, and holds every other call until someone approves it in the inbox. Run npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz login once to save a key, then use this in claude_desktop_config.json or ~/.cursor/mcp.json:
{
"mcpServers": {
"redis": {
"args": [
"-y",
"https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz",
"mcp-proxy",
"--name",
"redis",
"--look-only",
"hget,hgetall,hexists,get_vector_from_hash,json_get,lrange,llen,type,search_redis_documents,subscribe,psubscribe,read_messages,unsubscribe,get_indexes,get_index_info,get_indexed_keys_number,vector_search_hash,hybrid_search,dbsize,info,client_list,smembers,zrange,xrange,get",
"--",
"uvx",
"--from",
"redis-mcp-server@0.5.1",
"redis-mcp-server",
"--host",
"redis.internal",
"--port",
"6379",
"--ssl"
],
"command": "npx",
"env": {
"REDIS_USERNAME": "agent",
"REDIS_PWD": "…"
}
}
}
}Already have it in Claude Desktop? One command rewrites the file for you, with these look-only tools filled in, and keeps the old one (setup vscode does the same for VS Code; how it works):
npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz setup claude-desktopThe same in Claude Code, instead of the hook. The proxy now asks about every call that matters, so an allow rule for the whole server, mcp__redis, keeps Claude Code from asking a second time in the terminal:
claude mcp add redis -e REDIS_USERNAME=agent -e REDIS_PWD=… -- npx -y https://variantgate.com/sdk/variantgate-agent-0.15.0.tgz mcp-proxy --name redis --look-only hget,hgetall,hexists,get_vector_from_hash,json_get,lrange,llen,type,search_redis_documents,subscribe,psubscribe,read_messages,unsubscribe,get_indexes,get_index_info,get_indexed_keys_number,vector_search_hash,hybrid_search,dbsize,info,client_list,smembers,zrange,xrange,get -- uvx --from redis-mcp-server@0.5.1 redis-mcp-server --host redis.internal --port 6379 --sslClaude Code’s allow rules match a tool’s name, never its arguments, so a rule cannot tell a harmless call of these tools from a risky one. On a development Redis small enough that a full scan costs nothing, these rules also let scan_keys, scan_all_keys run unasked:
{
"permissions": {
"allow": [
"mcp__redis__hget",
"mcp__redis__hgetall",
"mcp__redis__hexists",
"mcp__redis__get_vector_from_hash",
"mcp__redis__json_get",
"mcp__redis__lrange",
"mcp__redis__llen",
"mcp__redis__type",
"mcp__redis__search_redis_documents",
"mcp__redis__subscribe",
"mcp__redis__psubscribe",
"mcp__redis__read_messages",
"mcp__redis__unsubscribe",
"mcp__redis__get_indexes",
"mcp__redis__get_index_info",
"mcp__redis__get_indexed_keys_number",
"mcp__redis__vector_search_hash",
"mcp__redis__hybrid_search",
"mcp__redis__dbsize",
"mcp__redis__info",
"mcp__redis__client_list",
"mcp__redis__smembers",
"mcp__redis__zrange",
"mcp__redis__xrange",
"mcp__redis__get",
"mcp__redis__scan_keys",
"mcp__redis__scan_all_keys"
]
}
}When the agent should write
For an agent that has to change data, run a second server as a user that can write only its own key pattern, such as ~app:cache:* +@read +@write -@dangerous, and give it its own name, such as redis-write, so the allow rules above, written for mcp__redis__, do not cover it. Every tool of that server should ask. The person who answers sees the key and the expiry, so a 0 or a negative number is caught before it deletes anything.
See it before you decide.
The playground runs the whole approval loop in your browser, no account needed. When it fits, the free plan covers 100 requests a month.