Redis MCP Server

by redis

539 894 downloads Not rated yet MIT

About

The official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently

Details

License
MIT

Explore

- Natural Language Queries: Enables AI agents to query and update Redis using natural language.
- Seamless MCP Integration: Works with any MCP client for smooth communication.
- Full Redis Support: Handles hashes, lists, sets, sorted sets, streams, and more.
- Search & Filtering: Supports efficient data retrieval and searching in Redis.
- Scalable & Lightweight: Designed for high-performance data operations.
- EntraID Authentication: Native support for Azure Active Directory authentication with Azure Managed Redis.
- The Redis MCP Server supports the stdio transport. Support to the stremable-http transport will be added in the future.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Redis MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

The Redis MCP Server is available as a PyPI package and as direct installation from the GitHub repository.

For development or if you prefer to clone the repository:


uv venv
source .venv/bin/activate
uv sync

uv run src/main.py

Once you cloned the repository, installed the dependencies and verified you can run the server, you can configure Claude Desktop or any other MCP Client to use this MCP Server running the main file directly (it uses environment variables). This is usually preferred for development.
The following example is for Claude Desktop, but the same applies to any other MCP Client.

1. Specify your Redis credentials and TLS configuration
2. Retrieve your uv command full path (e.g. which uv)
3. Edit the claude_desktop_config.json configuration file
- on a MacOS, at ~/Library/Application\ Support/Claude/

{
    "mcpServers": {
        "redis": {
            "command": "<full_path_uv_command>",
            "args": [
                "--directory",
                "<your_mcp_server_directory>",
                "run",
                "src/main.py"
            ],
            "env": {
                "REDIS_HOST": "<your_redis_database_hostname>",
                "REDIS_PORT": "<your_redis_database_port>",
                "REDIS_PWD": "<your_redis_database_password>",
                "REDIS_SSL": True|False,
                "REDIS_SSL_CA_PATH": "<your_redis_ca_path>",
                "REDIS_CLUSTER_MODE": True|False
            }
        }
    }
}

You can troubleshoot problems by tailing the log file.

tail -f ~/Library/Logs/Claude/mcp-server-redis.log

When using the CLI interface, you can configure the server with command line arguments:


If desired, you can use environment variables. Defaults are provided for all variables.

| Name | Description | Default Value |
|----------------------|-----------------------------------------------------------|---------------|
| REDIS_HOST | Redis IP or hostname | "127.0.0.1" |
| REDIS_PORT | Redis port | 6379 |
| REDIS_DB | Database | 0 |
| REDIS_USERNAME | Default database username | "default" |
| REDIS_PWD | Default database password | "" |
| REDIS_SSL | Enables or disables SSL/TLS | False |
| REDIS_SSL_CA_PATH | CA certificate for verifying server | None |
| REDIS_SSL_KEYFILE | Client's private key file for client authentication | None |
| REDIS_SSL_CERTFILE | Client's certificate file for client authentication | None |
| REDIS_SSL_CERT_REQS| Whether the client should verify the server's certificate | "required" |
| REDIS_SSL_CA_CERTS | Path to the trusted CA certificates file | None |
| REDIS_CLUSTER_MODE | Enable Redis Cluster mode | False |

The Redis MCP Server supports EntraID (Azure Active Directory) authentication for Azure Managed Redis, enabling OAuth-based authentication with automatic token management.

Service Principal Authentication - Application-based authentication using client credentials:

bash
export REDIS_ENTRAID_AUTH_FLOW=service_principal
export REDIS_ENTRAID_CLIENT_ID=your-client-id
export REDIS_ENTRAID_CLIENT_SECRET=your-client-secret
export REDIS_ENTRAID_TENANT_ID=your-tenant-id

Managed Identity Authentication - For Azure-hosted applications:
bash

| Name | Description | Default Value |
|-----------------------------------------|-----------------------------------------------------------|--------------------------------------|
| REDIS_ENTRAID_AUTH_FLOW | Authentication flow type | None (EntraID disabled) |
| REDIS_ENTRAID_CLIENT_ID | Service Principal client ID | None |
| REDIS_ENTRAID_CLIENT_SECRET | Service Principal client secret | None |
| REDIS_ENTRAID_TENANT_ID | Azure tenant ID | None |
| REDIS_ENTRAID_IDENTITY_TYPE | Managed identity type | "system_assigned" |
| REDIS_ENTRAID_USER_ASSIGNED_CLIENT_ID | User-assigned managed identity client ID | None |
| REDIS_ENTRAID_SCOPES | OAuth scopes for Default Azure Credential | "https://redis.azure.com/.default" |
| REDIS_ENTRAID_RESOURCE | Azure Redis resource identifier | "https://redis.azure.com/" |

For local development with Azure CLI:


export REDIS_ENTRAID_AUTH_FLOW=default_credential
export REDIS_URL=redis://your-azure-redis.redis.cache.windows.net:6379

For production with Service Principal:

export REDIS_ENTRAID_AUTH_FLOW=service_principal
export REDIS_ENTRAID_CLIENT_ID=your-app-client-id
export REDIS_ENTRAID_CLIENT_SECRET=your-app-secret
export REDIS_ENTRAID_TENANT_ID=your-tenant-id
export REDIS_URL=redis://your-azure-redis.redis.cache.windows.net:6379

For Azure-hosted applications with Managed Identity:

export REDIS_ENTRAID_AUTH_FLOW=managed_identity
export REDIS_ENTRAID_IDENTITY_TYPE=system_assigned
export REDIS_URL=redis://your-azure-redis.redis.cache.windows.net:6379

There are several ways to set environment variables:

1. Using a .env File:
Place a .env file in your project directory with key-value pairs for each environment variable. Tools like python-dotenv, pipenv, and uv can automatically load these variables when running your application. This is a convenient and secure way to manage configuration, as it keeps sensitive data out of your shell history and version control (if .env is in .gitignore).
For example, create a .env file with the following content from the .env.example file provided in the repository:

cp .env.example .env

Then edit the .env file to set your Redis configuration:

OR,

2. Setting Variables in the Shell:
You can export environment variables directly in your shell before running your application. For example:

export REDIS_HOST=your_redis_host
export REDIS_PORT=6379

If you want to suppress uvx installation messages that may appear as warnings in MCP client logs, use the -qq flag:

json
"servers": {
"redis": {
"type": "stdio",
"command": "uvx",
"args": [
"-qq",
"--from", "redis-mcp-server@latest",
"redis-mcp-server",
"--url", "redis://localhost:6379/0"
]
},
}

The -qq flag enables silent mode, which suppresses "Installed X packages" messages that uvx writes to stderr during package installation.

Alternatively, you can start the server using uv and configure your mcp.json. This is usually desired for development.

json
// mcp.json
{
"servers": {
"redis": {
"type": "stdio",
"command": "<full_path_uv_command>",
"args": [
"--directory",
"<your_mcp_server_directory>",
"run",
"src/main.py"
],
"env": {
"REDIS_HOST": "<your_redis_database_hostname>",
"REDIS_PORT": "<your_redis_database_port>",
"REDIS_USERNAME": "<your_redis_database_username>",
"REDIS_PWD": "<your_redis_database_password>",
}
}
}
}
``

For more information, see the VS Code documentation.

> Tip: You can prompt Copilot chat to use the Redis MCP tools by including #redis in your message.

> Note: Starting with VS Code v1.102,
> MCP servers are now stored in a dedicated
mcp.json file instead of settings.json`.

string

tools to set, get strings with expiration. Useful for storing simple configuration values, session data, or caching responses.

hash

tools to store field-value pairs within a single key. The hash can store vector embeddings. Useful for representing objects with multiple attributes, user profiles, or product information where fields can be accessed individually.

list

tools with common operations to append and pop items. Useful for queues, message brokers, or maintaining a list of most recent actions.

set

tools to add, remove and list set members. Useful for tracking unique values like user IDs or tags, and for performing set operations like intersection.

streams

tools to add, read, delete, create and destroy consumer groups, and acknowledge processed entries in data streams. Useful for event sourcing, activity feeds, and worker-based event processing with Redis Streams consumer groups.

JSON

tools to store, retrieve, and manipulate JSON documents in Redis. Useful for complex nested data structures, document databases, or configuration management with path-based access.

docs

tool to search Redis documentation, tutorials, and best practices using natural language questions (backed by the `MCP_DOCS_SEARCH_URL` HTTP API).

This MCP Server provides tools to manage the data stored in Redis.

- string tools to set, get strings with expiration. Useful for storing simple configuration values, session data, or caching responses.
- hash tools to store field-value pairs within a single key. The hash can store vector embeddings. Useful for representing objects with multiple attributes, user profiles, or product information where fields can be accessed individually.
- list tools with common operations to append and pop items. Useful for queues, message brokers, or maintaining a list of most recent actions.
- set tools to add, remove and list set members. Useful for tracking unique values like user IDs or tags, and for performing set operations like intersection.
- sorted set tools to manage data for e.g. leaderboards, priority queues, or time-based analytics with score-based ordering.
- pub/sub functionality to publish messages, create stateful channel or pattern subscriptions, and read queued messages using returned subscription handles. Useful for real-time notifications, chat applications, or distributing updates to multiple clients.
- streams tools to add, read, delete, create and destroy consumer groups, and acknowledge processed entries in data streams. Useful for event sourcing, activity feeds, and worker-based event processing with Redis Streams consumer groups.
- JSON tools to store, retrieve, and manipulate JSON documents in Redis. Useful for complex nested data structures, document databases, or configuration management with path-based access.

Additional tools.

- docs tool to search Redis documentation, tutorials, and best practices using natural language questions (backed by the MCP_DOCS_SEARCH_URL HTTP API).
- query engine tools to manage vector indexes and perform vector search
- server management tool to retrieve information about the database

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "redis mcp server": {
            "mcp-redis": {
                "command": "uv",
                "args": [
                    "python",
                    "install",
                    "3.14"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-redis": {
        "command": "uv",
        "args": [
            "python",
            "install",
            "3.14"
        ]
    }
}

<!-- mcp-name: io.github.redis/mcp-redis -->

Integration
PyPI - Version
Python Version
MIT licensed
Verified on MseeP
Docker Image Version
codecov

Discord
Twitch
YouTube
Twitter
Stack Exchange questions

Overview

The Redis MCP Server is a natural language interface designed for agentic applications to efficiently manage and search data in Redis. It integrates seamlessly with MCP (Model Content Protocol) clients, enabling AI-driven workflows to interact with structured and unstructured data in Redis. Using this MCP Server, you can ask questions like:

- "Store the entire conversation in a stream"
- "Cache this item"
- "Store the session with an expiration time"
- "Index and search this vector"

Table of Contents

- Overview - Features - Tools - Installation - From PyPI (recommended) - Testing the PyPI package - From GitHub - Development Installation - With Docker - Configuration - Redis ACL - Configuration via command line arguments - Configuration via Environment Variables - EntraID Authentication for Azure Managed Redis - Logging - Integrations - OpenAI Agents SDK - Augment - Claude Desktop - VS Code with GitHub Copilot - Testing - Example Use Cases - Contributing - License - Badges - Contact

Features

- Natural Language Queries: Enables AI agents to query and update Redis using natural language. - Seamless MCP Integration: Works with any MCP client for smooth communication. - Full Redis Support: Handles hashes, lists, sets, sorted sets, streams, and more. - Search & Filtering: Supports efficient data retrieval and searching in Redis. - Scalable & Lightweight: Designed for high-performance data operations. - EntraID Authentication: Native support for Azure Active Directory authentication with Azure Managed Redis. - The Redis MCP Server supports the stdio transport. Support to the stremable-http transport will be added in the future.

Tools

This MCP Server provides tools to manage the data stored in Redis.

- string tools to set, get strings with expiration. Useful for storing simple configuration values, session data, or caching responses.
- hash tools to store field-value pairs within a single key. The hash can store vector embeddings. Useful for representing objects with multiple attributes, user profiles, or product information where fields can be accessed individually.
- list tools with common operations to append and pop items. Useful for queues, message brokers, or maintaining a list of most recent actions.
- set tools to add, remove and list set members. Useful for tracking unique values like user IDs or tags, and for performing set operations like intersection.
- sorted set tools to manage data for e.g. leaderboards, priority queues, or time-based analytics with score-based ordering.
- pub/sub functionality to publish messages, create stateful channel or pattern subscriptions, and read queued messages using returned subscription handles. Useful for real-time notifications, chat applications, or distributing updates to multiple clients.
- streams tools to add, read, delete, create and destroy consumer groups, and acknowledge processed entries in data streams. Useful for event sourcing, activity feeds, and worker-based event processing with Redis Streams consumer groups.
- JSON tools to store, retrieve, and manipulate JSON documents in Redis. Useful for complex nested data structures, document databases, or configuration management with path-based access.

Additional tools.

- docs tool to search Redis documentation, tutorials, and best practices using natural language questions (backed by the MCP_DOCS_SEARCH_URL HTTP API).
- query engine tools to manage vector indexes and perform vector search
- server management tool to retrieve information about the database

Installation

The Redis MCP Server is available as a PyPI package and as direct installation from the GitHub repository.

From PyPI (recommended)

Configuring the latest Redis MCP Server version from PyPI, as an example, can be done importing the following JSON configuration in the desired framework or tool. The uvx command will download the server on the fly (if not cached already), create a temporary environment, and then run it.
{
  "mcpServers": {
    "RedisMCPServer": {
      "command": "uvx",
      "args": [
        "--from",
        "redis-mcp-server@latest",
        "redis-mcp-server",
        "--url",
        "\"redis://localhost:6379/0\""
      ]
    }
  }
}
URL specification

The format to specify the --url argument follows the redis and rediss schemes:

redis://user:secret@localhost:6379/0?foo=bar&qux=baz

As an example, you can easily connect to a localhost server with:

redis://localhost:6379/0

Where 0 is the logical database you'd like to connect to.

For an encrypted connection to the database (e.g., connecting to a Redis Cloud database), you'd use the rediss scheme.

rediss://user:secret@localhost:6379/0?foo=bar&qux=baz

To verify the server's identity, specify ssl_ca_certs.

rediss://user:secret@hostname:port?ssl_cert_reqs=required&ssl_ca_certs=path_to_the_certificate

For an unverified connection, set ssl_cert_reqs to none

rediss://user:secret@hostname:port?ssl_cert_reqs=none

Configure your connection using the available options in the section "Available CLI Options".

Testing the PyPI package

You can install the package as follows:

pip install redis-mcp-server

And start it using uv the package in your environment.

uv python install 3.14
uv sync
uv run redis-mcp-server --url redis://localhost:6379/0

However, starting the MCP Server is most useful when delegate to the framework or tool where this MCP Server is configured.

From GitHub

You can configure the desired Redis MCP Server version with uvx, which allows you to run it directly from GitHub (from a branch, or use a tagged release).

> It is recommended to use a tagged release, the main branch is under active development and may contain breaking changes.

As an example, you can execute the following command to run the 0.2.0 release:

uvx --from git+https://github.com/redis/[email protected] redis-mcp-server --url redis://localhost:6379/0

Check the release notes for the latest version in the Releases section.
Additional examples are provided below.

```sh

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about Redis MCP Server

Relevant YouTube tutorials, setups, and demos