Skip to main content
Glama
Redis CRUD MCP Server

Redis CRUD MCP Server

by Nicolas-One

Redis CRUD MCP Server

This is an MCP (Model Context Protocol) server plugin for Redis database operations, providing a full suite of CRUD tools.

✨ Features

  • 🔍 Automatic Project Configuration Detection - Automatically searches upwards for .env files to locate the project root directory

  • 🔄 Multi-Project Support - Automatically uses different Redis connections for different projects

  • ⏱️ Connection Timeout Protection - 10-second default timeout, configurable via environment variables

  • 📝 Multiple Configuration Formats - Supports both INI section and KEY=VALUE formats

  • 🛠️ Multi-Tool Compatibility - Supports Claude Code, Cline, Codex, etc.

Related MCP server: MCP Server Redis

🚀 Quick Start

npm install -g redis-crud-server

MCP Configuration

Create a .mcp.json file in your project root:

{
  "mcpServers": {
    "redis-crud": {
      "command": "redis-crud-server"
    }
  }
}

⚙️ Configuration Guide

Configuration Format 1: INI Section Format

[REDIS]
REDIS_HOSTNAME = 127.0.0.1
PORT = 6379
REDIS_PASSWORD = your_password
SELECT = 0

Configuration Format 2: KEY=VALUE Format

REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=your_password

Supported Configuration Names

Configuration Item

Supported Names

Host

REDIS_HOST / REDIS_SERVER_HOST / REDIS_HOSTNAME

Port

REDIS_PORT / REDIS_SERVER_PORT / PORT

Password

REDIS_PASSWORD / REDIS_SERVER_PASSWORD / PASSWORD

Database

REDIS_DB / SELECT / DATABASE_INDEX

🔧 Tool List

String Operations

  • redis_set - Set string key-value

  • redis_get - Get string key-value

  • redis_del - Delete key

  • redis_exists - Check if key exists

Hash Operations

  • redis_hset - Set hash field

  • redis_hget - Get hash field

  • redis_hgetall - Get all hash fields

  • redis_hdel - Delete hash field

Information

  • redis_info - Get connection information

⏱️ Timeout Configuration

The default connection timeout is 10 seconds, which can be configured via environment variables:

{
  "mcpServers": {
    "redis-crud": {
      "command": "redis-crud-server",
      "env": {
        "REDIS_TIMEOUT": "30000"
      }
    }
  }
}

📝 Usage Examples

Set Key-Value

redis_set: key=test_key, value=hello_world

Get Key-Value

redis_get: key=test_key

Hash Operations

redis_hset: key=user:1, field=name, value=张三
redis_hget: key=user:1, field=name
redis_hgetall: key=user:1

🐛 Troubleshooting

Connection Timeout

  • Check network connection and firewall settings

  • Confirm the Redis server is accessible

  • Adjust the REDIS_TIMEOUT environment variable

Configuration File Not Found

  • Ensure the .env file is in the project root directory

  • MCP will automatically search upwards for the .env file

INI Format Parsing Failure

  • Ensure the correct section name [REDIS] is used

  • Supports Windows (\r\n), Unix (\n), and legacy Mac (\r) line endings

📄 License

MIT

Available Tools

9 tools
redis_delC

删除键。

Inputs: key (required).

redis_existsC

检查键是否存在。

Inputs: key (required).

redis_getC

获取键值。

Inputs: key (required).

redis_hdelC

删除哈希字段。

Inputs: key (required), fields (required).

redis_hgetC

获取哈希字段。

Inputs: key (required), field (required).

redis_hgetallC

获取哈希所有字段。

Inputs: key (required).

redis_hsetC

设置哈希字段。

Inputs: key (required), field (required), value (required).

redis_infoB

获取连接信息。

Inputs: no named parameters.

redis_setC

设置键值。自动读取项目 .env 配置连接 Redis。

Inputs: key (required), value (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: key operations (del, exists, get, set) and hash operations (hdel, hget, hgetall, hset) are well-separated, with an additional info tool for connection details. No ambiguity.

    Naming Consistency5/5

    All tools follow a consistent pattern: 'redis_' prefix followed by verb_noun in snake_case (e.g., redis_del, redis_hgetall). No camelCase or mixing of conventions.

    Tool Count5/5

    9 tools is well-scoped for a Redis CRUD server. It covers essential operations for keys and hashes without being excessive or insufficient.

    Completeness4/5

    Covers CRUD for keys (set, get, exists, del) and hashes (hset, hget, hgetall, hdel). Missing hash field existence check (hexists) and other data structures like lists/sets, but acceptable for a basic CRUD server.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      Provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
      179 npm
      30
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A server that provides Claude with Redis database access and operations through a set of tools for basic operations, lists, hashes, sets, and pub/sub functionality.
      25
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to perform comprehensive Redis database operations including managing strings, hashes, lists, sets, sorted sets, TTL management, and data backup/restore. Supports secure connections and provides batch operations for efficient Redis interaction through natural language.
      34
      17 npm
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI to safely view and operate Redis databases with read-only mode by default and support for key operations.
      11
      MIT