Redis CRUD MCP Server
Provides comprehensive Redis database operations supporting all major data types (strings, lists, sets, hashes, sorted sets) with full CRUD functionality through natural language commands.
README
Redis CRUD MCP 服务器
这是一个 Model Context Protocol (MCP) 服务器,提供完整的 Redis 数据库 CRUD 操作工具。
功能特性
支持 Redis 的主要数据类型:
字符串 (Strings)
- redis_set: 在 Redis 中设置字符串键值对
- redis_get: 获取 Redis 中字符串键的值
列表 (Lists)
- redis_lpush: 从列表左侧推入元素
- redis_rpush: 从列表右侧推入元素
- redis_lpop: 从列表左侧弹出元素
- redis_rpop: 从列表右侧弹出元素
- redis_lrange: 获取列表指定范围的元素
- redis_llen: 获取列表长度
集合 (Sets)
- redis_sadd: 向集合添加成员
- redis_srem: 从集合移除成员
- redis_smembers: 获取集合的所有成员
- redis_sismember: 检查成员是否在集合中
哈希 (Hashes)
- redis_hset: 设置哈希字段的值
- redis_hget: 获取哈希字段的值
- redis_hgetall: 获取哈希的所有字段和值
- redis_hdel: 删除哈希字段
有序集合 (Sorted Sets)
- redis_zadd: 向有序集合添加成员
- redis_zrem: 从有序集合移除成员
- redis_zrange: 获取有序集合指定分数范围的成员
通用操作
- redis_del: 删除 Redis 中的键
- redis_exists: 检查 Redis 中键是否存在
安装
- 安装依赖:
npm install
- 构建项目:
npm run build
配置
服务器通过环境变量连接到 Redis 数据库:
REDIS_HOST: Redis 服务器主机地址 (默认: 127.0.0.1)REDIS_PORT: Redis 服务器端口 (默认: 6379)REDIS_PASSWORD: Redis 密码 (必需)
启动服务器
npm start
测试
运行测试脚本验证功能:
node test.js
在 Cline 中使用
要将此服务器添加到 Cline MCP 配置中:
- 复制项目中的
cline_mcp_settings.example.json文件 - 编辑其中的配置信息:
- 将
"path/to/your/redis-crud-server/build/index.js"替换为实际的构建文件路径 - 设置正确的 Redis 连接参数
- 将
- 将配置添加到您的
cline_mcp_settings.json文件中
配置位置:
- Windows:
%APPDATA%\\Code\\User\\globalStorage\\saoudrizwan.claude-dev\\settings\\cline_mcp_settings.json - macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Linux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
环境变量配置
必需的环境变量:
REDIS_HOST: Redis 服务器主机地址 (默认: 127.0.0.1)REDIS_PORT: Redis 服务器端口 (默认: 6379)REDIS_PASSWORD: Redis 密码 (必需)
配置示例
{
"mcpServers": {
"redis-crud-server": {
"autoApprove": [
"redis_set",
"redis_get",
"redis_del",
"redis_exists",
"redis_lpush",
"redis_rpush",
"redis_lpop",
"redis_rpop",
"redis_lrange",
"redis_llen",
"redis_sadd",
"redis_srem",
"redis_smembers",
"redis_sismember",
"redis_hset",
"redis_hget",
"redis_hgetall",
"redis_hdel",
"redis_zadd",
"redis_zrem",
"redis_zrange"
],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "node",
"args": [
"/path/to/your/project/redis-crud-server/build/index.js"
],
"env": {
"REDIS_HOST": "127.0.0.1",
"REDIS_PORT": "6379",
"REDIS_PASSWORD": "your_actual_redis_password"
}
}
}
}
使用说明
配置完成后,重启 VS Code,Redis CRUD 工具将在 Cline 中可用。
开发
- 使用 TypeScript 编写
- 支持热重载开发:
npm run watch - 构建输出到
build/目录
许可证
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.