Redis MCP Server

Databasestdiov2026.1.26
代码仓库

MCP server for Redis key-value store interaction. Enables AI agents to read and write data in Redis, manage keys, work with data structures (strings, hashes, lists, sets), and perform pub/sub operations. Useful for caching, session management, real-time data, and inter-service communication in distributed systems.

连接

将此配置添加到 .claude/mcp.json

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-redis",
        "redis://localhost:6379"
      ],
      "env": {
        "REDIS_URL": "<YOUR_REDIS_URL>"
      }
    }
  }
}

工具 (5)

get

Get the value of a key from Redis.

{
  "type": "object",
  "required": [
    "key"
  ],
  "properties": {
    "key": {
      "type": "string",
      "description": "Redis key to retrieve"
    }
  }
}

set

Set a key-value pair in Redis with optional expiration.

{
  "type": "object",
  "required": [
    "key",
    "value"
  ],
  "properties": {
    "key": {
      "type": "string",
      "description": "Redis key"
    },
    "ttl": {
      "type": "integer",
      "description": "Time-to-live in seconds (optional)"
    },
    "value": {
      "type": "string",
      "description": "Value to store"
    }
  }
}

keys

Find all keys matching a pattern.

{
  "type": "object",
  "required": [
    "pattern"
  ],
  "properties": {
    "pattern": {
      "type": "string",
      "description": "Glob-style pattern to match keys (e.g. user:*)"
    }
  }
}

hgetall

Get all fields and values of a hash stored at key.

{
  "type": "object",
  "required": [
    "key"
  ],
  "properties": {
    "key": {
      "type": "string",
      "description": "Redis hash key"
    }
  }
}

delete

Delete one or more keys from Redis.

{
  "type": "object",
  "required": [
    "keys"
  ],
  "properties": {
    "keys": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Keys to delete"
    }
  }
}

资源

此服务器未提供任何资源。

提示词

此服务器未提供任何提示词。

服务器信息

作者
Anthropic (@modelcontextprotocol)
代码仓库
https://github.com/modelcontextprotocol/servers
许可证
Apache-2.0
版本
2026.1.26
星标
86,206
最后更新
2026年1月27日