home / mcp / redis mcp server

Redis MCP Server

A Redis MCP server (pushed to https://github.com/modelcontextprotocol/servers/tree/main/src/redis) implementation for interacting with Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "gongrzhe-redis-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/redis",
        "redis://host.docker.internal:6379"
      ]
    }
  }
}

You can run a Redis MCP Server to let large language models interact with your Redis key-value store using a standardized set of tools. This server exposes simple actions for setting, getting, deleting, and listing keys, enabling powerful, prompt-driven data access for Redis-backed workflows.

How to use

You use the Redis MCP Server by connecting your MCP client to one of the supported execution methods. The server provides tools to set a key, retrieve a value by key, delete keys, and list keys by pattern. To perform an operation, choose the corresponding tool and provide the required inputs (for example, a key and value for set, or a pattern for list). The server handles the interaction with your Redis instance and returns the results to your client.

How to install

Prerequisites you need before installing and running the server are Node.js and npm (or your preferred Node package manager). Install the MCP server using one of the supported approaches, then connect it to your Redis instance.

Additional sections

Configuration notes and usage examples are shown below. You can run the server directly using a package runner, or via Docker, with the Redis URL pointing to your Redis instance.

Configuration examples

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": [
        "@gongrzhe/[email protected]",
        "redis://localhost:6379"
      ]
    }
  }
}
{
  "mcpServers": {
    "redis": {
      "command": "node",
      "args": [
        "path/to/build/index.js",
        "redis://10.1.210.223:6379"
      ]
    }
  }
}
{
  "mcpServers": {
    "redis": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/redis",
        "redis://host.docker.internal:6379"
      ]
    }
  }
}

Available tools

set

Store a key-value pair in Redis with an optional expiration. Inputs: key (string), value (string), expireSeconds (number, optional)

get

Retrieve a value from Redis by key. Input: key (string)

delete

Remove one or more keys from Redis. Input: key (string | string[])

list

List Redis keys that match a given pattern. Input: pattern (string, optional)