Skip to content

Commit 9bc131b

Browse files
DOC-5254 started MCP docs
1 parent 532727b commit 9bc131b

File tree

3 files changed

+251
-0
lines changed

3 files changed

+251
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
Title: Redis MCP
3+
alwaysopen: false
4+
categories:
5+
- docs
6+
- integrate
7+
- rs
8+
description: Access a Redis server using any MCP client.
9+
group: service
10+
hideListLinks: false
11+
linkTitle: Redis MCP
12+
summary: Redis MCP server lets MCP clients access the features of Redis.
13+
type: integration
14+
weight: 1
15+
---
16+
17+
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
18+
is a standard that lets AI agents access data and perform actions. Using MCP,
19+
your server can publish a set of commands that are usable by any MCP-compatible
20+
client app (such as [Claude Desktop](https://claude.ai/download) or
21+
[VSCode](https://code.visualstudio.com/)). These commands can retrieve
22+
whatever data you wish to provide and you can also let the agent make
23+
changes to the data. For example, you could publish a feed of news items that
24+
an agent can use in its responses, and also let the agent add the user's
25+
comments to those items.
26+
27+
Redis MCP is a general-purpose implementation that lets agents read, write, and
28+
query data in Redis and also has some basic commands to manage the Redis
29+
server. With this enabled, you can use an LLM client as a very high-level
30+
interface to Redis. Add, query, and analyze any Redis data set directly from
31+
an LLM chat:
32+
33+
- "Store the entire conversation in the 'recent_chats' stream"
34+
- "Cache this item"
35+
- "How many keys does my database have?"
36+
- "What is user:1's email?"
37+
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
Title: Configure client apps
3+
alwaysopen: false
4+
categories:
5+
- docs
6+
- integrate
7+
- rs
8+
summary: Access a Redis server using any MCP client.
9+
group: service
10+
linkTitle: Configure client apps
11+
description: Configure client apps to use the Redis MCP server.
12+
type: integration
13+
weight: 20
14+
---
15+
16+
When you have [installed]({{< relref "/integrate/redis-mcp/install" >}})
17+
the Redis MCP server, you must also configure your client app to use it.
18+
The sections below describe the ways you can do this.
19+
20+
## Smithery
21+
22+
Smithery provides a searchable repository of scripts that add configurations
23+
for many MCP services to client apps.
24+
The easiest way to configure your client is to use the
25+
[Smithery tool for Redis MCP](https://smithery.ai/server/@redis/mcp-redis).
26+
27+
When you select your client from the **Install** bar on the Redis MCP page,
28+
you will see a command line that you can copy and paste into a terminal.
29+
Running this command will configure your client app to use Redis MCP. (Note
30+
that you need to have [Node.js](https://nodejs.org/en) installed to run
31+
the Smithery scripts.) For example, the command line for
32+
[Claude Desktop](https://claude.ai/download) is
33+
34+
```bash
35+
npx -y @smithery/cli@latest install @redis/mcp-redis --client claude
36+
```
37+
38+
The script will prompt you for the information required to connect to
39+
your Redis database.
40+
41+
## Manual configuration
42+
43+
You can also add the configuration for Redis MCP to your client app
44+
manually. The exact method varies from client to client but the
45+
basic approach is similar in each case.
46+
47+
For a locally-running MCP server, you need to edit the configuration
48+
file to add the command that launches the server, along with its
49+
arguments. For example, with Claude Desktop, you can locate the
50+
file by selecting **Settings** from the menu, then selecting the
51+
**Developer** tab, and then clicking the **Edit Config** button.
52+
When you open this JSON file, you should add your settings as
53+
shown below:
54+
55+
```json
56+
{
57+
"mcpServers": {
58+
.
59+
.
60+
"redis": {
61+
"command": "<path-to-uv-command>>",
62+
"args": [
63+
"--directory",
64+
"<your-folder-path>/mcp-redis",
65+
"run",
66+
"src/main.py"
67+
]
68+
}
69+
},
70+
.
71+
.
72+
}
73+
```
74+
75+
You can find the path to the `uv` command using `which uv`, or
76+
the equivalent. You can also optionally set the environment for
77+
the command shell here in the `env` section:
78+
79+
```json
80+
"redis": {
81+
"command": "<path-to-uv-command>>",
82+
"args": [
83+
"--directory",
84+
"<your-folder-path>/mcp-redis",
85+
"run",
86+
"src/main.py"
87+
],
88+
"env": {
89+
"REDIS_HOST": "<your_redis_database_hostname>",
90+
"REDIS_PORT": "<your_redis_database_port>",
91+
"REDIS_PWD": "<your_redis_database_password>",
92+
"REDIS_SSL": True|False,
93+
"REDIS_CA_PATH": "<your_redis_ca_path>",
94+
"REDIS_CLUSTER_MODE": True|False
95+
}
96+
}
97+
```
98+
99+
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
Title: Install
3+
alwaysopen: false
4+
categories:
5+
- docs
6+
- integrate
7+
- rs
8+
summary: Access a Redis server using any MCP client.
9+
group: service
10+
linkTitle: Install
11+
description: Install and configure the Redis MCP server.
12+
type: integration
13+
weight: 10
14+
---
15+
16+
The MCP server runs separately from Redis, so you will need a
17+
Redis server to access. See [Redis Cloud]({{< relref "/operate/rc" >}})
18+
or [Redis Open Source]({{< relref "/operate/oss_and_stack" >}}) to learn
19+
how to get a test server active within minutes.
20+
21+
## Install the server from source
22+
23+
When you have a Redis server, you can clone Redis MCP from the
24+
[Github repository](https://github.com/redis/mcp-redis) using the following
25+
command:
26+
27+
```bash
28+
git clone https://github.com/redis/mcp-redis.git
29+
```
30+
31+
You will also need the [`uv`](https://github.com/astral-sh/uv) packaging
32+
tool to set up the server. See the `uv`
33+
[installation instructions](https://github.com/astral-sh/uv?tab=readme-ov-file#installation)
34+
for more information.
35+
36+
When you have `uv`, go into the `mcp-redis` folder that you cloned and
37+
enter the following commands to initialize the MCP server code:
38+
39+
```bash
40+
cd mcp-redis
41+
42+
uv venv
43+
source .venv/bin/activate
44+
uv sync
45+
```
46+
47+
## Install using Docker
48+
49+
You can use the [`mcp/redis`](https://hub.docker.com/r/mcp/redis)
50+
image (or build your own image from the source using the `Dockerfile`) to
51+
run Redis MCP with [Docker](https://www.docker.com/). Use the following
52+
command to download `mcp/redis` from [DockerHub](https://hub.docker.com/):
53+
54+
```
55+
docker build -t mcp-redis .
56+
```
57+
58+
## Configuration
59+
60+
The default settings for MCP assume a Redis server is running on the
61+
local machine, with the default port and no security arrangements.
62+
To change these settings, use the environment variables shown in the
63+
table below. For example, for a `bash` shell, use
64+
65+
```bash
66+
export REDIS_USERNAME="my_username"
67+
```
68+
69+
from the command line or the `.bashrc` file to set the username you want
70+
to connect with.
71+
72+
73+
| Name | Description | Default Value |
74+
|----------------------|-----------------------------------------------------------|---------------|
75+
| `REDIS_HOST` | Redis IP or hostname | `"127.0.0.1"` |
76+
| `REDIS_PORT` | Redis port | `6379` |
77+
| `REDIS_USERNAME` | Default database username | `"default"` |
78+
| `REDIS_PWD` | Default database password | "" |
79+
| `REDIS_SSL` | Enables or disables SSL/TLS | `False` |
80+
| `REDIS_CA_PATH` | CA certificate for verifying server | None |
81+
| `REDIS_SSL_KEYFILE` | Client's private key file for client authentication | None |
82+
| `REDIS_SSL_CERTFILE` | Client's certificate file for client authentication | None |
83+
| `REDIS_CERT_REQS` | Whether the client should verify the server's certificate | `"required"` |
84+
| `REDIS_CA_CERTS` | Path to the trusted CA certificates file | None |
85+
| `REDIS_CLUSTER_MODE` | Enable Redis Cluster mode | `False` |
86+
| `MCP_TRANSPORT` | Use the `stdio` or `sse` transport | `stdio` |
87+
88+
### Making MCP visible externally
89+
90+
{{< note >}}The configuration for an MCP client includes the commands
91+
to start a local server, so you can ignore this section if you don't
92+
want your Redis MCP to be externally accessible.
93+
{{< /note >}}
94+
95+
The default configuration assumes you only want to use the MCP server
96+
locally, but you can make it externally available by setting
97+
`MCP_TRANSPORT` to `sse`:
98+
99+
```bash
100+
export MCP_TRANSPORT="sse"
101+
```
102+
103+
Then, start the server with the following command:
104+
105+
```bash
106+
uv run src/main.py
107+
```
108+
109+
You can test the server is responding with the [`curl`](https://curl.se/)
110+
tool:
111+
112+
```bash
113+
curl -i http://127.0.0.1:8000/sse
114+
HTTP/1.1 200 OK
115+
```

0 commit comments

Comments
 (0)