MCP Server Redis

Integrations

  • Supports configuration via environment variables using .env files to set up Redis connection parameters.

  • Provides tools for interacting with Redis databases, including basic operations (get, set, delete, increment), list operations, hash operations, set operations, and pub/sub functionality, with automatic reconnection handling.

Использование

Структура выглядит следующим образом:

mcp-server-redis/ ├── src/ │ ├── __init__.py │ ├── main.py # Main entry point │ ├── config.py # Configuration │ ├── connection.py # Redis connection management │ ├── resources/ # Resource implementations │ │ ├── __init__.py │ │ ├── status.py # Connection status resources │ │ └── keys.py # Key-related resources │ └── tools/ # Tool implementations │ ├── __init__.py │ ├── basic.py # Basic Redis operations │ ├── lists.py # List operations │ ├── hashes.py # Hash operations │ ├── sets.py # Set operations │ └── pubsub.py # Pub/Sub operations ├── tests/ # Test directory │ └── __init__.py ├── README.md └── pyproject.toml

Чтобы использовать этот сервер, вам необходимо:

Установите необходимые зависимости:

[Если еще не установлено] https://docs.astral.sh/uv/

uv venv

source .venv/bin/activate

uv sync

Чтобы настроить соединение Redis, добавив соответствующие переменные, обратитесь к файлу .env.example.

Запустите сервер:

python src/server.py

Возможности этого сервера

Ресурсы:

  • redis://status - Текущий статус подключения
  • redis://info — информация о сервере Redis
  • redis://keys/{pattern} — список ключей, соответствующих шаблону

Инструменты:

  • Основные операции:
    • get_value — Получить значение
    • set_value — установить значение с необязательным сроком действия
    • delete_key - Удалить ключ
    • инкремент — увеличение числового значения
  • Список операций:
    • list_push — Поместить значения в список
    • list_range — Получить диапазон значений списка
  • Операции хеширования:
    • hash_set - Установить хеш-поля
    • hash_get - Получить хэш-поля
  • Операции над множествами:
    • set_add — Добавить в набор
    • set_members — Получить набор членов
  • Издатель/Подписчик:
    • publish_message - Опубликовать сообщение

Каждый инструмент включает обработку ошибок и возвращает осмысленные ответы. Сервер автоматически переподключится к Redis, если соединение потеряно.

Вы можете проверить это с помощью MCP Inspector: mcp dev src/server.py

Или установите его в Claude Desktop: mcp install src/server.py

Пример

User: What's the current Redis connection status? LLM: Let me check the Redis connection status for you. [Reading resource redis://status] The Redis server is currently connected and running on localhost:6379, database 0. User: Can you store my name "Alice" in Redis? LLM: I'll help you store your name in Redis using the set_value tool. [Calling set_value with key="name" value="Alice"] Successfully set key 'name' I've stored your name "Alice" in Redis under the key "name". Would you like me to verify the value was stored correctly by retrieving it? User: Yes please verify it LLM: I'll retrieve the value using the get_value tool. [Calling get_value with key="name"] Alice Yes, I can confirm that your name "Alice" was successfully stored in Redis and can be retrieved correctly. The value matches exactly what we stored.

Эта реализация обеспечивает прочную основу для интеграции Redis через MCP. Вы можете расширить ее, добавив больше команд Redis по мере необходимости для вашего конкретного варианта использования.

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Сервер, который предоставляет Клоду доступ к базе данных Redis и операции с ней посредством набора инструментов для базовых операций, списков, хэшей, наборов и функций публикации/подписки.

  1. Возможности этого сервера
    1. Пример

      Related MCP Servers

      • -
        security
        A
        license
        -
        quality
        Provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
        Last updated -
        73
        17
        JavaScript
        MIT License
        • Apple
        • Linux
      • A
        security
        A
        license
        A
        quality
        Enables users to perform Redis database operations using the Model Context Protocol (MCP) tools, allowing for efficient data management through commands like setting, getting, and scanning hash fields.
        Last updated -
        13
        29
        5
        TypeScript
        MIT License
      • A
        security
        A
        license
        A
        quality
        Connects Claude Desktop to Redmine for seamless project and issue management, including searching, creating, updating, and tracking tasks using Redmine's API.
        Last updated -
        5
        14
        Python
        Mozilla Public License 2.0
        • Apple
        • Linux
      • A
        security
        F
        license
        A
        quality
        A server that enables Claude Desktop users to access the Claude API directly, allowing them to bypass Professional Plan limitations and use advanced features like custom system prompts and conversation management.
        Last updated -
        1
        5
        Python
        • Apple

      View all related MCP servers

      ID: 5ydzwgd6w0