Labsco
redis logo

Redis MCP Server

βœ“ Officialβ˜… 538

from redis

A natural language interface for agentic applications to manage and search data in Redis.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

Redis MCP Server

<!-- 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

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

Integrations

Integrating this MCP Server to development frameworks like OpenAI Agents SDK, or with tools like Claude Desktop, VS Code, or Augment is described in the following sections.

OpenAI Agents SDK

Integrate this MCP Server with the OpenAI Agents SDK. Read the documents to learn more about the integration of the SDK with MCP.

Install the Python SDK.

Copy & paste β€” that's it
pip install openai-agents

Configure the OpenAI token:

Copy & paste β€” that's it
export OPENAI_API_KEY="<openai_token>"

And run the application.

Copy & paste β€” that's it
python3.14 redis_assistant.py

You can troubleshoot your agent workflows using the OpenAI dashboard.

Augment

The preferred way of configuring the Redis MCP Server in Augment is to use the Easy MCP feature.

You can also configure the Redis MCP Server in Augment manually by importing the server via JSON:

Copy & paste β€” that's it
{
  "mcpServers": {
    "Redis MCP Server": {
      "command": "uvx",
      "args": [
        "--from",
        "redis-mcp-server@latest",
        "redis-mcp-server",
        "--url",
        "redis://localhost:6379/0"
      ]
    }
  }
}

Claude Desktop

The simplest way to configure MCP clients is using uvx. Add the following JSON to your claude_desktop_config.json, remember to provide the full path to uvx.

Basic Redis connection:

Copy & paste β€” that's it
{
  "mcpServers": {
    "redis-mcp-server": {
        "type": "stdio",
        "command": "/Users/mortensi/.local/bin/uvx",
        "args": [
            "--from", "redis-mcp-server@latest",
            "redis-mcp-server",
            "--url", "redis://localhost:6379/0"
        ]
    }
  }
}

Azure Managed Redis with EntraID authentication:

Copy & paste β€” that's it
{
  "mcpServers": {
    "redis-mcp-server": {
        "type": "stdio",
        "command": "/Users/mortensi/.local/bin/uvx",
        "args": [
            "--from", "redis-mcp-server@latest",
            "redis-mcp-server",
            "--url", "redis://your-azure-redis.redis.cache.windows.net:6379"
        ],
        "env": {
            "REDIS_ENTRAID_AUTH_FLOW": "default_credential",
            "REDIS_ENTRAID_SCOPES": "https://redis.azure.com/.default"
        }
    }
  }
}

VS Code with GitHub Copilot

To use the Redis MCP Server with VS Code, you must nable the agent mode tools. Add the following to your settings.json:

Copy & paste β€” that's it
{
  "chat.agent.enabled": true
}

You can start the GitHub desired version of the Redis MCP server using uvx by adding the following JSON to your mcp.json file:

Copy & paste β€” that's it
"servers": {
  "redis": {
    "type": "stdio",
    "command": "uvx",
    "args": [
      "--from", "redis-mcp-server@latest",
      "redis-mcp-server",
      "--url", "redis://localhost:6379/0"
    ]
  },
}

Suppressing uvx Installation Messages

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

Copy & paste β€” that's it
"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.

Copy & paste β€” that's it
// 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.

Testing

You can use the MCP Inspector for visual debugging of this MCP Server.

Copy & paste β€” that's it
npx @modelcontextprotocol/inspector uv run src/main.py

Example Use Cases

  • AI Assistants: Enable LLMs to fetch, store, and process data in Redis.
  • Chatbots & Virtual Agents: Retrieve session data, manage queues, and personalize responses.
  • Data Search & Analytics: Query Redis for real-time insights and fast lookups.
  • Event Processing: Manage event streams with Redis Streams.

Contributing

  1. Fork the repo
  2. Create a new branch (feature-branch)
  3. Commit your changes
  4. Push to your branch and submit a PR!

License

This project is licensed under the MIT License.

Badges

<a href="https://glama.ai/mcp/servers/@redis/mcp-redis"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@redis/mcp-redis/badge" alt="Redis Server MCP server" /> </a>

Contact

For questions or support, reach out via GitHub Issues.

Alternatively, you can join the Redis Discord server and ask in the #redis-mcp-server channel.