Redis Server logo

Redis Server

by modelcontextprotocol

This is a Model Context Protocol server that provides access to Redis databases. It enables LLMs to interact with Redis key-value stores through a set of standardized tools.

View on GitHub

Last updated: N/A

What is Redis Server?

This server is a Model Context Protocol (MCP) server designed to allow Large Language Models (LLMs) to interact with Redis databases. It provides a standardized interface for LLMs to perform operations like setting, getting, deleting, and listing keys in a Redis database.

How to use Redis Server?

To use this server, you need a running Redis instance. You can then configure the server using Docker or NPX, as shown in the provided configuration examples. The server exposes tools like 'set', 'get', 'delete', and 'list' that LLMs can use to interact with the Redis database.

Key features of Redis Server

  • Provides access to Redis databases for LLMs

  • Standardized tools for interacting with Redis

  • Supports setting, getting, deleting, and listing keys

  • Can be deployed using Docker or NPX

  • Implements exponential backoff for reconnection attempts

Use cases of Redis Server

  • Storing and retrieving information for LLMs

  • Caching data for LLMs

  • Managing state for LLMs

  • Providing LLMs with access to external data sources

FAQ from Redis Server

How do I resolve connection errors?

Ensure the Redis server is running and reachable. Verify the Redis URL format and that the port is not blocked by a firewall. Use redis-cli ping to check the connection.

What happens if the server loses connection to Redis?

The server implements exponential backoff with a maximum of 5 retries. It will exit after max retries to prevent infinite reconnection loops.

How do I set a key-value pair?

Use the 'set' tool with the 'key', 'value', and optional 'expireSeconds' parameters.

How do I get a value by key?

Use the 'get' tool with the 'key' parameter.

How do I list Redis keys?

Use the 'list' tool with an optional 'pattern' parameter to match keys.