Token导航 LogoToken导航TokenDH.com
MCP Server Redis logo
数据服务未说明官方级别未说明来源级核验

MCP Server Redis

MCP Server

一个提供Redis连接管理和多种操作工具的服务,适用于需要Redis集成的开发场景。

工具数

11

提示词数

0

GitHub Stars

24

资源数

0
PythonClaude数据分析Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

prajwalnayak7

提供方

prajwalnayak7

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

](https://mseep.ai/app/prajwalnayak7-mcp-server-redis)

用法

结构如下:

mcp-server-redis/
├── src/
│   ├── __init__.py
│   ├── main.py           # Main entry point
│   ├── config.py         # Configuration
│   ├── connection.py     # Redis connection management
│   ├── resources/        # Resource implementations
│   │   ├── __init__.py
│   │   ├── status.py     # Connection status resources
│   │   └── keys.py       # Key-related resources
│   └── tools/           # Tool implementations
│       ├── __init__.py
│       ├── basic.py     # Basic Redis operations
│       ├── lists.py     # List operations
│       ├── hashes.py    # Hash operations
│       ├── sets.py      # Set operations
│       └── pubsub.py    # Pub/Sub operations
├── tests/              # Test directory
│   └── __init__.py
├── README.md
└── pyproject.toml

要使用此服务器,您需要:

安装所需的依赖项:

\[如果尚未安装\]https://docs.astral.sh/uv/

uv venv

source .venv/bin/activate

uv sync

请参阅.env.example文件,通过添加适当的变量来配置Redis连接。

运行服务器:

python src/server.py

此服务器的功能

资源:

  • redis://status-当前连接状态
  • redis://infoRedis服务器信息
  • redis://keys/{pattern}-列出与模式匹配的键

工具:

  • 基本操作:

- get_value-获取一个值 - set_value-设置一个具有可选到期时间的值 - delete_key-删除密钥 - increment-递增一个数值

  • 列表操作:

- list_push-将值推送到列表 - list_range-获取列表值的范围

  • 哈希运算:

- hash_set-设置哈希字段 - hash_get-获取哈希字段

  • 设置操作:

- set_add-添加到集合 - set_members-获取集合成员

  • 发布/订阅:

- publish_message-发布消息

每个工具都包括错误处理并返回有意义的响应。如果连接丢失,服务器将自动重新连接到Redis。

您可以使用MCP检查器进行测试: mcp dev src/server.py

或者在Claude Desktop中安装它: mcp install src/server.py

示例

User: What's the current Redis connection status?
LLM: Let me check the Redis connection status for you.

[Reading resource redis://status]

The Redis server is currently connected and running on localhost:6379, database 0.

User: Can you store my name "Alice" in Redis?
LLM: I'll help you store your name in Redis using the set_value tool.

[Calling set_value with key="name" value="Alice"]
Successfully set key 'name'

I've stored your name "Alice" in Redis under the key "name". Would you like me to verify the value was stored correctly by retrieving it?

User: Yes please verify it
LLM: I'll retrieve the value using the get_value tool.

[Calling get_value with key="name"]
Alice

Yes, I can confirm that your name "Alice" was successfully stored in Redis and can be retrieved correctly. The value matches exactly what we stored.

##

此实现为通过MCP集成Redis提供了坚实的基础。您可以根据特定用例的需要添加更多Redis命令来进一步扩展它。

目录标签

目录标签

PythonClaude数据分析Redis管理本地部署键值存储数据库工具开发集成Pub/Sub

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

11

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明noneremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP