You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[VS Code with GitHub Copilot](#vs-code-with-github-copilot)
31
-
-[Augment](#augment)
31
+
-[Testing](#testing)
32
+
-[Example Use Cases](#example-use-cases)
32
33
-[Contributing](#contributing)
33
34
-[License](#license)
34
35
-[Badges](#badges)
@@ -62,9 +63,11 @@ Additional tools.
62
63
63
64
## Installation
64
65
65
-
### Quick Start with uvx (Recommended)
66
+
### Quick Start with uvx
66
67
67
-
The easiest way to use the Redis MCP Server is with `uvx`, which allows you to run it directly from GitHub without installation on the MCP Client side:
68
+
The easiest way to use the Redis MCP Server is with `uvx`, which allows you to run it directly from GitHub (from a branch, or use a tagged release).
69
+
70
+
> No PyPi package is available at the moment.
68
71
69
72
```sh
70
73
# Run with Redis URI
@@ -94,18 +97,91 @@ uv venv
94
97
source .venv/bin/activate
95
98
uv sync
96
99
97
-
# Run with CLI interface (recommended)
100
+
# Run with CLI interface
98
101
uv run redis-mcp-server --help
99
102
100
103
# Or run the main file directly (uses environment variables)
101
104
uv run src/main.py
102
105
```
103
106
107
+
Once you cloned the repository, installed the dependencies and verified you can run the server, you can configure Claude Desktop or any other MCP Client to use this MCP Server running the main file directly (it uses environment variables). This is usually preferred for development.
108
+
The following example is for Claude Desktop, but the same applies to any other MCP Client.
109
+
110
+
1. Specify your Redis credentials and TLS configuration
111
+
2. Retrieve your `uv` command full path (e.g. `which uv`)
112
+
3. Edit the `claude_desktop_config.json` configuration file
113
+
- on a MacOS, at `~/Library/Application\ Support/Claude/`
114
+
115
+
```json
116
+
{
117
+
"mcpServers": {
118
+
"redis": {
119
+
"command": "<full_path_uv_command>",
120
+
"args": [
121
+
"--directory",
122
+
"<your_mcp_server_directory>",
123
+
"run",
124
+
"src/main.py"
125
+
],
126
+
"env": {
127
+
"REDIS_HOST": "<your_redis_database_hostname>",
128
+
"REDIS_PORT": "<your_redis_database_port>",
129
+
"REDIS_PWD": "<your_redis_database_password>",
130
+
"REDIS_SSL": True|False,
131
+
"REDIS_CA_PATH": "<your_redis_ca_path>",
132
+
"REDIS_CLUSTER_MODE": True|False
133
+
}
134
+
}
135
+
}
136
+
}
137
+
```
138
+
139
+
You can troubleshoot problems by tailing the log file.
You can use a dockerized deployment of this server. You can either build your own image or use the official [Redis MCP Docker](https://hub.docker.com/r/mcp/redis) image.
148
+
149
+
If you'd like to build your own image, the Redis MCP Server provides a Dockerfile. Build this server's image with:
150
+
151
+
```commandline
152
+
docker build -t mcp-redis .
153
+
```
154
+
155
+
Finally, configure the client to create the container at start-up. An example for Claude Desktop is provided below. Edit the `claude_desktop_config.json` and add:
156
+
157
+
```json
158
+
{
159
+
"mcpServers": {
160
+
"redis": {
161
+
"command": "docker",
162
+
"args": ["run",
163
+
"--rm",
164
+
"--name",
165
+
"redis-mcp-server",
166
+
"-i",
167
+
"-e", "REDIS_HOST=<redis_hostname>",
168
+
"-e", "REDIS_PORT=<redis_port>",
169
+
"-e", "REDIS_USERNAME=<redis_username>",
170
+
"-e", "REDIS_PWD=<redis_password>",
171
+
"mcp-redis"]
172
+
}
173
+
}
174
+
}
175
+
```
176
+
177
+
To use the official [Redis MCP Docker](https://hub.docker.com/r/mcp/redis) image, just replace your image name (`mcp-redis` in the example above) with `mcp/redis`.
178
+
104
179
## Configuration
105
180
106
-
The Redis MCP Server can be configured in two ways: via command line arguments (recommended) or environment variables.
181
+
The Redis MCP Server can be configured in two ways: via command line arguments or via environment variables.
182
+
The precedence is: command line arguments > environment variables > default values.
107
183
108
-
### Configuration via Command Line (Recommended)
184
+
### Configuration via command line arguments
109
185
110
186
When using the CLI interface, you can configure the server with command line arguments:
There are several ways to set environment variables:
166
243
167
244
1.**Using a `.env` File**:
168
-
Place a `.env` file in your project directory with key-value pairs for each environment variable. Tools like `python-dotenv`, `pipenv`, and `uv` can automatically load these variables when running your application. This is a convenient and secure way to manage configuration, as it keeps sensitive data out of your shell history and version control (if `.env` is in `.gitignore`).
169
-
245
+
Place a `.env` file in your project directory with key-value pairs for each environment variable. Tools like `python-dotenv`, `pipenv`, and `uv` can automatically load these variables when running your application. This is a convenient and secure way to manage configuration, as it keeps sensitive data out of your shell history and version control (if `.env` is in `.gitignore`).
170
246
For example, create a `.env` file with the following content from the `.env.example` file provided in the repository:
171
247
172
-
```bash
248
+
```bash
173
249
cp .env.example .env
174
-
```
175
-
250
+
```
176
251
177
-
Then edit the `.env` file to set your Redis configuration:
252
+
Then edit the `.env` file to set your Redis configuration:
178
253
179
254
OR,
180
255
181
256
2.**Setting Variables in the Shell**:
182
-
You can export environment variables directly in your shell before running your application. For example:
183
-
```sh
184
-
export REDIS_HOST=your_redis_host
185
-
export REDIS_PORT=6379
186
-
# Other variables will be set similarly...
187
-
```
188
-
This method is useful for temporary overrides or quick testing.
257
+
You can export environment variables directly in your shell before running your application. For example:
258
+
259
+
```sh
260
+
export REDIS_HOST=your_redis_host
261
+
export REDIS_PORT=6379
262
+
# Other variables will be set similarly...
263
+
```
264
+
265
+
This method is useful for temporary overrides or quick testing.
266
+
267
+
268
+
## Integrations
189
269
270
+
Integrating this MCP Server to development frameworks like OpenAI Agents SDK, or with tools like Claude Desktop, VS Code, or Augment is described in the following sections.
190
271
191
-
##Integration with OpenAI Agents SDK
272
+
###OpenAI Agents SDK
192
273
193
274
Integrate this MCP Server with the OpenAI Agents SDK. Read the [documents](https://openai.github.io/openai-agents-python/mcp/) to learn more about the integration of the SDK with MCP.
You can troubleshoot your agent workflows using the [OpenAI dashboard](https://platform.openai.com/traces/).
214
295
215
-
##Integration with MCP Clients
296
+
### Augment
216
297
217
-
### Using uvx (Recommended)
298
+
You can configure the Redis MCP Server in Augment by importing the server via JSON:
218
299
219
-
The simplest way to configure MCP clients is using `uvx`. Here are examples for popular clients:
300
+
```json
301
+
{
302
+
"mcpServers": {
303
+
"Redis MCP Server": {
304
+
"command": "uvx",
305
+
"args": [
306
+
"--from",
307
+
"git+https://github.com/redis/mcp-redis.git",
308
+
"redis-mcp-server",
309
+
"--url",
310
+
"redis://localhost:6379/0"
311
+
]
312
+
}
313
+
}
314
+
}
315
+
```
220
316
221
-
####Claude Desktop
317
+
### Claude Desktop
222
318
223
-
Add this to your `claude_desktop_config.json`, remember to provide the full path to `uvx`.
319
+
The simplest way to configure MCP clients is using `uvx`. Add the following JSON to your `claude_desktop_config.json`, remember to provide the full path to `uvx`.
Follow the prompt and provide the details to configure the server and connect to Redis (e.g. using a Redis Cloud database).
248
344
The procedure will create the proper configuration in the `claude_desktop_config.json` configuration file.
249
345
250
-
#### VS Code with GitHub Copilot
346
+
### VS Code with GitHub Copilot
347
+
348
+
To use the Redis MCP Server with VS Code, you must nable the [agent mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode) tools. Add the following to your `settings.json`:
349
+
350
+
```json
351
+
{
352
+
"chat.agent.enabled": true
353
+
}
354
+
```
251
355
252
-
Add this to your `settings.json`:
356
+
You can start the GitHub desired version of the Redis MCP server using `uvx` by adding the following JSON to your `settings.json`:
253
357
254
358
```json
255
359
"mcp": {
@@ -267,117 +371,7 @@ Add this to your `settings.json`:
267
371
},
268
372
```
269
373
270
-
#### Augment
271
-
272
-
Import the server via JSON:
273
-
274
-
```json
275
-
{
276
-
"mcpServers": {
277
-
"Redis MCP Server": {
278
-
"command": "uvx",
279
-
"args": [
280
-
"--from",
281
-
"git+https://github.com/redis/mcp-redis.git",
282
-
"redis-mcp-server",
283
-
"--url",
284
-
"redis://localhost:6379/0"
285
-
]
286
-
}
287
-
}
288
-
}
289
-
```
290
-
291
-
292
-
### Manual configuration
293
-
294
-
You can configure Claude Desktop or any other MCP Client to use this MCP Server running the main file directly (it uses environment variables).
295
-
The following example is for Claude Desktop, but the same applies to any other MCP Client.
296
-
297
-
1. Specify your Redis credentials and TLS configuration
298
-
2. Retrieve your `uv` command full path (e.g. `which uv`)
299
-
3. Edit the `claude_desktop_config.json` configuration file
300
-
- on a MacOS, at `~/Library/Application\ Support/Claude/`
301
-
302
-
```json
303
-
{
304
-
"mcpServers": {
305
-
"redis": {
306
-
"command": "<full_path_uv_command>",
307
-
"args": [
308
-
"--directory",
309
-
"<your_mcp_server_directory>",
310
-
"run",
311
-
"src/main.py"
312
-
],
313
-
"env": {
314
-
"REDIS_HOST": "<your_redis_database_hostname>",
315
-
"REDIS_PORT": "<your_redis_database_port>",
316
-
"REDIS_PWD": "<your_redis_database_password>",
317
-
"REDIS_SSL": True|False,
318
-
"REDIS_CA_PATH": "<your_redis_ca_path>",
319
-
"REDIS_CLUSTER_MODE": True|False
320
-
}
321
-
}
322
-
}
323
-
}
324
-
```
325
-
326
-
### With Docker
327
-
328
-
You can use a dockerized deployment of this server. You can either build your own image or use the official [Redis MCP Docker](https://hub.docker.com/r/mcp/redis) image.
329
-
330
-
If you'd like to build your own image, the Redis MCP Server provides a Dockerfile. Build this server's image with:
331
-
332
-
```commandline
333
-
docker build -t mcp-redis .
334
-
```
335
-
336
-
Finally, configure Claude Desktop to create the container at start-up. Edit the `claude_desktop_config.json` and add:
337
-
338
-
```json
339
-
{
340
-
"mcpServers": {
341
-
"redis": {
342
-
"command": "docker",
343
-
"args": ["run",
344
-
"--rm",
345
-
"--name",
346
-
"redis-mcp-server",
347
-
"-i",
348
-
"-e", "REDIS_HOST=<redis_hostname>",
349
-
"-e", "REDIS_PORT=<redis_port>",
350
-
"-e", "REDIS_USERNAME=<redis_username>",
351
-
"-e", "REDIS_PWD=<redis_password>",
352
-
"mcp-redis"]
353
-
}
354
-
}
355
-
}
356
-
```
357
-
358
-
To use the official [Redis MCP Docker](https://hub.docker.com/r/mcp/redis) image, just replace your image name (`mcp-redis` in the example above) with `mcp/redis`.
359
-
360
-
### Troubleshooting
361
-
362
-
You can troubleshoot problems by tailing the log file.
0 commit comments