Cover image
Try Now
2025-04-14

Der offizielle Redis MCP Server ist eine natürliche Sprachschnittstelle, mit der Agentenanwendungen zum effizienten Verwalten und Durchsuchen von Daten in Redis entwickelt wurden

3 years

Works with Finder

18

Github Watches

6

Github Forks

18

Github Stars

Redis MCP Server

smithery badge

Redis Server MCP server

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"

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.

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 to channels and subscribe to receive them. Useful for real-time notifications, chat applications, or distributing updates to multiple clients.
  • streams tools to add, read, and delete from data streams. Useful for event sourcing, activity feeds, or sensor data logging with consumer groups support.
  • 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.

  • query engine tools to manage vector indexes and perform vector search
  • server management tool to retrieve information about the database

Installation

Follow these instructions to install the server.

# Clone the repository
git clone https://github.com/redis/mcp-redis.git
cd mcp-redis

# Install dependencies using uv
uv venv
source .venv/bin/activate
uv sync

Configuration

To configure this Redis MCP Server, consider the following environment variables:

Name Description Default Value
REDIS_HOST Redis IP or hostname "127.0.0.1"
REDIS_PORT Redis port 6379
REDIS_USERNAME Default database username "default"
REDIS_PWD Default database password ""
REDIS_SSL Enables or disables SSL/TLS False
REDIS_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_CERT_REQS Whether the client should verify the server's certificate "required"
REDIS_CA_CERTS Path to the trusted CA certificates file None
REDIS_CLUSTER_MODE Enable Redis Cluster mode False

Integration with 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.

pip install openai-agents

Configure the OpenAI token:

export OPENAI_API_KEY="<openai_token>"

And run the application.

python3.13 redis_assistant.py 

You can troubleshoot your agent workflows using the OpenAI dashboard.

Integration with Claude Desktop

Via Smithery

If you'd like to test the Redis MCP Server deployed by Smithery, you can configure Claude Desktop automatically:

npx -y @smithery/cli install @redis/mcp-redis --client claude

Follow the prompt and provide the details to configure the server and connect to Redis (e.g. using a Redis Cloud database). The procedure will create the proper configuration in the claude_desktop_config.json configuration file.

Manual configuration

You can configure Claude Desktop to use this MCP Server.

  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_PSW": "<your_redis_database_password>",
                "REDIS_SSL": True|False,
                "REDIS_CA_PATH": "<your_redis_ca_path>",
                "REDIS_CLUSTER_MODE": True|False
            }
        }
    }
}

Using with Docker

The Redis MCP Server provides a Dockerfile. Build this server's image with:

docker build -t mcp-redis .

Finally, configure Claude Desktop to create the container at start-up. Edit the claude_desktop_config.json and add:

{
  "mcpServers": {
    "redis": {
      "command": "docker",
      "args": ["run",
                "--rm",
                "--name",
                "redis-mcp-server",
                "-i",
                "-e", "REDIS_HOST=<redis_hostname>",
                "-e", "REDIS_PORT=<redis_port>",
                "-e", "REDIS_USERNAME=<redis_username>",
                "-e", "REDIS_PWD=<redis_password>",
                "mcp-redis"]
    }
  }
}

Troubleshooting

You can troubleshoot problems by tailing the log file.

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

Testing

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

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.

Contact

For questions or support, reach out via GitHub Issues.

相关推荐

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.

  • 1Panel-dev
  • 🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.

  • rulego
  • ⛓️Rugele ist ein leichter, leistungsstarker, leistungsstarker, eingebetteter Komponenten-Orchestrierungsregel-Motor-Rahmen für GO.

  • hkr04
  • Leichtes C ++ MCP (Modellkontextprotokoll) SDK

  • sigoden
  • Erstellen Sie einfach LLM -Tools und -Argarten mit einfachen Bash/JavaScript/Python -Funktionen.

  • RockChinQ
  • 😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / diskord / telegram / slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Diffy 、 Claude 、 Gemini 、 xai 、 ppio 、 、 ulama 、 lm Studio 、阿里云百炼、火山方舟、 siliconflow 、 qwen 、 mondshot 、 chatglm 、 sillytraven 、 mcp 等 llm 的机器人 / agent | LLM-basierte Instant Messaging Bots-Plattform, unterstützt Zwietracht, Telegramm, Wechat, Lark, Dingtalk, QQ, Slack

  • modelscope
  • Bauen Sie LLM-Multi-Agent-Anwendungen auf einfachere Weise auf.

  • dmayboroda
  • On-Premise-Konversationslappen mit konfigurierbaren Behältern

    Reviews

    3.6 (5)
    Avatar
    user_BjMeXMs9
    2025-04-24

    As a dedicated user of mcp-redis, I can attest to its exceptional performance and reliability. The seamless integration and high-speed data handling capabilities have significantly enhanced my workflow. Its intuitive design and robust features make it an indispensable tool for any application requiring efficient data management. Highly recommended!

    Avatar
    user_KtRrIXmT
    2025-04-24

    As a loyal user of mcp-redis, I can confidently say that it is an outstanding tool for anyone working with Redis. Its seamless integration and efficient performance have significantly improved my workflow. The product is reliable, easy to use, and has excellent support from the developers. Highly recommended for anyone in need of a robust Redis application!

    Avatar
    user_dPYtmt0j
    2025-04-24

    I've been using mcp-redis for several projects, and it has proven to be an invaluable tool. The seamless integration and exceptional performance make it a must-have for anyone working with Redis. The documentation is clear, and the support from the community is outstanding. Highly recommended!

    Avatar
    user_VUMoArTX
    2025-04-24

    I have been using mcp-redis for a while now and it has significantly improved my application's performance. The integration was seamless and straightforward, thanks to the comprehensive documentation by the Redis team. Its efficient handling of large datasets and rapid response time are truly impressive. Highly recommended for anyone seeking a robust caching solution!

    Avatar
    user_unLveG1D
    2025-04-24

    I have been using mcp-redis for several months and it has significantly improved our data management and caching processes. The integration is seamless and the performance boost is noticeable. It's an essential tool for any project requiring efficient handling of large datasets. Highly recommend giving it a try!