Redis
Connect to Redis databases to use key-value storage operations, caching, data retrieval, and management features.
Key Features
- Redis command execution
- Key-value data manipulation
- Support for various data types including lists, sets, hashes
- JSON data processing
- Vector data storage and retrieval
- Search index management
Basic Information
Authentication Method
Authenticates using Redis connection information.
Input Parameters
- Host (required): Redis server host
- Port (required): Redis server port (default: 6379)
- Password (optional): Redis authentication password
- Database (optional): Database number to use (default: 0)
- Cluster Mode (optional): Whether to use cluster mode
Supported MCP Tools
run_command
Executes Redis commands and returns results.
Input Parameters:
commandText
(required): Redis command to execute
Supported Commands:
Basic Commands
- GET: Retrieves the value of a key
- SET: Sets a value for a key
- DEL: Deletes a key
- TYPE: Checks the data type of a key
- EXPIRE: Sets an expiration time for a key
- RENAME: Renames a key
List Commands
- LPUSH: Adds elements to the left of a list
- RPUSH: Adds elements to the right of a list
- LPOP: Removes and returns an element from the left of a list
- RPOP: Removes and returns an element from the right of a list
- LRANGE: Retrieves elements within a range of a list
- LLEN: Returns the length of a list
Set Commands
- SADD: Adds members to a set
- SREM: Removes members from a set
- SMEMBERS: Retrieves all members of a set
Hash Commands
- HSET: Sets a value for a hash field
- HGET: Retrieves the value of a hash field
- HGETALL: Retrieves all fields and values of a hash
- HDEL: Deletes hash fields
Sorted Set Commands
- ZADD: Adds members to a sorted set
- ZREM: Removes members from a sorted set
- ZRANGE: Retrieves members within a range of a sorted set
Information Commands
- INFO: Retrieves Redis server information
- DBSIZE: Returns the number of keys in the current database
- CLIENT_LIST: Retrieves the list of connected clients
JSON Commands
- JSON.SET: Sets JSON data
- JSON.GET: Retrieves JSON data
- JSON.DEL: Deletes JSON data
Search Commands
- FT.INFO: Retrieves search index information
- FT.SEARCH: Performs searches on search indexes
- FT.CREATE: Creates search indexes
Vector Commands
- SET_VECTOR: Sets vector data
- GET_VECTOR: Retrieves vector data
- GET_INDEXES: Retrieves index list
Other Commands
- PUBLISH: Publishes messages
Usage Example
For example,
- When you input “Retrieve the value of the ‘user:123’ key from Redis” as a prompt,
- The LLM calls the
run_command
tool through MCP to execute theGET user:123
command. - Then, it responds in the chat based on the tool call results.
Notes
- Keep Redis passwords secure.
- Be mindful of performance when retrieving large amounts of data.
- Carefully review data modification commands before use.
- Check network connection status.
Last updated on