# mcp-server-redis

> MCP Server

This repository provides a Python-based Redis server with resources for connection status, server information, key listing, and tools for basic operations, lists, hashes, sets, and pub/sub functionalities. This repository provides

## Overview

- **Category:** Database
- **Language:** Python
- **Stars:** 25
- **Forks:** 0
- **Owner:** prajwalnayak7
- **GitHub:** https://github.com/prajwalnayak7/mcp-server-redis
- **Created:** 2025-02-02T00:41:03+00:00
- **Updated:** 2025-03-28T22:48:20+00:00
- **Source:** https://model-context-protocol.com/servers/python-redis-server-key-value-cache

## Setup

## Setup

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`

## Tools

## Available Tools

		1. Resources: redis://status (Current connection status)
		2. Resources: redis://info (Redis server information)
		3. Resources: redis://keys/{pattern} (List keys matching a pattern)
		4. Basic operations: get_value (Get a value)
		5. Basic operations: set_value (Set a value with optional expiry)
		6. Basic operations: delete_key (Delete a key)
		7. Basic operations: increment (Increment a numeric value)
		8. List operations: list_push (Push values to a list)
		9. List operations: list_range (Get range of list values)
		10. Hash operations: hash_set (Set hash fields)
		11. Hash operations: hash_get (Get hash fields)
		12. Set operations: set_add (Add to a set)
		13. Set operations: set_members (Get set members)
		14. Pub/Sub: publish_message (Publish a message)
