Skip to main content
Glama
TeaBambooNGU

mcp-redis-allowlist

by TeaBambooNGU

mcp-redis-allowlist

Read-only Redis MCP server with a configurable command allowlist.

This project is a fixed local variant for production diagnostics. It keeps the small tool surface from @infoinlet/mcp-redis and adds an environment-driven allowlist for exact read-only diagnostic subcommands such as CLIENT LIST, SLOWLOG GET, and LATENCY LATEST.

Tools

  • redis_get: get a string key and TTL.

  • redis_scan: scan keys with SCAN.

  • redis_inspect: inspect type, TTL, size, and preview for string/hash/list/set/zset keys.

  • redis_command: run a Redis command if it passes the read-only guard.

  • redis_info: run INFO, optionally with a section.

Related MCP server: mcp-database

Security Model

By default, writes are blocked at the MCP layer.

  • REDIS_WRITE_ALLOWED=false keeps the read-only guard enabled.

  • REDIS_EXTRA_READONLY_COMMANDS appends exact read-only command specs.

  • REDIS_WRITE_ALLOWED=true bypasses the guard and should not be used for production diagnostics.

Extra command specs are comma or whitespace separated:

REDIS_EXTRA_READONLY_COMMANDS=client:list,slowlog:get,latency:latest

Redis ACL style syntax is also accepted:

REDIS_EXTRA_READONLY_COMMANDS='client|list slowlog|get latency|latest'

Known dangerous subcommands remain blocked unless REDIS_WRITE_ALLOWED=true, including:

  • CLIENT KILL

  • CLIENT PAUSE

  • CLIENT UNPAUSE

  • CLIENT UNBLOCK

  • CLIENT SETNAME

  • SLOWLOG RESET

  • LATENCY RESET

  • CONFIG SET

  • CONFIG RESETSTAT

  • CONFIG REWRITE

Use a Redis read-only or diagnostic ACL user as an additional safety boundary whenever possible.

Install

npm install
npm run build

Run

REDIS_URL='redis://localhost:6379' \
REDIS_WRITE_ALLOWED=false \
REDIS_EXTRA_READONLY_COMMANDS='client:list,slowlog:get,latency:latest' \
node dist/server.js

Codex MCP Config

[mcp_servers.redis_yesorno_prod]
command = "/Users/jason/.local/nodejs/current/bin/node"
args = ["/Users/jason/workspace/mcp-redis-allowlist/dist/server.js"]
startup_timeout_sec = 30.0

[mcp_servers.redis_yesorno_prod.env]
REDIS_URL = "redis://USER:PASSWORD@HOST:PORT/DB"
REDIS_WRITE_ALLOWED = "false"
REDIS_EXTRA_READONLY_COMMANDS = "client:list,slowlog:get,latency:latest"
PATH = "/Users/jason/.local/nodejs/current/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Do not commit real Redis URLs, passwords, or production hostnames.

Diagnostic Examples

Use redis_command with exact subcommands:

{ "command": "CLIENT", "args": ["LIST"] }
{ "command": "SLOWLOG", "args": ["GET", "128"] }
{ "command": "LATENCY", "args": ["LATEST"] }

Development

npm install
npm run build
npm test

The tests verify that the diagnostic commands above can be allowlisted while dangerous related subcommands remain blocked.

Attribution

This server is inspired by the read-only guard and tool shape from @infoinlet/mcp-redis, which is MIT licensed.

Available Tools

5 tools
redis_commandB

Run an arbitrary Redis command restricted to the read-only allowlist unless writes are enabled.

ParametersJSON Schema
NameRequiredDescriptionDefault
argsNo
commandYes

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries full burden. It discloses the access control (read-only allowlist, writes optionally enabled) but omits other behaviors: error handling (e.g., denied command), return format, rate limits, or state changes when writes are enabled.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that front-loads the core behavior. However, it uses the uncommon spelling 'allowlist' and could be slightly clearer about the write-enabling condition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of running arbitrary commands and the lack of output schema or parameter descriptions, the description is too sparse. It does not explain expected inputs, outputs, or error scenarios, making it insufficient for reliable agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and the description does not clarify the purpose or format of the 'command' and 'args' parameters. An agent has to infer that 'command' is a Redis command string and 'args' are its arguments, but no examples or constraints are given.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs an arbitrary Redis command, with a specific restriction to a read-only allowlist unless writes are enabled. This distinguishes it from sibling tools like redis_get (specific commands) by offering a generic runner.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (for commands not covered by siblings) by mentioning the allowlist restriction, but it does not explicitly advise against using it for commands that have dedicated tools or specify prerequisites for enabling writes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

redis_getC

GET a string key and its TTL.

ParametersJSON Schema
NameRequiredDescriptionDefault
keyYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description only says it returns TTL but does not clarify whether it returns the value, what happens if key missing, or safety (read-only vs. destructive). For a retrieval tool, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no unnecessary words; front-loads action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Simple tool with one parameter, but no output schema or annotations. Description covers basic action but omits return value details and error handling, leaving gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description adds no extra meaning to the schema's 'key' parameter beyond calling it a 'string key'. No format, constraints, or examples provided, despite 0% schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool retrieves a string key and its TTL, but does not differentiate from sibling tools like redis_command or redis_scan.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., redis_scan for listing keys) or any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

redis_infoB

Run Redis INFO, optionally scoped to a section.

ParametersJSON Schema
NameRequiredDescriptionDefault
sectionNo

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool runs INFO (informational), but does not disclose safety (read-only hint), potential size of output, or any side effects. The description is insufficient for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence, front-loaded with the action. Every word adds value with no redundancy. It earns a high score for efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With one optional parameter and no output schema, the description should explain what the tool returns (e.g., a block of text) and any implications of omitting the section. It is too minimal to be fully useful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the parameter 'section' has no type details or enum values. The description adds that it is optional but fails to list valid section names (e.g., 'server', 'clients'), which are standard for Redis INFO. More concrete examples are needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes the Redis INFO command, with optional section scoping. The verb 'run' and resource 'Redis INFO' are specific, and the name directly conveys the purpose, distinguishing it from siblings like redis_command and redis_get.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like redis_command or redis_get. There is no mention of prerequisites, context, or exclusions, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

redis_inspectB

Inspect type, TTL, size, and a small preview for a key.

ParametersJSON Schema
NameRequiredDescriptionDefault
keyYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description mentions outputs but does not disclose side effects (likely none), error behavior on missing key, or whether the operation is read-only. Incomplete behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence of 11 words. Efficient and front-loaded with core purpose. Slightly lacking in detail but not verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 param, no output schema), the description covers basic outputs. However, 'small preview' is ambiguous, and absence of format details leaves some gaps. Adequate but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'key' has no schema description (0% coverage). The description only says 'for a key' without specifying format, allowed types, or constraints. Adds minimal meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool inspects a key's type, TTL, size, and preview. It distinguishes from siblings like redis_get (gets value) and redis_scan (scans keys) by specifying inspection of metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for inspecting a key, but does not explicitly state when to use this vs alternatives or provide exclusions. Usage context is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

redis_scanB

Cursor-safe key scan by glob pattern using SCAN.

ParametersJSON Schema
NameRequiredDescriptionDefault
countNo
matchNo*

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds 'cursor-safe', indicating non-blocking behavior, but does not mention pagination, that results may be partial, or that multiple calls are needed. Minimal transparency beyond that.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no wasted words. Concisely communicates the core function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a cursor-based scan tool with no output schema, the description omits critical details: that it returns a cursor for pagination, that it may need multiple calls, or that it returns an array of keys. Incomplete for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must explain parameters. It mentions 'glob pattern' (relates to match) and 'cursor-safe' (hints at count), but does not explicitly describe count as a hint for batch size or explain match format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it scans keys by glob pattern using SCAN, specifying the verb 'scan' and resource 'keys'. It distinguishes from siblings like redis_get (single key) and redis_info (server info).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs. alternatives like redis_get for single key retrieval or redis_command for arbitrary commands. Lacks when/when-not usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.2/5.0
Disambiguation4/5

Most tools have distinct purposes: redis_get is for string keys, redis_inspect is a general inspection tool, redis_scan is for scanning, redis_info is for server info, and redis_command is a generic command runner. There is slight overlap between redis_get and redis_inspect for string key retrieval, but redis_inspect also provides more metadata and works on any key type.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with 'redis_' prefix and an imperative verb (command, get, info, inspect, scan). No mixing of naming conventions.

Tool Count4/5

5 tools is within the typical range for a focused Redis server, covering common read-only operations and inspection. It's slightly minimal but reasonable.

Completeness2/5

The tool set is heavily read-only, missing write operations (SET, DEL, update) and support for non-string data structures. This creates significant gaps for typical Redis usage workflows.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables exploring and diagnosing a Redis instance from MCP clients with read-only safety, using SCAN instead of KEYS for safe key enumeration.
    7
    365
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Read-only MySQL/MariaDB MCP server for running SELECT queries safely, with automatic read-only enforcement and query limits.
    3
    14
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    A read-only MCP server for AWS observability that provides tools to monitor EC2, EKS, RDS, ElastiCache Redis, and CloudWatch.
  • A
    license
    Not graded
    quality
    B
    maintenance
    Lightweight MCP server for Redis that allows running any Redis command and searching Redis documentation. Supports multiple named databases with HTTP/REST or TCP transport.
    63
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TeaBambooNGU/mcp-redis-allowlist'

If you have feedback or need assistance with the MCP directory API, please join our Discord server