Skip to main content
Glama

MCP Server Redis

Uso

La estructura es la siguiente:

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

Para utilizar este servidor, necesitarás:

Instale las dependencias necesarias:

[Si aún no está instalado] https://docs.astral.sh/uv/

uv venv

source .venv/bin/activate

uv sync

Consulte el archivo .env.example para configurar su conexión Redis agregando las variables adecuadas.

Ejecutar el servidor:

python src/server.py

Capacidades de este servidor

Recursos:

  • redis://status - Estado de la conexión actual
  • redis://info - Información del servidor Redis
  • redis://keys/{pattern} - Lista de claves que coinciden con un patrón

Herramientas:

  • Operaciones básicas:
    • get_value - Obtener un valor
    • set_value - Establece un valor con vencimiento opcional
    • delete_key - Eliminar una clave
    • incremento - Incrementar un valor numérico
  • Operaciones de lista:
    • list_push - Envía valores a una lista
    • list_range - Obtener el rango de valores de la lista
  • Operaciones hash:
    • hash_set - Establecer campos hash
    • hash_get - Obtener campos hash
  • Operaciones de conjuntos:
    • set_add - Agregar a un conjunto
    • set_members - Obtener miembros del conjunto
  • Pub/Sub:
    • publish_message - Publicar un mensaje

Cada herramienta incluye gestión de errores y devuelve respuestas relevantes. El servidor se reconectará automáticamente a Redis si se pierde la conexión.

Puedes probarlo con el Inspector MCP: mcp dev src/server.py

O instálelo en Claude Desktop: mcp install src/server.py

Ejemplo

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.

Esta implementación proporciona una base sólida para la integración de Redis mediante MCP. Puede ampliarla aún más añadiendo más comandos de Redis según sea necesario para su caso de uso específico.

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

Un servidor que proporciona a Claude acceso y operaciones a la base de datos Redis a través de un conjunto de herramientas para operaciones básicas, listas, hashes, conjuntos y funcionalidad de publicación/suscripción.

  1. Capacidades de este servidor
    1. Ejemplo

      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 -
        877
        29
        JavaScript
        MIT License
        • Apple
        • Linux
      • A
        security
        F
        license
        A
        quality
        The server facilitates natural language interactions for exploring and understanding codebases, providing insights into data models and system architecture using a cost-effective, simple setup with support for existing Claude Pro subscriptions.
        Last updated -
        4
        18
        Python
        • Apple
      • A
        security
        A
        license
        A
        quality
        A server that enables Claude to access and search through command-line journal entries, offering features like searching entries, listing tags, and viewing journal statistics.
        Last updated -
        6
        0
        TypeScript
        MIT License
        • Apple
      • -
        security
        A
        license
        -
        quality
        This server enables Claude to directly interact with SQLite, SQL Server, PostgreSQL, and MySQL databases through the Model Context Protocol, allowing for query execution, table management, and data export capabilities.
        Last updated -
        TypeScript
        MIT License
        • Apple
        • Linux

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/prajwalnayak7/mcp-server-redis'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server