How to Use Redis’s New AI‑Enabled MCP and Skill Packages with Claude Code
This guide walks through installing Redis MCP and the official Agent Skills, then demonstrates how Claude Code can store, query, and cache data in Redis using natural language, while the Skill package supplies best‑practice recommendations such as vector search and sorted‑set selection.
Introduction
Redis released two open‑source projects that add AI capabilities to the database: mcp-redis, an implementation of the Model Context Protocol (MCP) service, and agent-skills, a collection of best‑practice skills for AI agents.
Redis MCP and Agent Skills
MCP defines a standard protocol that lets a large language model (LLM) read and write Redis data. The mcp-redis service exposes tools for all common Redis data types (String, Hash, List, Set, Sorted Set, Stream, Pub/Sub, JSON) and also supports vector indexes, server‑status queries, and documentation search.
Agent Skills are packaged command sets and reference material that an AI can load automatically. The Redis skill set contains eight skills covering data‑structure selection, connection pooling, search & aggregation, semantic caching, clustering, security, observability, and Iris Agent Memory integration.
Installation
Three steps: prepare a uv environment, configure MCP with cc-switch , and install the Skill package with npx .
Prerequisites
Redis MCP is a Python‑ecosystem package published on PyPI. The recommended runner is uvx, which requires the uv tool. On Windows install it with: winget install astral-sh.uv The MCP configuration is managed with cc-switch, a GUI tool for Claude Code, Codex, and Gemini CLI settings.
Install Redis MCP
Start a local Redis instance (Docker example):
docker run --name redis8 \
-p 6379:6379 \
-d redis:8.0Add an MCP entry named redis-mcp in cc-switch with type stdio and the following JSON (replace --url with your Redis address and lock the SDK to mcp<2 to avoid incompatibility with SDK 2.0):
{
"type": "stdio",
"command": "uvx",
"args": [
"--from",
"redis-mcp-server@latest",
"--with",
"mcp<2",
"redis-mcp-server",
"--url",
"redis://127.0.0.1:6379/0"
]
}After saving, open Claude Code and run /mcp. A response of connected indicates success and shows that 47 tools are available.
Install Redis Skill
Install the Skill package with a single npx command (Node.js required): npx skills add redis/agent-skills The CLI lists the eight skills; select the desired ones and the target tool (e.g., Claude Code).
Usage examples
Three scenarios demonstrate the combined power of MCP and Skill.
Natural‑language data store
Prompt (Chinese):
帮我把用户张三的信息存到Redis里,姓名张三,年龄28,邮箱[email protected]Claude Code calls the json_set tool with key user:zhangsan, stores the data as JSON, then uses json_get to echo the stored record.
Cache with expiration
把这次会话的摘要缓存到Redis,key用session:demo,1小时后自动过期The json_set tool writes the value with a TTL; a subsequent TTL query confirms the remaining time.
Skill‑guided data‑structure selection
我要做一个游戏排行榜,实时按分数排名,用Redis的什么数据结构合适?帮我把示例数据写进去The redis-core skill recommends a Sorted Set, explains that ZADD / ZINCRBY update scores and ZREVRANGE retrieves the top N, suggests a key name game:demo:leaderboard, and the MCP tool writes sample data.
Other AI‑related Redis capabilities
Vector search : native HNSW/FLAT indexes, KNN and range queries, lightweight Vector Set type.
LangCache : semantic cache service that reuses LLM responses for similar queries, reducing API cost.
Agent Memory : session and long‑term memory for AI agents via REST API and SDK.
Context Retriever : wraps business data as managed tools for reliable agent calls.
RedisVL : Python vector library SDK for AI applications.
Framework integration : official integrations with LangChain, LangGraph, LlamaIndex, Semantic Kernel, etc.
Redis Cloud MCP : natural‑language management of Redis Cloud subscriptions and databases.
Project links
Redis MCP: https://github.com/redis/mcp-redis Redis Skill:
https://github.com/redis/agent-skillsSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
