Cover image
Try Now
2025-02-12

MCP Server pour interagir avec Redis Server, AWS Memory DB, etc. pour la mise en cache ou d'autres cas d'utilisation où le stockage basé sur la mémoire et la valeur clé est approprié

3 years

Works with Finder

1

Github Watches

1

Github Forks

17

Github Stars

Usage

The structure is as follows:

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

To use this server, you'll need to:

Install the required dependencies:

[If not already installed] https://docs.astral.sh/uv/

uv venv

source .venv/bin/activate

uv sync

Refer to the .env.example file to configure your Redis connection by adding the appropriate variables.

Run the server:

python src/server.py

Capabilities of this server

Resources:

  • redis://status - Current connection status
  • redis://info - Redis server information
  • redis://keys/{pattern} - List keys matching a pattern

Tools:

  • Basic operations:
    • get_value - Get a value
    • set_value - Set a value with optional expiry
    • delete_key - Delete a key
    • increment - Increment a numeric value
  • List operations:
    • list_push - Push values to a list
    • list_range - Get range of list values
  • Hash operations:
    • hash_set - Set hash fields
    • hash_get - Get hash fields
  • Set operations:
    • set_add - Add to a set
    • set_members - Get set members
  • Pub/Sub:
    • publish_message - Publish a message

Each tool includes error handling and returns meaningful responses. The server will automatically reconnect to Redis if the connection is lost.

You can test it with the MCP Inspector: mcp dev src/server.py

Or install it in Claude Desktop: mcp install src/server.py

Example

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.

This implementation provides a solid foundation for Redis integration through MCP. You can extend it further by adding more Redis commands as needed for your specific use case.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • OffchainLabs
  • Aller la mise en œuvre de la preuve de la participation Ethereum

  • huahuayu
  • Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.

  • deemkeen
  • Contrôlez votre MBOT2 avec un combo d'alimentation: MQTT + MCP + LLM

    Reviews

    5 (1)
    Avatar
    user_RvgFzAWM
    2025-04-15

    HireBase MCP Server by jhgaylor is an exceptional tool for managing server applications. Its intuitive interface makes it user-friendly, while its robust features ensure optimal performance. The seamless integration capabilities have significantly streamlined my workflow. Overall, this server solution is reliable and highly effective. Highly recommended for anyone in need of a solid server management system.